• Uncategorized

    minWorkerThreads and autoConfig

    A couple of days ago I was helping a colleague of mine with some tests and I had the need to change the ThreadPool configuration; more precisely, I wanted to increase the minWorkerThreads value. Everything was working fine at first, because I was changing the value by code using the SetMinThreads method, but I also wanted to test it changing the values from my machine.config. First thing, to be on the safe side I set autoConfig=”false” (see why here) and set my <processModel> element as follows: <processModel autoConfig=”false” minWorkerThreads=”23” /> Why set it to 23? Simply because I did not want it to match any default. I run my test page, attached Windbg to the process and had a look at !threadpool output: something was definitely wrong, as it was telling that minWorkerThreads was set to 2 (the default value is 1 * CPU number = 2 for my machine): 0:029> !threadpool CPU utilization 48% Worker Thread: Total: 2 Running: 0 Idle: 2 MaxLimit: 40 MinLimit: 2 Work Request in Queue: 0 -------------------------------------- Number of Timers: 8 -------------------------------------- Completion Port Thread:Total: 1 Free: 1 MaxFree: 4 CurrentLimit: 0 MaxLimit: 40 MinLimit: 2 Now I see from here and with some…

  • Uncategorized

    Strict mode and 100% CPU in IE 7

    I got a couple of cases of this kind recently, one where the web pages were served by PerformancePoint and the other one was a completely custom web site, but both of them shared the same common root issue: browsing some specific pages, the CPU on client got constantly at 100% and the GUI was completely frozen From the Internet Explorer dump we captured it was very clear that thread 2 was the one burning the CPU: 0:000> !runaway User Mode Time Thread Time 2:1654 0 days 0:07:55.954 0:1610 0 days 0:00:00.420 7:142c 0 days 0:00:00.070 9:1788 0 days 0:00:00.050 4:1388 0 days 0:00:00.010 17:8f0 0 days 0:00:00.000 16:11cc 0 days 0:00:00.000 15:1180 0 days 0:00:00.000 14:11ec 0 days 0:00:00.000 13:1778 0 days 0:00:00.000 12:f8 0 days 0:00:00.000 11:7dc 0 days 0:00:00.000 10:e0c 0 days 0:00:00.000 8:1784 0 days 0:00:00.000 6:1420 0 days 0:00:00.000 5:1478 0 days 0:00:00.000 3:1338 0 days 0:00:00.000 1:1634 0 days 0:00:00.000 And thread 2 has his stack: 0:002> kpL1000 ChildEBP RetAddr 01bcf0bc 43d0e4d7 mshtml!CFormatInfo::GetMatchedBy 01bcf170 43cf914f mshtml!CStyleSelector::Match+0x34d 01bcf694 43d12175 mshtml!CStyleSheetArray::Apply+0x1e1 01bcf6f4 43d17298 mshtml!CElement::ApplyDefaultFormat+0x490 01bcf708 43cf8958 mshtml!CAnchorElement::ApplyDefaultFormat+0x9f 01bcf748 43cf53e2 mshtml!CElement::ComputeFormatsVirtual+0xaa3 01bcf764 43d0cb08 mshtml!CElement::ComputeFormats+0x3a 01bcf9f4 43d3876b mshtml!CTreeNode::GetFancyFormatHelper+0x4b 01bcfb10 43e167ab mshtml!CElement::UpdateFormats+0x2da 01bcfb2c 43d3d908 mshtml!CElement::HandleMouseHoverForStyle+0x1a7 01bcfbac 43e3f53c mshtml!CDoc::PumpMessage+0xa3f 01bcfcf8…

  • Uncategorized

    Sys.WebForms.PageRequestManagerParserException

    Ajax is a flexible and powerful technology, but sometimes “With great power comes great responsibility” ?. And also some kind of fragility and sensitivity to external factors. In this case browsing the application worked somehow fine, but triggering a partial postback we were getting the following error on the browser: The message received from the server count not be parser. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled. If you get weird Ajax script errors, my experience tell me to always first check if Http compression is enabled on the web server (this is not the first time I tackle this topic), but this was not the case. An important thing to note is that the application was working perfectly fine when browser from the LAN, while it was failing when browsed from the Internet (no matter the browser we were using). An important thing to note is that browsing from the Internet, our request was going through IAG: Intelligent Application Gateway (IAG) is a remote access gateway that boosts productivity by giving mobile and remote workers, partners, and customers easy, flexible, and secure access…

  • 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

    TabContainer rendered incorrectly in Design View

    One of the (very few) downsides I see working in Customer Support is that most of the times when talking to colleagues and friends or writing a new post for my blog, I find myself talking about problems, bugs, exceptions… what is not working fine, like a doctor most of the times has to deal with malaises and diseases. Anyway the good part is that most of the times we are able to find the solution to those problems, or at least we can alleviate them. This is the case of a problem I had with the Ajax TabContainer control which is not displayed correctly in Design View, where the Tab caption is not completely visible, as in the screenshot here below: But if we open the page in a real browser, it displays correctly: This is part of a problem reported on the Connect site some time ago: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=322477. This has to do with the !DOCTYPE (Document Type Definition, or DTD), which among other things influences how CSS styles, formatting and positioning are applied to the page and its UI elements. With DTD we can control IE’s strict standard compliance; for example in this case if we remove the…

  • Uncategorized

    HoverNodeStyle not applied with partial postback

    The TreeView control has built-in Ajax capabilities when it comes to dynamically fill it nodes; this is done through the PopulateNodesFromClient: Sometimes, it is not practical to statically predefine the tree structure due to data size or custom content that depends on user input. Because of this, the TreeView control supports dynamic node population. When the PopulateOnDemand property for a node is set to true, that node gets populated at run time when the node is expanded. In addition to populating nodes on demand, it is possible to populate the nodes directly on a supported client browser. When the PopulateNodesFromClient property is set to true, a service is called from the client to populate the tree nodes, which eliminates the need to post back to the server. Otherwise, the TreeView control posts back to the server to populate the nodes. The EnableClientScript property must also be set to true in order for the PopulateNodesFromClient property to be set to true. Here’s the sample page: Anyway there is a problem: if you run the page you’ll see the ForeColor defined for HoverNodeStyle works as expected (the text turns red) But if you expand one of the nodes clicking on the “+”…

  • 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

    ViewState validation troubles?

    If you work with web sites in a complex/multi server environment you might be familiar with this error and as the error message itself suggest, the first thing to check if the machineKey value which must be the same across all of the involved server. Anyway every now and then it happens that you might get this same error even if you are not in a NBL/Cluter environment (Tess and Tom have blogged about this here, here and here) or if you are absolutely sure you have properly configured the machineKey value. So what else can lease you to this state? If you want some quick  background you have a look at my post here; basically we have the following (very raw) steps: Begin processing the new request Load the “old” state (ViewState and ControlState) received with the posted values Process the posted data (the actual form values) and raise the “change” events to change control state and do the real page work Save the new state (again, ViewState and ControlState) Send the result back to the client It is important to note that if you dynamically add controls at runtime on your page (i.e. you do not only rely…