Wednesday, July 23, 2008

My Qa staff found an odd issue when running our Point product on Vista x64 they would receive a “The decryption operation failed, see inner exception”

error message when Point communicated with Its server via a soap webservice. I didn’t think this was a bug in our code since It works on my vista x64 just fine. The previous version worked with out any issues on this box and there was no code changes in this section of our product.  Since this was a qa box I pulled out my new friend windbg and had a go at digging out the stack trace.  I have to remember for future reference that Point is a 32bit application and that I need to use windbg for 32bit even though the os is x64.

I was able to get the full print of the exception at hand by starting Point with windbg and running to first “first chance exception”.  Here is what !PrintException found.

Exception type: System.IO.IOException
Message: The decryption operation failed, see inner exception.
InnerException: System.ComponentModel.Win32Exception, use !PrintException 03d39900 to see more
StackTrace (generated):
    SP       IP       Function
    0017A7DC 7A5B3CB9 System_ni!System.Net.ConnectStream.Read(Byte[], Int32, Int32)+0x149
    0017A88C 08FE6F9E Microsoft_Web_Services2!Microsoft.Web.Services2.Dime.DimeRecord.ForceRead(System.IO.Stream, Byte[], Int32)+0x26
    0017A8A8 08FE69B0 Microsoft_Web_Services2!Microsoft.Web.Services2.Dime.DimeRecord.ReadHeader()+0x28
    0017A8CC 08FE68D0 Microsoft_Web_Services2!Microsoft.Web.Services2.Dime.DimeRecord..ctor(System.IO.Stream, Int32)+0x78
    0017A8E0 08FE66B5 Microsoft_Web_Services2!Microsoft.Web.Services2.Dime.DimeReader.ReadRecord()+0x3d
    0017A8EC 08FE63A0 Microsoft_Web_Services2!Microsoft.Web.Services2.Messaging.SoapDimeFormatter.Microsoft.Web.Services2.Messaging.ISoapFormatter.Deserialize(System.IO.Stream)+0x40
    0017A904 08F4CFFA Microsoft_Web_Services2!Microsoft.Web.Services2.InputStream.GetRawContent()+0x5a
    0017A91C 08F4CF76 Microsoft_Web_Services2!Microsoft.Web.Services2.InputStream.Read(Byte[], Int32, Int32)+0x16
    0017A930 7949806E mscorlib_ni!System.IO.StreamReader.ReadBuffer(Char[], Int32, Int32, Boolean ByRef)+0x4e
    0017A950 79497FC7 mscorlib_ni!System.IO.StreamReader.Read(Char[], Int32, Int32)+0x7f
    0017A974 637E6FDC System_Xml_ni!System.Xml.XmlTextReaderImpl.ReadData()+0x298
    0017A984 637EFFD1 System_Xml_ni!System.Xml.XmlTextReaderImpl.InitTextReaderInput(System.String, System.IO.TextReader)+0xb9
    0017A998 637EFEFA System_Xml_ni!System.Xml.XmlTextReaderImpl..ctor(System.String, System.IO.TextReader, System.Xml.XmlNameTable)+0x5e
    0017A9B4 637EFE76 System_Xml_ni!System.Xml.XmlTextReader..ctor(System.IO.TextReader)+0x46
    0017A9CC 08F4CC90 System_Web_Services!System.Web.Services.Protocols.SoapHttpClientProtocol.GetReaderForMessage(System.Web.Services.Protocols.SoapClientMessage, Int32)+0x88
    0017A9E4 08F4C495 System_Web_Services!System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(System.Web.Services.Protocols.SoapClientMessage, System.Net.WebResponse, System.IO.Stream, Boolean)+0x1e5
    0017AA68 080BF5EE System_Web_Services!System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(System.String, System.Object[])+0xce
    0017AAAC 08FE6218 AesLib!CalyxPointLib.pdsdev55.pdsfunctions55Wse.GetArchivedTemplateSet(CalyxPointLib.pdsdev55.pdsRequest)+0x30
    0017AABC 08FE59CF Winpoint!<Module>.CPDSClient2.GetTemplateBlob(CPDSClient2*, ATL.CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > >*)+0x237

 

Now lets see what is in the ComponentModel.Win32Exception is:

