InitInstance Error

Started by JTaylor, September 21, 2015, 03:19:12 PM

Previous topic - Next topic

JTaylor

I've started getting the following in a project I'm working on.  Nothing shows in the ErrorLog...I assume because it never gets to a point it can write an error.   Can't find anything in the Help File or TechDatabase.  What causes such an error?

Jim

Code (html5) Select

<H1>WebBatch Error</H1>
<Pre>
Batch DLL initialization error

Err num 37
</Pre>
<HR>
Content-type: text/html

<H1>WebBatch Error</H1>
<Pre>
WebBatch Error

InitInstance failed
</Pre>
<HR>


JTaylor

I also get this instead sometimes.

Code (html5) Select


<H1>WebBatch Error</H1>
<Pre>
WebBatch Error

InitApplication failed
</Pre>
<HR>


JTaylor

A bit more info.  I am making about 30 requests very close to each other.  Wouldn't think that would overpower WebBatch though.

Jim

td

As the error log implies, the WIL interpreter DLL or WebBatch main process is failing during early initialization.  The error number tells us were it is failing ( in a Win32 API call) but not why.  If WebBatch sometimes works on your system, the best guess on the cause is a  race condition in the OS's Win32 API.    If WebBatch always fails with this error even in low demand situations then your system is sick. 

Assuming that the cause is a race condition, you may want to examine your Web server's configuration settings for something that would address CGI instance startup or some other CGI related setting that might address the problem.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

I have been running WebBatch for years on this server with no problem.  Nothing has changed recently except I upgraded WebBatch, apart from, perhaps, Windows Updates.

Jim

JTaylor

Any suggestions for where to look?  I'm running Windows Web Server 2008 with IIS 7.0.    I've looked through every setting option that looks related in IIS and that has not helped.   Nothing I'm finding in web searches seems to apply but maybe my search terms are incorrect.   Found some things related to fast-cgi but I don't think  webbatch uses fast-cgi, does it?   Pretty much everything I find related to race conditions is tied to PHP.

Jim

td

There have been no remotely recent changes in WebBatch or the DLL that could cause this problem.   And both our Tech Database and Commerce server run WebBatch with FastCGI. 

Windows updates sound suspicious but that is only speculation.  MSFT seems to screw up something for somebody with almost every round of updates.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Didn't really figure the WebBatch update caused the problem but that was the only recent change and I try to provide full-disclosure.   Wondering if the multiple database connection calls are the issue???   I'm looking at MYSQL 5.7 which has a built-in webservice so I can avoid the 30 connection calls.  That may fix the problem?   

I don't see fast-cgi mentioned in the WebBatch help...is that just the standard setup I would have done or do I need to change something in IIS?  Would that be a recommended change?

Jim

td

Quote from: JTaylor on September 22, 2015, 12:17:51 PM
Didn't really figure the WebBatch update caused the problem but that was the only recent change and I try to provide full-disclosure.   Wondering if the multiple database connection calls are the issue???

Hard to say.   On the surface the the problem as presented would seem to be some kind of Windows kernel bug or kernel resource limitation but that is based on a fairly limited understanding of all the factors involved.  And this is not an attempt to pass the blame.  It simply what the available evidence points to at this time.  The actual cause may be something completely different.

Quote
I'm looking at MYSQL 5.7 which has a built-in webservice so I can avoid the 30 connection calls.  That may fix the problem?   

It very well may, if it reduces the number of consecutive calls to start a new WebBatch process and the problem is kernel resource related.

Quote
I don't see fast-cgi mentioned in the WebBatch help...is that just the standard setup I would have done or do I need to change something in IIS?  Would that be a recommended change?

Yes, you need to create a handler mapping for *.web files with FastCgiModule as the module and webbatch.exe as the exe for your site. MSFT recommends using FastCGI.  You can find step by step tutorials for setting up FastCGI  on numerous sites, include MSFT's.  WebBatch does not require anything special with regard to  FastCGI setup.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade