• Uncategorized

    Livesite, resource names and maintain sanity under stress

    Coming from CSS (Customer Service and Support) I was used to work under pressure. As you can imagine, when a customer opens a support ticket it means something is broken or at the bare minimum is not working as they would like, so being able to quickly figure out the root cause of the problem and suggest how to resolve it a key component to the role. Equally important is to be able to manage those situations when things are really broken badly and the stakes are high: imagine an e-commerce website where transactions keep failing for some reason. The customer is losing money and his customers are unhappy (frustrated? fuming?) and likely taking their business elsewhere. Not nice. As Service Engineer in Azure, when one of our services is down it does not impact one customer, it impacts half a Continent! ? Something I learned quickly in my new role is to think in terms of livesite. What happens if I need to do “x” during a livesite incident? How quickly can I find that information, or get to that tool?  This applies to almost everything I do, from seemingly negligible decisions (I need a new Storage Account, how…

  • Uncategorized

    [TOC..TOC..] … is this thing on?!?

    2 years 2 months and 10 days, or 26.3 months, or 324.2 weeks, or 2,270 days (you get the idea ?) since my last blog post. Professionally speaking that was another life entirely. I used to write on MSDN, someone may even have read and still remember some of my posts on https://blogs.msdn.com/b/carloc: at that time I was working in Microsoft CSS (Customer Service and Support) with web development technologies, and I used to write about debugging tough problems and describe troubleshooting techniques I was coming across working with customers across Europe. It was interesting and fun and I learned a lot and I enjoyed sharing it. As all good things tend to come to an end, I decided it was time to moved on, I wanted a new challenge, I wanted to learn something new, and that required a good amount of energy on itself. Figure out what to do next, where to go and what to look for. At that point in my career I had worked as a Windows and the Web developer, then joined Microsoft and worked helping other developers fix and improve their web applications, I figured the next logical move after building and troubleshooting…

  • Archive,  Uncategorized

    Error 502 – Web server received an invalid response while acting as a gateway or proxy server

    I saw this error some time ago while working on an eCommerce solution. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server. Redirect/move happens like it should, but after approximatively 2 minutes after posting an order the user receives an http error 502. The order is correctly processed by SAP but the web applications is built in a way that the user is getting a confirmation page when the order is processed: this page is never presented to the user due to the 502 error. FREB gave us further details about the error: 502.3, 2147954417 which translates into ERROR_INTERNET_OPERATION_CANCELLED. This lead me to this post which describes a different error but based on the same principle and the solution still applies to our scenario: we increased the proxy timeout to 5 minutes to accommodate all reasonably long running requests and the problem was solved. appcmd.exe set config  -section:system.webServer/proxy /timeout:"00:05:00"  /commit:apphost     Carlo It’s not the size of the dog in the fight, it’s the size of the fight in the dog. Mark Twain

  • Archive,  Uncategorized

    Moving to Windows 2008: smartcard slow performance?

    Suppose you have a web application which authenticates clients through a smartcard certificate and everything is working fine, then you decide to move your web application to Windows Server 2008 (which is a good decision in many ways ?) but your users are suddenly complaining about slow performance, pages are loading slower than they used to do and you cannot find any explanation on the network infrastructure, everything seems to be properly configured on the client and on the server… what is happening? Well, as you can imagine this is what happened to a customer I worked with recently. A closer look at the client showed that every time a new object in the page was loaded (images, script files, css…) the smartcard was checked for the certificate, resulting in a major performance loss. To make the story short, the behavior is controlled by client certificate negotiation, specifically by SSLAlwaysNegoClientCert which in IIS 7 has been moved to http.sys (see http://learn.iis.net/page.aspx/110/changes-between-iis-60-and-iis-7-security/); you can configure the  <access> element as described or using netsh with a command such as the following: netsh http add sslcert ipport=0.0.0.0:$port certstorename=MY certhash=$Certhash appid=$Appnr sslctlidentifier=$CTLlijst sslctlstorename=CA clientcertnegotiation=enable Carlo Quote of the day: Human beings are perhaps never…

  • Archive,  Uncategorized

    Automatic postback does not fire for TextBox control

    I recently come across an interesting request which read like this: A simple webapplication with one Textbox and one label. The Textbox has Autopostback=”true” and has an event listener attached to the TextChanged event. In the TextChanged event the label’s text is set to the text in the textbox. A javascript function “formats” the value of the textbox on the keyUp event.   The ”problem” The postback is not fired for a textbox if a javascript function sets the value of the textbox in the keyDown or keyUp event. This only occurs in IE (IE 8, IE 7, FF 3.6.8, Opera 10.6 and Chrome 5 has been tested). No javascript errors or any kind of error message, the postback is just not being fired. And here’s a sample page to reproduce the problem: <%@ Page Language="vb" AutoEventWireup="false" ValidateRequest="false" EnableEventValidation="false" EnableViewStateMac="false" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <script type="text/javascript" language="javascript"> function FormatTextBox(obj) { //This is just a dummy function that adds $ as the first character. var value = obj.value if (value.length > 0 && value.charAt(0) != '$') value = '$' + value; obj.value = value; // This line causes the autopostback not to fire. This only…

  • Archive,  Uncategorized

    Sometimes they come back

    Stephen King fans like me for sure know Night Shift, a collection of 19 short stories I first read almost (oh, my…) almost 20 years ago. In Italian the title of this collection has been translated as “A volte ritornano” which literally means Sometimes they come back. This is exactly what I thought yesterday when I got yet another version of the “503 Service Unavailable” error: after I have already written about this error here and here, I’m writing the third post about it. I’m wondering if I’ll end up with a 19 post collection as Night Shift has… 😏 Anyway, here’s the new story: the application pools of this web server were failing with the following error (eventid 281) The worker process for application pool ‘MSExchangeOWAAppPool’ encountered an error ‘Unrecognized attribute ‘precondition’ trying to read global module configuration data from file ‘\\?\C:\inetpub\temp\apppools\MSExchangeOWAAppPool.config’, line number ‘281’.  Worker process startup aborted. As you can see the precondition keyword is mistyped (it should be preCondition, capital “C”) and if we changed the .config file mentioned in the error message we were able to start our application pool but randomly (most of the time after a reboot, though) the problem came back. Interesting…

  • Archive,  Uncategorized

    My GridView does not want to paginate anymore!

    Lots of stuff kept me busy over the last few months and this blog has been a bit too quiet… let me try to revamp it a bit (new graphic layout will come later). I recently worked on an interesting case where a simple GridView with pagination enabled was not working as expected: every time we clicked a different page (note, page referred to the GridView pages, not .aspx pages…) we were quickly brought back to the first page: no errors logged anywhere (IIS logs, Fiddler, event viewer… nothing really useful there). Then we decided to make a quick test: we bypassed the ISA proxy and everything started working fine, no way to reproduce the problem again; needless to say, as soon as we reconfigured the proxy in IE the problem came back. My colleague Alvar works also on ISA cases and suggested the article POST requests that do not have a POST body may be sent to a Web server that is published in ISA Server 2006 and this actually did the trick, problem solved! Thanks Alvar ? Carlo Quote of the day: Great people talk about ideas, average people talk about things, and small people talk about wine.…

  • Archive,  Uncategorized

    Make your own keyboard for free

    I’ve been using the new Arc Keyboard for a few weeks now and I’m very pleased with it, I like it especially for typing. But (there is always a “but” ?)… Unfortunately I have to say this keyboard is not very practical when working with Windbg or Visual Studio (at least with the Italian layout) where you have to type special characters such as tilde (~) or braches ( { } ). Well, it is possible to get braches with the key combination ATL GR+SHIFT+è for the open one and ALT GR+SHIFT++ or ALT+123 and ALT+125 on the numpad if available and despite the weird key combination I got used to press it with only one hand and my typing flow was acceptable, even on a laptop where the numpad cannot be used. Anyway I’ve not been able to find how to get the tilde sign on an Italian keyboard without using the numpad combination (ALT+126), this means I cannot use neither my laptop nor the Arc Keyboard for coding… Should I use two different keyboards, then? No way ? Bing came to the rescue and pointed me to the Keyboard Layout Creator that, among other things, allows to modify…

  • Archive,  Uncategorized

    IDEVDataCollector adds IIS6 support

    It took me some time (mostly because of other demanding tasks and commitments I have for my daily job) but finally I have just updated IDEVDataCollector to support IIS 6, it’s available at the tool main page: https://www.cloudnotes.io/idevdatacollector/. Give it a try and let me know what you think ? P.s. Yes, I’m planning to release the source code too, stay tuned! Carlo Quote of the day: Clothes make the man. Naked people have little or no influence on society. – Mark Twain