Exception object: 03d39900
Exception type: System.ComponentModel.Win32Exception
Message: The token supplied to the function is invalid
InnerException: <none>
StackTrace (generated):
<none>
StackTraceString: <none>
HResult: 80004005
The current thread is unmanaged

When searching Google for “The token supplied to the function is invalid” and “The decryption operation failed” I found it only associated with ssl connection issues.  My current working theory is that the ssl connection is closing during the transfer of a large binary object.  Since this seems rather low on the stack I first installed dot net 3.5 to get the latest dot net 2.0 service pack.  This didn’t correct the issue.  I still think this issue is in some low level code for tcp/ip or http. I searched for windows updates.  Turns out this version of vista is not sp1 after installation of the Vista service pack every thing works well.  I wish I could dig up the fix in sp1 so i could better understand the true issue.  In hind sight I neglected to install the service pack because i didn’t want to wait for it to down load.  My lesson for the day is always patch the system then debug.

posted by Aaron Fischer on Wednesday, July 23, 2008 6:02:15 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Wednesday, July 16, 2008

Mortgage Brokers suck, It hast to be official if its a Tee shirt right?

jitcrunch

I guess America needs its scapegoat(wall street).  For a more detailed analysis of the subprime melt down I suggest you take a look at Chain Of Blame

ChainOfBlame

I know its easier to read the Tee shirt then a book but I know you can do it.

posted by Aaron Fischer on Wednesday, July 16, 2008 1:23:31 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Wednesday, July 09, 2008

I receive an error when trying to install

“Security Update for SQL Server 2005 Service Pack 2(KB948109)

A security issue has been identified in the SQL Server 2005 Service Pack 2 that could allow an attacker to compromise your system and gain control over it. You can help protect your computer by installing this update from Microsoft. After you install this item, you may have to restart your computer.

The windows installer error message that shows up in my event log is:

Product: Microsoft SQL Server 2005 - Update 'GDR 3068 for SQL Server Database Services 2005 ENU (KB948109)' could not be installed. Error code 1603.

 

The kb known issues do not seem to align with my error.

Known issues with this security update


If the Microsoft SQL Server 2005 installation or the SQL Server 2005 Express Edition installation is an upgrade from an earlier version of SQL Server, you should review the "Known issues with this security update" section in one of the following articles in the Microsoft Knowledge Base:

