The Daily Parker

Politics, Weather, Photography, and the Dog

Why you should always "sleep on it"

If one of the developers on one of my teams had done this, I would have (a) told him to get some sleep and (b) mocked him for at least a week afterwards.

Saturday night I spent four hours trying to figure out why something that worked perfectly in my local Azure emulator failed with a cryptic "One of the request inputs is out of range" message in the Cloud. I even posted to StackOverflow for help.

This morning, I spent about 90 minutes building a sample Cloud application up from scratch, adding one component at a time until I got to the same failure. And, eventually, I got to the same failure. Then I stepped through the code to figure out

And I immediately saw why.

The problem turned out to be this: I have two settings:

    <?xml version="1.0" encoding="utf-8"?>
    <ServiceDefinition name="Cloud" ...>
      <WebRole name="WebRole" vmsize="Small">
        <ConfigurationSettings>
          <Setting name="MessagesConfigurationBlobName" />
          <Setting name="MessagesConfigurationBlobContainerName" />
        </ConfigurationSettings>
      </WebRole>
    </ServiceDefinition>

Here's the local (emulator) configuration file:

    <?xml version="1.0" encoding="utf-8"?>
    <ServiceConfiguration ...>
      <Role name="WebRole">
        <ConfigurationSettings>
          <Setting name="MessagesConfigurationBlobName" value="LocalMessageConfig.xml"/>
          <Setting name="MessagesConfigurationBlobContainerName" value="containername"/>
        </ConfigurationSettings>
      </Role >
    </ServiceConfiguration>

Here's the Cloud file:

    <?xml version="1.0" encoding="utf-8"?>
    <ServiceConfiguration ...>
      <Role name="WebRole">
        <ConfigurationSettings>
          <Setting name="MessagesConfigurationBlobName" value="containername" />
          <Setting name="MessagesConfigurationBlobContainerName" value="CloudMessageConfig.xml"/>
        </ConfigurationSettings>
      </Role >
    </ServiceConfiguration>

I will now have a good cry and adjust my time tracking (at 3am Saturday) from "Emergency client work" to "Developer PEBCAK".

The moral of the story is, when identical code fails in one environment and succeeds in another, don't just compare the environments, compare *everything that could be different in your own code* between the environments.

Oh, and don't try to deploy software at 3am. Ever.

How to lose sleep one build at a time

While trying to move a customer's app into the cloud yesterday (and well into this morning), I encountered a problem that doesn't make any sense. I now very much want to find the guys who wrote Microsoft Azure's error handling and punch them in their faces.

When you access an Azure storage container, you have to use only lower-case letters, or Azure will throw a StorageClientException with the thoroughly unhelpful message "One of the request inputs is out of range." So, in all the code I've written that uses Azure storage, it makes sure everything that needs to be lower-case is actually lower-case.

So why am I getting the exception now? No one seems to know.

Worse, the exception only happens in actual deployments, not in the Azure emulator (which you use to test your code on your own computer).

I hope to have this figured out soon. Because I'd really like to get some sleep.

The Daily Parker...in the cloud

Sometimes things just work.

Last weekend, I wrote about moving my last four web applications out of my living room the Inner Drive Technology International Data Center and into the cloud via a Microsoft Azure Virtual Machine.

Well, if you're reading this blog entry, then I've succeeded in moving The Daily Parker. Except for transferring files (the blog comprises 302 megabytes over 13,700 files), which happened in the background while I did other things, it only took me about 45 minutes to configure the new installation and make the necessary changes to DNS.

Despite the enormous volume of data, this was the easiest of the four. DasBlog has no dependencies on outside services or data, which means I could move it all in one huge block. The three remaining applications will take much more configuration, and will also require data and worker services.

I'm still surprised and pleased with the smoothness of the transfer. If the other three migrations go anywhere nearly as easily as this (taking into consideration their complexities), I'll be an Azure Evangelist for years.

Link round-up

Lots of interesting articles hit my inbox today, and I don't have time to plagiarize write about them:

That is all. I really need to work now.

Romney plan would accelerate redistribution upward

