Reminder to self
I’ve been working on getting my company’s website’s credit card processor upgraded to talk to multiple transaction services providers so that our customers can choose their own damn credit card processors and still work with us. I’d hoped to get this finished last week, and I left work Friday night at 5:30 thinking, «just a couple hours on Monday and it’ll be all done.» Well, I left Monday night and Tuesday night thinking I had only a couple hours left before I could start final testing. Well, we’re supposed to go live with this damn thing today and it’s not finished, so yeah, I’m blowing right past a major deadline.
Last night I didn’t leave at 5:30. I had a major glitch on my hands and I could not find the cause of it. Basically, for some reason the HTTP headers on the pages were coming up all screwyâI’m not conversant enough in HTTP headers to accuse them of being malformed, but they had a lot more information than they should have, and so the pages were displaying a bunch of garbeldygook at the top of the page. Lists of Apache modules installed on the server, stuff like that.
I had narrowed the problem down to a single subroutine, and I commented out sections and other sections to see where it might be. The more I looked, the more confused I got. I couldn’t narrow the problem down and nothing looked like it should affect headers that get sent to the browser before the page gets sent. I was frustrated and just stuck to it, wanting to wrestle the code into submission.
Finally at 9:45 I made a phone call to someone smarter than myself (The Compulsive Sponsor), who told me in no uncertain terms, to get the hell out of the office. It was an example of knowing what my sponsor would tell me, but needing to hear the words. I guess partly that’s me not wanting to take responsibility for leaving my post. Well, I did. I stopped off to a 10pm meeting at the Marina Dock (a lot of people gripe about the Dock, but I’m damn glad it exists so that I can grab a meeting at almost all hours) because I was so frustrated. It was after midnight before I got home and Ozzy was crying to be fed. I’d forgotten to get cat food on the way home, so I had to go back out to the grocery store. It was after 2:30 when I got to bed. My alarm was set for 5:00.
I actually slept in until 6:30am and came right on in to the office because I didn’t know how much trouble this code would be. Ran into dracunculus in the BART station which was pleasant except for the awkwardness of trying to make small talk with a fried brain and a minimum of sleep. I got in to the office at 8:15 and…
.…ate a muffin, drank a double-shot depth charge and solved the bug by 8:45.
What was the bug? My bad. Improperly scoped variables with the same name. $status
in one routine was being set to ‑1 and the routine that selects which http header to send out also uses $status
. Instead of sending out Status 500 (or 404 or whatever) the server was trying to serve up http status ‑1. Nice. I had to add the keyword my
to the variable declaration in each routine, which I should have done in the first place anyway.
Oh, I guess I do know enough about http headers to know that’s malformed.
But the lesson is: don’t stay late working when trying to get through a sticky problem. I knew that anyway, but it bears repeating because I’m sort of dense that way.
In any case, I now have a lot of work to do to catch up. Yay fun!
There is so much more from the last 24 hours, big news, more death, but I just can’t get into it now.