Jump to content
uniGUI Discussion Forums

Application crash/timeout with "worker process 'xxxx' failed to stop a listener channel for protocol 'http'"

Recommended Posts

Hi Guys,


Hoping someone can give me a little bit of help with a application crash/timeout using IIS. The below works fine using stand-alone deployment - this is only an issue in my production IIS environment. ekkkk (please help)


This is reproducible every time I do the same operation - which is using a component to export a dataset to excel (the component is EMS Advanced data export)


All I do is call execute on this component to take what I have in the dataset (5 records) and output it to excel. 

I have one modal form - with the export component and a grid - all code is local to the form, apart from the dataset which is located on a datamodule.


This application has EnableSynchronousOperations := true;

I am using SSL https


1.All records are outputted correctly to the excel file (xlsx) and the file exist where I expect on the file system. It opens perfectly well.

2.As soon as the .execute method is called, I immediately call  UniSession.SendFile(_FilePath, ExtractFileName(_FilePath)); This also excutes and allows me to "download" the xlsx and the contents is fine.

3.It is at his point the application becomes unresponsive, I call modalresult := mrok on the form and nothing happens.


This is the error I am getting from windows event viewer - 


A worker process '3856' serving application pool 'AppPool' failed to stop a listener channel for protocol 'http' in the allotted time.  The data field contains the error number.
Event ID = 5138 (strange as I am using https, not http)
I can also see this event 
A process serving application pool 'AppPool' exceeded time limits during shut down. The process id was '3856'.
Event ID = 5013
UniGUI log shows nothing
It seems to just crash/timeout the session/instance of the application, not the server - once i hit refresh I can log back into the application. (obviously the issue will occur again if I try to export) 
Here are my IIS settings (should be exactly the same as per instructions from the deployment guide)
Delphi 10.1 Berlin
Unigui Complete
Thanks for any help, Dan.

Share this post

Link to post
Share on other sites

Swapped out the export component, and replaced with TMS FlexCell, ran a quick test and no crash/timeout on exporting from a dataset. This obviously means the EMS export component is doing something that the ISAPI module doesn't like.

I haven't got the time to debug and need a working solution fast so this is the best option for me currently.


If any does have any ideas please still post as I would eventually like to know why this was caused.


Thanks, Dan.

Share this post

Link to post
Share on other sites

Mostly this has to do with a component who use OLE Objects internaly.


In ServerModule try AutoCoInitialize := true;


Alternatively you can do this:

  //Do your stuff here..


You have to add WinAPI.ActiveX to your "uses" section.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now