09-10-2021, 01:37 PM
(09-10-2021, 06:28 AM)Alexandre Machado Wrote:(09-07-2021, 05:06 PM)MJS@mjs.us Wrote:(08-05-2021, 05:03 PM)JuergenS Wrote: Hello,
I am having the same problem with Http.sys.
I have the first server without a URL reservation and a few more, a few with a URL reservation.
There are two servers that abort with the same error message. I can restart it manually if I try multiple times.
All servers work according to the same scheme.
Some things are initialized between the start of main () and the call of TIWStartHSys :: Execute (), but the time between is less than 1 sec.
Unfortunately I have not been able to find a solution so far.
I was having this exact problem frequently last year but did not see it again until recently. Below is an error log entry from the first of four instances (1st failed, the following 3 were successful):
9/5/2021 1:14:33 AM TIWServiceWorker.Execute: [HttpSys] A call to "HttpCreateRequestQueue" failed: Cannot create a file when that file already exists
Please check if reserved URL is conflicting with some other URL reserverd for another application on the same machine.
The app is a very simple map tile server, it doesn't have any user interaction. Last year the failed instances would actually start but not respond and had to be restarted with multiple tries. Current failed instances do not start.
C++ Builder 10.4.2, IW 15.2.34,36
This error message "A call to "HttpCreateRequestQueue" failed: Cannot create a file when that file already exists" is pretty clear about the problem: There is a conflicting name reservation on that same machine. It doesn't need to be a IW application. Anything can register a URL, stuff installed under IIS or not.
From the command prompt type:
netsh http show urlacl
And inspect each one of them. Even better:
netsh http show urlacl > UrlReserv.txt
and a file UrlReserv.txt will be created with all the reservations. You can open the file and inspect it later (you may have dozens or even hundreds of url reservations)
Added a call to log 'netsh http show servicestate' output after starting the services from a batch file, the logs show no conflicts (if there were a conflict it should fail every time not just occasionally I would think). The server is all IW / service / httpsys, no IIS so there shouldn't be anything being registered that I'm not doing myself.
In my last test I started 8 instances in a row where 1 - 5 succeeded, 6 - 7 failed, then 8 succeeded.
net start ms1
netsh http show servicestate > ss1.txt
net start ms2
netsh http show servicestate > ss2.txt
net start ms3
netsh http show servicestate > ss3.txt
net start ms4
netsh http show servicestate > ss4.txt
net start ms5
netsh http show servicestate > ss5.txt
net start ms6
netsh http show servicestate > ss6.txt
net start ms7
netsh http show servicestate > ss7.txt
net start ms8
netsh http show servicestate > ss8.txt
In my code I'm initialized the SC like this:
Code:
void __fastcall TIWServerController::IWServerControllerBaseConfig(TObject *Sender)
{
String dir = ExcludeTrailingBackslash(ExtractFileDir(Application->ExeName));
AppName = ChangeFileExt(ExtractFileName(Application->ExeName),"").UpperCase();
HttpSysOptions->VirtualHostNames = AppName.LowerCase()+".abc.com";
HttpSysOptions->AddDefaultBinding = false;
HttpSysOptions->HostWildcard = hwWeak;
}If I put a 6 second delay between starting each next instance I don't seem to get the failures (not an option on boot up though). It seems like some kind of timing issue, maybe the error isn't really a url reservation issue.


