EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SFTP Intermittent problem setting license key - Class not registered

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#27253
Posted: 11/18/2013 21:33:26
by Brett Beattie (Standard support level)
Joined: 03/08/2011
Posts: 25

Hi,
I am having an occasional problem with my .NET 4.5 WCF service where we get the following error when setting the license key:
'SBUtils.__Global' threw an exception. ---> System.Runtime.InteropServices.COMException: Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at SBUtils.__Global..cctor()
--- End of inner exception stack trace ---
at SBUtils.__Global.SetLicenseKey(String Key)

The WCF web service allows a client to get/put files via a web service call. This can happen hundreds of times per day. Each time this process is called we set the license key and instantiate a new TElSimpleSFTPClient.

The service works fine most of the time - just rarely we get the above error and I need to reset IIS to clear it. Any advice on where I can look to try and find the cause. One thought I had was maybe the SetLicenseKey call occurring to many times within the same process - not sure what happens if the key has already been set?
Any help would be appreciated.
Thanks
#27255
Posted: 11/19/2013 01:53:52
by Eugene Mayevski (EldoS Corp.)

This is the issue of assembly initialization itself. It just seems to happen in SetLicenseKey cause this is probably the first call made to the assembly.

Global.constructor is the code generated by the compiler, so we'll contact the compiler vendor for assistance.


Sincerely yours
Eugene Mayevski
#27483
Posted: 11/28/2013 15:54:08
by Brett Beattie (Standard support level)
Joined: 03/08/2011
Posts: 25

Hi Eugene, any progress on this? It is becoming a headache for me!

I have now received the same issue from a PGP process...

Timestamp: 28/11/2013 9:00:06 PM
Message: System.Runtime.InteropServices.COMException (0x80040154): Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at SBPGP.TElPGPReader..ctor()
#27484
Posted: 11/28/2013 16:17:13
by Ken Ivanov (EldoS Corp.)

Hello Brett,

Unfortunately, no news so far.

There are a number of references in Google to similar problems. One of solutions that helped to address those problems is switching the target platform to x86 or x64 (instead of AnyCPU). Could you please try to switch the target in your project and check if it changes anything?
#27485
Posted: 11/28/2013 16:31:09
by Brett Beattie (Standard support level)
Joined: 03/08/2011
Posts: 25

Thanks Ken,

Unfortunately I can't change that as it is a production system with high importance and high availability.

I have done the google search and most of them (such as the one you mentioned) are related to a problem where the OP gets the error EVERY time they try and run. My problem only occurs after a period of time where the process has been running successfully. If I reset the process (iisreset) then the issue will go away for a while.
#27486
Posted: 11/28/2013 16:49:04
by Ken Ivanov (EldoS Corp.)

Brett,

And did you have a chance to notice any correlation between the moment the issue happens and the state of your service and/or IIS and/or the system? For example, the issue might only occur under a high load of the server, or after some system-wide activity takes place, or on certain time of day, or maybe there's some suspicious record in the event log at the time close to the time of the issue? Any hint on such correlation might help significantly in localizing the problem.

And another question - how do the components behave after the exception is thrown? Say, you caught the exception thrown from the SetLicenseKey() call. Will a subsequent call result in the same exception being thrown?
#27488
Posted: 11/28/2013 20:37:52
by Brett Beattie (Standard support level)
Joined: 03/08/2011
Posts: 25

There is nothing obvious that I can see so far.
No high load or other error messages.

After the error is thrown it appears any calls to the Eldos components will continue to throw the same error until the processes are stopped and started. After which they will be fine for some period of time (could be many days).

We have 2 load balanced servers running the application. These servers are 24/7 and have periods of high and low activity, but nothing that really stretches the processor or memory. The error can occur on either server at different times.

These are Windows Server 2008 R2. The application is .net 4.5, WCF hosted in IIS.
IIS service runs under a domain account (not a built-in account). I read somewhere it might be possible for the service account's profile/registry hive to be unloaded under some circumstances -> which may produce this type of error. I have not been able to get any further with this investigation though.

-> similar issue - same result? Could this be the problem?
http://www.avianwaves.com/Blog/entryid/147/Mystery-of-the-Server-2008-IIS7-OLE-MDAC-Not-Installed-Error.aspx
#27489
Posted: 11/28/2013 23:58:17
by Brett Beattie (Standard support level)
Joined: 03/08/2011
Posts: 25

Following on from that previous post I have a theory:
We have another service on the same server that uses the Eldos SFTP server components. On occassion we get an error in that service that causes it to crash.

"Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.Sockets.SocketException
Stack:
at DETE.EIP.SFTPHost.SSHSession.ReadThread()
at ...
"

I have not been able to catch this error so the service is just set to auto re-start and it starts working again fine - HOWEVER after reading the blog I mentioned in the previous post I checked the event logs and we get event 1530 before the service restarts.

The SFTP service uses he SAME SERVICE ACCOUNT as the WCF service - so I think the SFTP service crash and subsequent registry unload either causes a registry corruption in memory or unloads that part of the registry - resulting in the COM error of the already running processes for that user account.
#27495
Posted: 11/29/2013 01:27:05
by Eugene Mayevski (EldoS Corp.)

If the service in question runs not in the dedicated process, then I can imagine that possible corruption can happen.

So let's pursue this problem first.

Can you somehow capture the complete call stack of the server's exception? Maybe there's a simple try/catch that needs to be added.


Sincerely yours
Eugene Mayevski
#27546
Posted: 12/02/2013 21:20:18
by Brett Beattie (Standard support level)
Joined: 03/08/2011
Posts: 25

Regarding the SFTP service 'crash'.
The stack from the error event in the event log (in one case is):

(application name has been changed to MySFTPHostService)

Application: MySFTPHostService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.Sockets.SocketException
Stack:
at MySFTPHost.SSHSession.ReadThread()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()


Followed by another error event in the event log:

Faulting application name: MySFTPHostService.exe, version: 1.0.0.0, time stamp: 0x5215aa94
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17932, time stamp: 0x503285c2
Exception code: 0xe0434352
Fault offset: 0x000000000000caed
Faulting process id: 0x108c
Faulting application start time: 0x01ceebbe5cc16f8c
Faulting application path: D:\Program Files\MySFTPHostService.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: ff9cd91c-583d-11e3-8163-005056b52b29

I think this happens due to the F5 health monitor but I can't narrow it down to any particular reason (as the health monitor is hitting every 5 seconds all the time). Maybe it is when the health monitor polls while a client is active? The F5 is using TCP Half Open which did cause me an issue when I first came across it as the connection is not completely opened or closed properly.
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 2767 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!