The Daily Parker

Politics, Weather, Photography, and the Dog

Israel's government throws a tantrum

Children and authoritarians tend to react to clear evidence against them by doubling down. The current Israeli government has continued the tradition:

The Israeli prime minister Binyamin Netanyahu's decision to approve the construction of 3,000 new homes is widely seen as a response to the United Nations vote earlier this week that recognised a Palestinian bid to be a "non-member observer state".

The US, with Israel, strongly opposed that move, while Britain abstained in the vote. But now both countries have criticised the Israeli settlement decision, saying it hurts the chances of a two-state solution and the search for peace in the troubled region.

"Let me reiterate that this administration, like previous administrations, has been very clear with Israel that these activities set back the cause of a negotiated peace," [US Secretary of State Hillary] Clinton said, in remarks delivered at the Saban Center think tank in Washington on Friday.

[British Foreign Secretary William] Hague said he was "extremely concerned" at the plans, which have been reported in the Israeli press as including a four-square-mile area just east of Jerusalem that is seen as vital to keeping open a viable land corridor between the city and any future Palestinian state.

The meta-message to Netanyahu is, "You cannot achieve your goals pursuing your current course of action." But just as it's difficult for 4-year-olds to understand this presented like that, so is it for Bibi and the right. In fact, I think the defining characteristic of any extremist is an inability to accept the basic fact that other points of view exist, let alone that policies predicated on their point of view will fail spectacularly, given enough time.

Full disclosure: I'm Jewish, as any but the most extreme Rabbis will agree. (By "most extreme" I mean any Rabbi who believes no one's mother can convert to Judaism.) I'm also atheist, as anyone who's read this blog knows. I also have an allergic reaction against anyone who claims that their ethnic/political/knitting group is the only ethnic/political/knitting group qualified to discuss matters that affect people beyond their group's boundaries.

We're still arguing about this?

Geologist James Powell points out that the peer-review process keeps finding in favor of climate change:

The most obvious criticsism—that this is an argumentum ad populum—only works if you misunderstand how science works. Every scientist has an implicit incentive to prove some other scientist wrong. You can make your career in science by showing that the received wisdom doesn't fit all the evidence. So the numbers in that pie chart have to raise eyebrows, even if the eyes under them have blinders on.

Since the planet has been hotter in the past, I don't worry that global climate change will kill everyone. In fact, Chicago will probably do fine, as will the Canadian plains and much of central Asia.

The problem with the American right wing, not to mention other governments worldwide, is that by refusing to believe the climate is changing—regardless of the cause—they're refusing to take simple actions against the predictable consequences of it. Ostriches don't stick their heads in the sand in real life, because if they were to do that, they'd be killed by the things they were hiding from. Of all earth's species, only humans can look at impending doom and ignore it. Or, to put it another way:

Is it October again?

No, I don't mean "will we have to endure another six weeks of an election." I mean that Chicago today hit 17°C, not a record (22°C in 1982), but also more normal for mid-October than for the second day of meteorological winter.

Tomorrow may be warmer. The Climate Prediction Center forecasts a warm December followed by more normal temperatures through March, so we might get a good Chicago winter anyway.

Remember, though, that warm winters lead to warm summers (though not necessarily the reverse), so I sincerely hope it cools off a bit before April. I'll take a couple of frigidly-cold months in exchange for a cool summer.

Debugging our first Azure 1.8 deployment

I've just spent three hours debugging something caused by a single missing line in a configuration file.

At 10th Magnitude, we've recently upgraded our framework and reference applications to the latest Windows Azure SDK. Since I'd already done it once, it didn't take too desperately long to create the new versions of our stuff.

However, the fact that something works in an emulator does not mean it will actually work in production. So, last night, our CTO attempted to deploy the first application we built with the new stuff out to Azure. It failed.

First, all we got was a HttpException, which is what ASP.NET MVC throws when something fails on a Razor view. The offending line was this:

@{ 
   ViewBag.Title = Html.Resource("PageTitle");
}

This extension method indirectly calls our custom resource provider, cleverly obfuscated as SqlResourceProvider, which then looks up the string resource in a SQL database.

My first problem was to get to the actual exception being thrown. That required me to RDP into the running Web role, open a view (I chose About.cshtml because it was essentially empty), and replace the code above with this:

@using System.Globalization
@{
  try
  {
    var provider = new SqlResourceProvider("/Views/Home/About.cshtml");
    var title = provider.GetObject("PageTitle", CultureInfo.CurrentUICulture);
    ViewBag.Title = title;
  }
  catch (Exception ex)
  {
    ViewBag.Error = ex + Environment.NewLine + "Base:" + Environment.NewLine + ex.GetBaseException();
  }
}
<pre>@ViewBag.Error</pre>

That got me the real error stack, whose relevant lines were right at the top:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at XM.UI.ResourceProviders.ResourceCache.LogDebug(String message)

Flash forward an hour of reading and testing things. I'll spare you. The solution is to add a second binding redirect in web.config:

<dependentAssembly>
  <assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" 
    publicKeyToken="31bf3856ad364e35" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="1.0.0.0" />
  <bindingRedirect oldVersion="1.1.0.0-1.8.0.0" newVersion="1.8.0.0" />
</dependentAssembly>

Notice the second line? That tells .NET to refer all requests for the service runtime to the 1.8 version.

Also, in the Web application, you have to set the assembly references for Microsoft.WindowsAzure.Configuration and Microsoft.WindowsAzure.Storage to avoid using specific versions. In Solution Explorer, under the References folder for the web app, find the assemblies in question, view Properties, and set Specific Version to false.

I hope I have saved you three hours of your life. I will now go back to my deployment, already in progress...

Update, an hour and a half later: It turns out, there's a difference in behavior between <compilation debug="true"> and <compilation> on Azure Guest OS 3 (Windows Server 2012) that did not exist in previous guest OS versions. When an application is in debug mode on Azure Guest OS 3, it ignores some errors. Specifically, it ignores the FileNotFoundException thrown when Bundle.JavaScript().Add() has the wrong version number for the script it's trying to add. In Release mode, it just barfs up a 500 response. That is maddening—especially when you're trying to debug something else. At least it let our app log the error, eventually.