Friday, September 18, 2009

So I got called in to looking into this problem of broken images on some pages. The information I was given was pretty vague, so I couldn't just look at the code. I got a Microsoft Word document with a screenshot of some broken images plus a URL and a login and a password. I had never looked at any code behind the site before.

I looked a little at the box it was running on, but had no idea where the page was, because it was hidden behind a mess of struts and tiles, and I don't know how to interpret the struts and tiles configuration to allow me to go from a URL to the actual files making up the page. Furthermore, since all the strings were localized, grepping through all the files for strings in the screenshot didn't work.

I looked at the access logs for the last few days, and, as I suspected, there were no failed requests for images.

So I tried to log in to the site using Firefox, but I never got a page back. I tried using elinks, and got an error page back. Looking at the access logs, I saw that the pages were eventually served up after 90 seconds. Something was failing and timing out. So I went back to Firefox and logged into the site by waiting more than 90 seconds, and then waiting 90 more seconds to go to the page that was supposed to have the broken images. There was nothing there. The system was misconfigured to connect to an inaccessible host, and timing out after 90 seconds. This problem was a separate issue, though it might have been put that way in an attempt to fix the broken image problem. I didn't have (or want) the permissions necessary to fix that configuration issue.

I kept looking through the files for the site and eventually came across some deep subdirectory that had some tiles files that looked like they were responsible for the broken images.

As I originally suspected, the images were from an internal URL. So it all worked fine for the ignorant developers in their development boxes. I could have confirmed that much more quickly if the original report had been better than a screenshot in a Microsoft Word document. I did report my original suspicions as a guess after having seen no failed requests for images in the access logs. My conclusions were still a guess, as I had only seen the files for the site for the first time a couple of hours before, but I recommended proxying the images from the internal host through the front end box.

Then the lead front-end guy came to me and said that the only solution was to copy the images from the back-end package into the front-end package. I disagreed and argued that they should proxy them through the front-end, so that they wouldn't have to maintain them in multiple places. But really, I don't care if they copy the images or if they proxy them, as long I don't have to deal with it again.

No comments:

Post a Comment