As if the 10-year-long wholesale theft of wealth from the middle class to the parasite class financial services sector weren't insult enough, it turns out Mitt Romney's tax plan would injure us even more:

The study was conducted by researchers at the nonpartisan Tax Policy Center, a joint project of the Brookings Institution and the Urban Institute, who seem to bend over backward to be fair to the Republican presidential candidate.

His rate-cutting plan for individuals would reduce tax collections by about $360 billion in 2015, the study says. To avoid increasing deficits — as Romney has pledged — the plan would have to generate an equivalent amount of revenue by slashing tax breaks for mortgage interest, employer-provided health care, education, medical expenses, state and local taxes, and child care — all breaks that benefit the middle class.

“It is not mathematically possible to design a revenue-neutral plan that preserves current incentives for savings and investment and that does not result in a net tax cut for high-income taxpayers and a net tax increase for lower- and/or middle-income taxpayers,” the study concludes.

Krugman is livid:

And the Romney people respond with deep voodoo, invoking the supposed fabulous growth effects from his tax cuts. And who could argue? Remember how the economy tanked after Clinton raised taxes? Remember how great things were after Bush cut them? Oh, wait.

More seriously, we have lots of empirical work on the effects of tax changes at the top — and none of it supports the Romney camp’s claims. What we’ve just learned is that they were faking it all along. There is no plan to offset the tax cuts; Romney is just intending to blow up the deficit to lavish favors on the wealthy, then use it as an excuse to savage Social Security and Medicare.

The election, which is just 95 days away, really is a referendum on wealth inequality. Voting for Romney is voting for feudalism. Voting for the president at least keeps the middle class fingers in the dam. (And what an image that is...)

Goof Off at Work Day

According to Jeff Atwood, today's the day:

When you're hired at Google, you only have to do the job you were hired for 80% of the time. The other 20% of the time, you can work on whatever you like – provided it advances Google in some way. At least, that's the theory.

Although the concept predates Google, they've done more to validate it as an actual strategy and popularize it in tech circles than anyone else. Oddly enough, I can't find any mention of the 20% time benefit listed on the current Google jobs page, but it's an integral part of Google's culture. And for good reason: notable 20 percent projects include GMail, Google News, Google Talk, and AdSense. According to ex-employee Marissa Meyer, as many as half of Google's products originated from that 20% time.

He goes on to ask if your company is ready, and offer some suggestions how to implement it. I think it's easier to do when you don't have billable-hour pressure, but still, we at my company do manage to get some goofing-off time in.

Or, put another way, "why is this day different from all other days?"

Hottest and 3rd-driest year, statewide

It's not just Chicago; the Illinois State Climatologist has pronounced this year hotter than hell:

This year so far is the warmest and third driest on record. The statewide average temperature for January-July 2012 was 56.9 degrees, 5.5 degrees above normal. The statewide average precipitation for January-July was 357 mm, 249 mm below normal or 59 percent of normal.

Statewide Average Temperature Rankings for January-July

  1. 2012: 13.8°C
  2. 1921: 13.4°C
  3. 1987: 12.3°C
  4. 1998: 12.2°C
  5. 2006: 12.1°C

Statewide Average Precipitation Rankings for January-July

  1. 1936: 310 mm
  2. 1934: 344 mm
  3. 2012: 357 mm
  4. 1988: 371 mm
  5. 1914: 386 mm

That said, I'm sitting outside with my laptop on a lovely, clear 26°C night. The really awful heat returns tomorrow, though...

Unofficially hottest, officially second, more to come

The month ended with Chicago Midway reporting its warmest July ever, while our official O'Hare station had the second-hottest ever:

Of all the summers on the books over Chicago's official observational record dating back to 1871, only the 1921 season managed a temperature higher than the 25.3°C reading on the books to date this year. That makes this the warmest opening two-thirds of a meteorological summer season here in 91 years.

The bleak rainfall situation continues across the area as this year's drought worsens. At 116 mm, this summer's rain tally ranks 23rd driest of the 142 years to which we can compare it.

And it's not over; the Climate Prediction Center published this map yesterday:

The good news is, we'll probably have a warm autumn, too...