• Uncategorized

    WebResource.axd going over HTTP when we are browsing on HTTPS

    Consider this scenario: you are browsing a web site which at some point switches from http to https, and your browser show you a warning. In Firefox you get: Connection Partially Encrypted Parts of the page you are viewing were not encrypted before being transmitted over the Internet. Information sent over the Internet without encryption can be seen by other people while it is in transit In Internet Explorer you get: You can check KB #910444 for SSL termination in ASP.NET; if this does not help, check this post, that was the situation I had to deal with a few days ago. Just an additional note: if you wish to control how your browser behaves in such situations, you can check (and change) the following settings in Internet Explorer and Firefox: Internet Explorer  Firefox  Carlo Quote of the day: The release of atomic energy has not created a new problem. It has merely made more urgent the necessity of solving an existing one. – Albert Einstein

  • Uncategorized

    Again on 503, “Service Unavailable” in IIS7 x64

    Getting feedback always nice, as it is getting suggestions about new posts as happened this morning with my colleague Michael Clemens after he read my latest entry from yesterday (so thanks Mike for sharing this!). The point is, you may get a similar experience (exactly vice versa) after having installed the “IIS media pack 1.0 – Web playlists and bit Rate Throttling package” as part of the Microsoft Web Platform installer” on a x64 OS version. The media pack installs two 32-bit modules (“BitrateModule” and “PlaylistHandler”) that prevent a 64-bit application pool from starting up, resulting in a fail-fast disabled application pool. A look at the Application event log first tells you the application pool couldn’t load “%ProgramFiles%\IIS\Media\playlisthandler.dll”. Searching applicationHost.config for this module occurrence, you can simply adjust the affected <add> element with the preCondition attribute set to bitness32. After this, the affected app pool still cannot start… ? Back to the Application event log, you’ll see another module load failure for “%ProgramFiles%\IIS\Media\bitratemodule.dll“. Changing this in the same manner as for the PlaylistHandler module will give you the following entry in applicationhost.config added below the <globalmodules> section: <add name="BitrateModule" image="%ProgramFiles%\IIS\Media\bitratemodule.dll" preCondition="bitness32" /> Do not forget to search the whole “%windir%\System32\inetsrv\config\applicationHost.config”…

  • Uncategorized

    “Service Unavailable” in IIS7 with 32 bit application pool

    As sometime happens, while setting up a repro for a customer (I’m working with him on a completely different problem) I wanted to test my sample code on a 32 bit w3wp.exe instance (I am running Windows 2008 x64); nothing easier on IIS7, just create a new application pool and change its “Enable 32.Bit Applications” property to true in IIS Manager and you’re done: But when I tried to run my code, I got this a “HTTP Error 503. The service is unavailable” message and the application pool was stopped. The Application event log contains a few entries like the following: Log Name:      Application Source:        Microsoft-Windows-IIS-W3SVC-WP Date:          02/02/2009 14.19.05 Event ID:      2280 Task Category: None Level:         Error Keywords:      Classic User:          N/A Computer:      <computername> Description: The Module DLL C:\Windows\system32\RpcProxy\RpcProxy.dll failed to load.  The data is the error. I also got some of this warning: Log Name:      System Source:        Microsoft-Windows-WAS Date:          03/02/2009 20.42.55 Event ID:      5139 Task Category: None Level:         Warning Keywords:      Classic User:          N/A Computer:      <computername> Description: A listener channel for protocol 'http' in worker process '4580' serving application pool '32bitPool' reported a listener channel failure.  The data field contains the error number If I changed the application pool back to…

  • Uncategorized

    Unable to get the private bytes memory limit for the W3WP process (reloaded)

    Sometimes they come back, as my favorite writer says… This is the case of this error message I already wrote about a couple of years ago; anyway this time the customer before calling CSS for support had already tried the suggestions on my previous post, unfortunately without luck. The customer has tried: aspnet_regiis -ga “Network Service” cscript metaacl.vbs IIS://Localhost/W3SVC/AppPools IIS_WPG RE Assured the account running Application Pool (NETWORK SERVICE) is part of the IIS_WPG group The difference this time is that the application’s files are hosted on a centralized network share; for this particular scenario, also the account used in the “Connect As…” dialog in IIS Manager must be part of the IIS_WPG group: Carlo Quote of the day: I like nonsense, it wakes up the brain cells. Fantasy is a necessary ingredient in living, It’s a way of looking at life through the wrong end of a telescope. Which is what I do, And that enables you to laugh at life’s realities. – Dr. Seuss

  • Uncategorized

    How to disable HTTP compression for specific file types?

    The question arose from a customer whom had implemented an application to stream PDF files from ASP.NET and was also using HTTP compression to save bandwidth and improve download time; using IE 6, Adobe Reader failed to open the file with the following error message: Adobe Reader could not open ‘<name>.tmp’ because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment that wasn’t correctly decoded) The customer had no problems with Adobe Reader using IE7, but of course they could not force their customers to upgrade. I already worked on a few calls similar to this one in the past and I had the chance to dig into this issue with our Escalation Engineers (both from the Internet Explorer and IIS teams) and also with the Product Group; it turned out that there is a problem in the compression mechanism in IE until version 6, which basically affected the ability to successfully decompress the HTTP/Html stream received from an IIS server when using HTTP compression. At the time there was also a minor issue on the server side of compression, but it has been fixed.…

  • Uncategorized

    WebResource.axd or ScriptResource.axd not working

    Http compression with client-side scripting should be handled with care. The problem can have different symptoms and manifest in different ways, but essentially it has a common root cause and I have already discussed some of the aspects (for example see here and here). This time the customer whom reported the problem was using Forms Authentication in his application so the first time an unauthenticated user browsed it, he was redirected to the login page configured in web.config. So far so good. In this case the problem was a javascript error notified by the standard yellow icon in the bottom left corner of IE; the error was an “Object expected” on “WebForm_AutoFocus()” which is a method generated by ASP.NET as a result of an object.SetFocus() call on the server-side. Some quick theory WebResource.axd and ScriptResource.axd are Http Handlers used by ASP.NET and Ajax to add client-side scripting (usually javascript) to the outgoing web page for example to have client-side input validation, set the focus on a specific control (as in this example) etc… Note that if you search your disk for .axd files, you’ll not find them; they are created on the fly in memory and executed from there. Well,…

  • Uncategorized

    How many application pools can you cope with?

    This is an interesting question I have to admit I had not thought to until we got a case from a customer whom was in trouble with his production servers: how many application pools can you run on IIS? Event better, how many w3wp.exe instances can the OS cope with? As quite often happens in our job, the correct answer is: it depends… First, the problem. The customer was a hosting company so they had a large numbers of sites on each web server, around 450, each of them with its own application pool, each application pool run under its own specific account and aspExecuteInMTA was set to 1 on each server. Under some circumstances asp applications from some web sites are failing with the following message (roughly translated from Spanish): Server error ‘ASP 0177 : 80070057’ Error in Server.CreateObject /site/page.asp, line 338 80070057 When the problem occurred the customer recycled the two or three top consuming web sites in terms of memory, threads and handles; then the failing web site was usually back online. Note that the failing web site was always only affected by other problematic ones, it was almost never the culprit. At first we were distracted…

  • Uncategorized

    Time-taken and LogParser for web site statistics

    The time-taken field is quite handy if your web application or IIS web server is performing poorly (or slower that you expect) or even for simple statistics and monitoring purposes, if you want to keep under how long it takes every web request to be processed and the page sent back to the client. In earlier versions of IIS the time-taken field was not selected by default so I often had to request customers to first enable it, wait some more time for the problem to reoccur (to give IIS the change to create a significant amount of logs with the new value) before being able to start troubleshooting. Well, at least before being able to extract some statistics involving the duration of web requests. Luckily in IIS 7 time-taken is now selected by default so we already it logged and ready to use. Taken from the IIS online docs, here is the meaning each field in IISW3C logs: Date (date) Logs the date on which the request occurred. Selected by default Time (time) Logs the time, in Coordinated Universal Time (UTC), at which the request occurred. Selected by default Client IP Address (c-ip) Logs the IP address of the…

  • Uncategorized

    Disable recycling in IIS 7? Use AppCmd

    I stumbled on this while trying to repro a remote debug problem for a customer: as you might know from this post from Johan, debugging ASP.NET on IIS7 needs some special care about the application pool recycling policy otherwise if you’ll not be fast enough IIS will kill your process. Well, I was doing some tests and wanted to disable the Regular Time Interval value through the IIS Manager (default for this property is 1749 minutes, i.e. 29 hours): But if you try to set the value to zero, I’ll get an error message (at least in Windows 2008 RTM). Luckily we can still use AppCmd to change our config store, here it is how: appcmd.exe set AppPool <AppPoolNameHere> /recycling.periodicRestart.time:00:00:00 And if you now go back to the UI you’ll see the change correctly reflected Of course you can manually change your applicationHost.config file, but handle it with care and be sure you always have a backup first! appcmd add backup <BackupNameHere> Use the Administration Pack It’s still a preview as of now, but it contains some really interesting new features for the IIS Manager. For example you can select the server node within the Connections left panel and under…