<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>huizhu's blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/huizhu/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/huizhu/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:41:29 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Troubleshoot Service Fabric Cluster Upgrade Issues</title>
      <link>https://docs.microsoft.com/archive/blogs/huizhu/troubleshoot-service-fabric-cluster-upgrade-issues</link>
      <pubDate>Fri, 04 May 2018 17:41:16 GMT</pubDate>
      <dc:creator><![CDATA[HuiZhu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/huizhu/?p=55</guid>
      <description><![CDATA[We refer Service Fabric Cluster Upgrade as the Fabric Upgrade. Fabric Upgrade failures can be caused...]]></description>
      <content:encoded><![CDATA[We refer Service Fabric Cluster Upgrade as the Fabric Upgrade. Fabric Upgrade failures can be caused by multiple reasons, some common issues were listed below:
<ol>
 	<li>Missing seed node or not enough seed node number to match cluster reliability settings.</li>
 	<li>Upgrade stuck for waiting for PreUpgradeSafetyCheck/SafetyCheck</li>
 	<li>Upgrade timeout due to incorrect upgrade settings and health policy settings, such as slow processing of upgrade domain due to a disk IO performance issue or incorrect (too short) timeout settings.</li>
 	<li>There are some customer SF applications in error state during cluster upgrade which fail our MaxPercentUnhealthyApplications evaluation</li>
 	<li>Delta unhealthy (either node or application) evaluation failed. but typically we may not pay much attention in those delta Nodes or Applications CheckHealthEvaluation settings.</li>
 	<li>Cluster manifest upgrade interrupted and rolled back automatically by SFRP resource provider.</li>
 	<li>Cluster upgrade stuck on node due to installation package failure</li>
 	<li>Cluster upgrade stuck due to Fabric Installer crash or hang issues. For example, you disabled the windows upgrade or didn't configure POA (Patch Orchestration Application) correctly, FabricInstallerSvc is missing the required C/C++ runtime packages.</li>
</ol>
In order to get root cause analysis (RCA), you can open a support ticket with Microsoft or self help first by quickly checking Upgrade details from either Get-ServiceFabricClusterUpgrade PowerShell command or from Service Fabric Explorer (SFX).
<ol>
 	<li>Check your Portal/Service Fabric /Overview blade
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-16_37_01-Clipboard.jpg"><img width="1056" height="474" class="alignnone wp-image-95 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-16_37_01-Clipboard.jpg" /></a>
After clicking the above error link,  you will see the error details, for example:
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-16_43_47-Clipboard.jpg"><img width="1170" height="739" class="alignnone wp-image-105 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-16_43_47-Clipboard.jpg" /></a></li>
 	<li>Check Service Fabric Explorer (SFX)
<ul>
 	<li>Open your SFX Url link from portal, click "Cluster" and go to the "DETAILS" Tab, for example, my SFX Url is
<a href="https://hzsfdemo.centralus.cloudapp.azure.com:19080/Explorer/index.html#/tab/details">https://hzsfdemo.centralus.cloudapp.azure.com:19080/Explorer/index.html#/tab/details</a>
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-03-17_10_20-Clipboard.jpg"><img width="1139" height="313" class="alignnone wp-image-85 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-03-17_10_20-Clipboard.jpg" /></a></li>
 	<li>First, you will see the Upgrade Domain walk and UD processing information
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-17_02_31-Clipboard.jpg"><img width="1096" height="677" class="alignnone wp-image-115 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-17_02_31-Clipboard.jpg" /></a></li>
 	<li>Second, you will get the Health and Monitoring Policy and Timeout settings
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-17_04_51-Clipboard.jpg"><img width="1173" height="900" class="alignnone wp-image-125 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-17_04_51-Clipboard.jpg" />
</a></li>
 	<li>Finally, you will be able to see the current upgrade status and what the upgrade is working on.
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-17_07_48-Clipboard.jpg"><img width="1449" height="886" class="alignnone wp-image-135 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-17_07_48-Clipboard.jpg" /></a></li>
 	<li>For my scenario, it is waiting for EnsureSeedNodeQuorum for about 1:20+ hours. Now, you narrowed down the issue to ENUM type <strong>EnsureSeedNodeQuorum</strong>. You can check the explanation for it @
<a href="https://msdn.microsoft.com/en-us/library/azure/mt163586.aspx">https://msdn.microsoft.com/en-us/library/azure/mt163586.aspx</a> and start to understand the possible cause of the problem.</li>
</ul>
</li>
 	<li>Use PowerShell Get-ServiceFabricClusterUpgrate to get the upgrade status and error during and after the upgrade
<ul>
 	<li>Call Connect-ServiceFabricCluster from a RDP session on one of primary nodetype node without any parameter. Since you are in VM already, this will bypass the security check. Or you can pass the X509Certificate or AADCredential to create the PowerShell connection per <a href="https://docs.microsoft.com/en-us/powershell/module/servicefabric/connect-servicefabriccluster?view=azureservicefabricps">Connect-ServiceFabricCluster</a> doc.
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/1.jpg"><img width="1024" height="392" class="alignnone wp-image-65 size-large" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/1-1024x392.jpg" />
</a></li>
 	<li>Call <a href="https://docs.microsoft.com/en-us/powershell/module/servicefabric/get-servicefabricclusterupgrade?view=azureservicefabricps">Get-ServiceFabricClusterUpgrade</a> during the Fabric Upgrade or even after the Fabric Upgrade.
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-02-23_21_38-Clipboard.jpg"><img width="1266" height="964" class="alignnone wp-image-75 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-02-23_21_38-Clipboard.jpg" /></a>
For my situation in above screenshot, the upgrade domain 1 stuck on the PreUpgradeSaftyCheck for EnsureSeedNodeQuorum till upgrade domain timeout.
<span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;line-height: 24px;text-align: left;text-decoration: none;text-indent: 0px">Now, you narrow down the issue to ENUM type  </span><strong>EnsureSeedNodeQuorum</strong><span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;line-height: 24px;text-align: left;text-decoration: none;text-indent: 0px">. You can check the additional explanation for it @</span> <a href="https://msdn.microsoft.com/en-us/library/azure/mt163586.aspx">https://msdn.microsoft.com/en-us/library/azure/mt163586.aspx</a></li>
</ul>
</li>
 	<li>Additional, RDP into the node and check event viewer for "Microsoft-Service Fabric" Admin and Operational Event logs
<ul>
 	<li>RDP and Open eventvwr from a Service Fabric cluster node
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/110.jpg"><img width="416" height="228" class="alignnone wp-image-145 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/110.jpg" /></a></li>
 	<li>Check Application and Services Logs \ Microsoft-Service Fabric Event
check both Admin/Operational events for errors and warnings details
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-17_32_50-Clipboard.jpg"><img width="1269" height="718" class="alignnone wp-image-155 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/2018-05-04-17_32_50-Clipboard.jpg" /></a>
Now the issue is identified as a seed node missing problem.</li>
</ul>
</li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>.Net Framework proxy detecting/loading from a middle tier/service environment</title>
      <link>https://docs.microsoft.com/archive/blogs/huizhu/net-framework-proxy-detectingloading-from-a-middle-tierservice-environment</link>
      <pubDate>Wed, 20 Jun 2012 15:22:00 GMT</pubDate>
      <dc:creator><![CDATA[HuiZhu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/huizhu/2012/06/20/net-framework-proxy-detectingloading-from-a-middle-tierservice-environment/</guid>
      <description><![CDATA[I got pinged by several customers on .Net Framework proxy detection and how the proxy...]]></description>
      <content:encoded><![CDATA[<p>I got pinged by several customers on .Net Framework proxy detection and how the proxy server&nbsp;been loaded or used in&nbsp;a .Net applicaton domain. The typical scenario is: cusotmer saw some inconsistent behavior for using Proxy or not using Proxy in a middle tier/service environement, such as a windows service using WCF calling another backend webservice, or ASP.NET calling another backend WCF service.</p>
<p>Here is my answer: the .Net Framework proxy detecting/loading, is using the following MSDN setting combination:<br />&nbsp;<a href="http://msdn.microsoft.com/en-us/library/sa91de1e.aspx">http://msdn.microsoft.com/en-us/library/sa91de1e.aspx</a><br />&lt;proxy <br />&nbsp; autoDetect="true|false|unspecified"&nbsp; <br />&nbsp; bypassonlocal="true|false|unspecified" <br />proxyaddress="uriString"<br />&nbsp; scriptLocation="uriString" <br />&nbsp; usesystemdefault="true|false|unspecified " <br />/&gt;</p>
<table>
<tbody>
<tr>
<td>
<p><span><span class="input">autoDetect</span> </span></p>
</td>
<td>
<p>Specifies whether the proxy is automatically detected. The default value is <span><span class="input">unspecified</span></span>.</p>
</td>
</tr>
<tr>
<td>
<p><span><span class="input">bypassonlocal</span> </span></p>
</td>
<td>
<p>Specifies whether the proxy is bypassed for local resources. Local resources include the local server (http://localhost, http://loopback, or http://127.0.0.1) and a URI without a period (http://webserver). The default value is <span><span class="input">unspecified</span></span>.</p>
</td>
</tr>
<tr>
<td>
<p><span><span class="input">proxyaddress</span> </span></p>
</td>
<td>
<p>Specifies the proxy URI to use.</p>
</td>
</tr>
<tr>
<td>
<p><span><span class="input">scriptLocation</span> </span></p>
</td>
<td>
<p>Specifies the location of the configuration script.</p>
</td>
</tr>
<tr>
<td>
<p><span><span class="input">usesystemdefault</span> </span></p>
</td>
<td>
<p>Specifies whether to use Internet Explorer proxy settings. If set to <span><span class="input">true</span></span>, subsequent attributes will override Internet Explorer proxy settings. The default value is <span><span class="input">unspecified</span></span>.</p>
</td>
</tr>
</tbody>
</table>
<p>By default, autoDetect is set as unspecified, which equals to enabled. It means the proxy is automatically detected. The proxy auto detection follows this white paper for design.<br /><a href="http://msdn.microsoft.com/en-us/magazine/cc300743.aspx">http://msdn.microsoft.com/en-us/magazine/cc300743.aspx</a><br />&ldquo;Automatic configuration is a two-step process. First, the user agent (Internet Explorer or the .NET Framework) tries to discover the URL of a configuration script. Typically, the configuration script is a JavaScript file that contains logic to determine whether to use a proxy and what proxy to use for a given target resource. The protocol for automatic detection is documented at Web Proxy Auto-Discovery Protocol. The user agent first tries a DHCPINFORM message. The reply to this message contains the URL of the configuration script. If that doesn't work, a DNS lookup for a well-known alias, WPAD, is issued. Then the configuration script's location is determined as <a href="http://%3cmachine%3e/wpad.dat">http://&lt;machine&gt;/wpad.dat</a> where the machine name is the result of the DNS lookup.</p>
<p>The second step is to download the configuration script from the URL and run the script. The specification of what the configuration script looks like is at Navigator Proxy Auto-Config File Format. And then parse and run the proxy auto configuration (PAC) script.&rdquo;<br />This detection implementation is expensive, take time and also require you have either DHCP server or DNS set up correctly. If you are using a middle tier server type of client, for performance consideration, we will need to disable it to save the time spent on proxy detection routine.</p>
<p>The 2nd proxy detection is using IE proxy. It is controlled through setting, usesystemdefault="true|false|unspecified "<br />usesystemdefault:&nbsp; Specifies whether to use Internet Explorer proxy settings. If it is set to true, subsequent attributes will override Internet Explorer proxy settings. The default value is unspecified, which equals to true.<br />But this setting&nbsp;may not work well for a service. A service typically doesn&rsquo;t have any IE profile with proxy setting. Creating a IE profile for a service account is like a hacking. usesystemdefault setting is more designed for a log on user type of application instead of service. IE proxy connection is implemented through wininet.dll, but wininet.dll is not supported in service.</p>
<p><a href="http://support.microsoft.com/kb/238425">http://support.microsoft.com/kb/238425</a><br />INFO: WinInet Not Supported for Use in Services<br />So, we will discourage using the IE proxy setting and creating an IE profile for a service account to load proxy in .Net as it will make the proxy loading behavior hard to be predicted if a service has some user impersonation implemented.</p>
<p>For the middle tier or service type of client app, we can set the proxy use the following choice:<br />&nbsp; bypassonlocal="true|false|unspecified" <br />proxyaddress="uriString"<br />&nbsp; scriptLocation="uriString" <br />We can using proxy address to well specify the proxy information combined with proxy bypass rule. If you have to use the proxy auto configuration (PAC) script rule, you can use the choice in scriptLocation. This way, we can well control the proxy loading behavior to avoid delay on Proxy detection or unpredictable result for using impersonated account to load IE proxy setting.</p>
<p>A configuration sample is listed below:<br />&lt;configuration&gt;<br />&nbsp; &lt;system.net&gt;<br />&nbsp;&nbsp;&nbsp; &lt;defaultProxy&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;proxy<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; autoDetect="false"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; usesystemdefault="false"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxyaddress="<a href="http://myproxy/">http://myproxy:80</a>"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bypassonlocal="true"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bypasslist&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add address="[a-z]+\.contoso\.com$" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add address="127.0.0.1" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/bypasslist&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/defaultProxy&gt;<br />&nbsp; &lt;/system.net&gt;<br />&lt;/configuration&gt;</p>
<p>&nbsp;&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>SSL /TLS full handshake vs. abbreviated handshake</title>
      <link>https://docs.microsoft.com/archive/blogs/huizhu/ssl-tls-full-handshake-vs-abbreviated-handshake</link>
      <pubDate>Thu, 17 Dec 2009 08:52:00 GMT</pubDate>
      <dc:creator><![CDATA[HuiZhu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/huizhu/2009/12/17/ssl-tls-full-handshake-vs-abbreviated-handshake/</guid>
      <description><![CDATA[SSL negotiation starts with client hello and finished with CipherSpec Change. The handShake has 2...]]></description>
      <content:encoded><![CDATA[<P>SSL negotiation starts with client hello and finished with CipherSpec Change. The handShake has 2 mechanisms: Full handshake vs. Abbreviated handshake (RFC 2246)</P>
<P mce_keep="true"><IMG style="WIDTH: 529px; HEIGHT: 314px" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/93/82/91/full.png" original-url="http://blogs.msdn.com/photos/hui/images/9938291/original.aspx" width=529 height=314 mce_src="http://blogs.msdn.com/photos/hui/images/9938291/original.aspx"></P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true"><IMG style="WIDTH: 521px; HEIGHT: 205px" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/93/82/92/abbreviated.png" original-url="http://blogs.msdn.com/photos/hui/images/9938292/original.aspx" width=521 height=205 mce_src="http://blogs.msdn.com/photos/hui/images/9938292/original.aspx"></P>
<P mce_keep="true">&nbsp;</P>
<P mce_keep="true">The difference is abbreviated handshake is using 32 bit existing SSL session ID for Client Hello. If SSL server agreed on this session, server doesn't need to send the public key of certificate&nbsp;back to client. Also, client doesn't need to take time to validate the server cert as it is an existing session. If server doesn't agree on the SSL session, server needs to push a new session ID and then go to full handshake.</P>
<P mce_keep="true">Here is the table for the time SSL session been cached:</P>
<DIV class=kb_nowrapper jQuery1261070701577="30">
<TABLE class=table cellSpacing=1 class="table">
<TBODY>
<TR>
<TD><B>Version</B></TD>
<TD><B>ClientCacheTime </B></TD>
<TD><B>&nbsp;&nbsp; ServerCacheTime</B></TD></TR>
<TR>
<TD>Windows NT 4.0 SP6a</TD>
<TD>2 minutes</TD>
<TD>&nbsp;&nbsp; 2 minutes</TD></TR>
<TR>
<TD>Windows NT 4.0 SP6a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </TD>
<TD>60 minutes</TD>
<TD>&nbsp;&nbsp; 5 minutes</TD></TR>
<TR>
<TD>Windows 2000 SP1</TD>
<TD>2 minutes</TD>
<TD>&nbsp;&nbsp; 2 minutes</TD></TR>
<TR>
<TD>Windows 2000 SP2</TD>
<TD>10 hours</TD>
<TD>&nbsp;&nbsp; 10 hours</TD></TR>
<TR>
<TD>Windows XP or After&nbsp;</TD>
<TD>10 hours</TD>
<TD>&nbsp;&nbsp; 10 hours</TD></TR></TBODY></TABLE></DIV>
<P mce_keep="true">If&nbsp;SSL server side doesn't understand the abbreviated SSL handshake and doesn't handle it correctly, you may see some random issue for SSL connection drop. Framework System.Net trace&nbsp;or Network sniffer trace can help to identify whether the current SSL handshake is trying to go through cached session. The key difference is: no certificate payload in server hello message.</P>
<P mce_keep="true">Windows gives the choice for disable SSL cache session reuse through Reg Key.</P>
<LI>[HKEY_LOCAL_MACHINE] 
<LI>[System] 
<LI>[CurrentControlSet] 
<LI>[Control] 
<LI>[SecurityProviders] 
<LI>[SCHANNEL] 
<LI>ClientCacheTime</LI>
<P>ClientCacheTime is DWORD in millisecond unit. When you set the key as 0 and reboot machine, SSL cached session will not be reused.</P>]]></content:encoded>
    </item>
  </channel>
</rss>