948110 (http://support.microsoft.com/kb/948110/) MS08-040: Description of the security update for SQL Server 2000 GDR and MSDE 2000: July 8, 2008

948111 (http://support.microsoft.com/kb/948111/) MS08-040: Description of the security update for SQL Server 2000 QFE and MSDE 2000: July 8, 2008


You may receive an error message when you try to uninstall this update. For more information about this issue, click the following article number to view the article in the Microsoft Knowledge Base:

955250 (http://support.microsoft.com/kb/955250/) Error message when you try to uninstall a SQL Server 2005 Express Edition hotfix package: "1731 The source installation package for the product [2] is out of sync with the client package"

Down loaded the Update and did a manual install: Security Update for SQL Server 2005 Service Pack 2 (KB948109)

I also see an error from the MsiInstaller:

Product: Microsoft SQL Server 2005 -- Error 1920. Service 'SQLWriter' (SQLWriter) failed to start.  Verify that you have sufficient privileges to start system services.

Followed these instructions on all MSSQL.n\setups in the registry:

SQL server uses local group for ACLs. When the server is installed the groups are created and their SIDs are stored in the registry. Somewhere along the way, the SID had to change and the SIDs in the registry were not valid anymore. Try to delete the values for the following values in Setup registry key the instance hive [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup]

The registry values are:

AGTGroup

SQLGroup

FTSGroup

ASGroup

Thanks,
Samuel Lester (MSFT)

Followed these instructions to reinstall sqlwriter:

I had the same problem, and I found an easier way:

Browse your SQL 2005 installation CD, and in the setup folder you should see a file called SQLWriter.msi (It may be in a subfolder of the setup folder - I can't remember the exact location).

Execute the msi file - it will install the missing SQL 2005 VSS Writer service.

After that your SP2 installation should succeed.

Now I have successfully Installed the hotfix.

posted by Aaron Fischer on Wednesday, July 09, 2008 8:25:49 AM (Pacific Standard Time, UTC-08:00)   #    Comments [1]
 Thursday, July 03, 2008

When you set a DataGrid’s datasoure to a LinqDataSource control you still need to handle the paging event in your code behind file.  It’s also worth noting that the DataGrid does not use the Linq skip and take paging functionality.  The DataGrid will simply request all results and page them in memory.

When you over load the OnSelecting event you do not need to specify a datacontext or TableName or other query specific properties.

posted by Aaron Fischer on Thursday, July 03, 2008 4:01:54 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]

When you specify a css class for your GridView’s PagerStlye (PagerStyle.CssClass=”pagerStyleClass”) the rendered table row class font-size.

You will need to select the child table of this tr element  in your css

.pagerStyleClass Table{font-size: 10px;}

posted by Aaron Fischer on Thursday, July 03, 2008 3:54:31 PM (Pacific Standard Time, UTC-08:00)   #    Comments [1]
 Thursday, June 26, 2008

I am starting to suspect VB.net 2008 is not saving all my changes.  This is not a good sign.  Maybe this will be fixed in SP1.  I hope a lot of my VB headaches will go a way with SP1

posted by Aaron Fischer on Thursday, June 26, 2008 8:46:38 AM (Pacific Standard Time, UTC-08:00)   #    Comments [0]
 Tuesday, June 24, 2008

So there is this little petition online ADO .NET Entity Framework Vote of No Confidence.  Which seems to have evoked a response from the Entity Framework team.

But I don’t care to be talked down to by the  so called experts.  “Warning” poor old me not to use technology that does not fit their.  It seems obvious to them that all domain’s and software shops are the same, and I clearly  cannot evaluate a framework.( Maybe this is true, I am on windows after all.  But then what does that say about them?)

There are cases where the Entity Framework will prove most useful.  While POCO can be nice, it’s not always what I am looking for.  Some times I do actually need data storage. And some times persistence ignorance is not a benefit.

I would like to thank Kathleen and Julie for their contrarily posts to the petition.

Kathleen Dollard: Entity Framework Petition 

Julie Lerman: Oh that no-confidence vote on E.F.

posted by Aaron Fischer on Tuesday, June 24, 2008 4:35:42 PM (Pacific Standard Time, UTC-08:00)   #    Comments [2]
 Monday, June 23, 2008

What happens when it rains?

Amazon S3 and data corruption. Thread: S3 data corruption?

 

We've isolated this issue to a single load balancer that was brought into service at 10:55pm PDT on Friday, 6/20.  It was taken out of service at 11am PDT Sunday, 6/22.  While it was in service it handled a small fraction of Amazon S3's total requests in the US.  Intermittently, under load, it was corrupting single bytes in the byte stream.  When the requests reached Amazon S3, if the Content-MD5 header was specified, Amazon S3 returned an error indicating the object did not match the MD5 supplied.  When no MD5 is specified, we are unable to determine if transmission errors occurred, and Amazon S3 must assume that the object has been correctly transmitted. Based on our investigation with both internal and external customers, the small amount of traffic received by this particular load balancer, and the intermittent nature of the above issue on this one load balancer, this appears to have impacted a very small portion of PUTs during this time frame.
One of the things we'll do is improve our logging of requests with MD5s, so that we can look for anomalies in their 400 error rates.  Doing this will allow us to provide more proactive notification on potential transmission issues in the future, for customers who use MD5s and those who do not. In addition to taking the actions noted above, we encourage all of our customers to take advantage of mechanisms designed to protect their applications from incorrect data transmission.  For all PUT requests, Amazon S3 computes its own MD5, stores it with the object, and then returns the computed MD5 as part of the PUT response code in the ETag.  By validating the ETag returned in the response, customers can verify that Amazon S3 received the correct bytes even if the Content MD5 header wasn't specified in the PUT request.  Because network transmission errors can occur at any point between the customer and Amazon S3, we recommend that all customers use the Content-MD5 header and/or validate the ETag returned on a PUT request to ensure that the object was correctly transmitted.  This is a best practice that we'll emphasize more heavily in our documentation to help customers build applications that can handle this situation.
If you have specific questions or concerns about how your application might have been affected, please feel free to e-mail us at aws@amazon.com.

posted by Aaron Fischer on Monday, June 23, 2008 7:21:18 PM (Pacific Standard Time, UTC-08:00)   #    Comments [0]