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]
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview