Wednesday, 9 April 2008

Excel hangs for 5 mins opening file over HTTP is an eye-wateringly detailed KB article, but it helped me resolve an interesting problem the other day. At least, with a lot of help from some smart people who know about proxies and a network packet sniffer.

We had reports of Excel files on a particular host opening straight away from Internet Explorer, but opening them from Excel was causing a five minute hang before the prompt for username and password would appear.

Anyway, after a lot of head-scratching, we figured it out. When Excel tries to open a file over HTTP it sends an extra OPTIONS request (that meant nothing to me when I first read it, but I saw it on the network trace so I know it's true) to figure out if the host is capable of read-write access. Only after it gets back the response does it then ask for permissions on the file itself. (Internet Explorer skips the first part and just goes straight in for the file permissions.)

In our case it turned out that the host was in fact sending back an incomplete response to this first OPTIONS request. Some of our proxies were just ignoring the fact the response was incomplete and forwarding it back anyway for Excel to sort out. The proxies which were actually handling it correctly were the ones where we had the problem; they'd see an incomplete response and sit there waiting for the rest of it. After five minutes they'd time out, Excel would decide the host wasn't capable of read-write access so it would just go ahead and request read-only permissions for the file, then we'd get our prompt for credentials.

Networking isn't usually my strongest subject, so it was good to be able to follow this one through to conclusion and actually understand what the trace was showing us. It was also nice to see a detailed description of how something works in an Office product. There aren't enough of those about!

No comments:

Post a Comment

Creative Commons License This work by TechieBird is licensed under a Creative Commons Attribution-No Derivative Works 2.0 UK: England & Wales License.