I have something very strange on Windows 8.1 with TidHTTPServer (Tokyo 10.2.3)

I have something very strange on Windows 8.1 with TidHTTPServer (Tokyo 10.2.3)

sometime the server wan't start with error 10048 (WSAEADDRINUSE) but with netstat or Sysinternals TCPView I can't see any binding on port 80 ?!

the only solution I've found is to restart my computer :(

I guess it has something to do with program reset (F2) but I'm not sure.

Comments

  1. I haven't seen this problem on
    Windows 10 Enterprise 1709 10.0.16299.371

    ReplyDelete
  2. I just had this problem on Windows Server 2012R2 with a WebBroker application.

    I've used my TLetsEncrypt component in production, after the Certificate was downloaded I've stopped the server and restart it...but it fail with this error until I reboot the server.

    ReplyDelete
  3. Paul TOTH Did this start happening after you introduced the encryption / certificate?

    ReplyDelete
  4. Lars Fosdal the previous version used a self signed one.

    I stop the server, change SSLOptions and restart the server, that's all.

    but I had the same problem on my W8.1 with a single tidHTTPServer component without SSL in an empty project.

    ReplyDelete
  5. Do you stop/start the HTTP server component only, or the entire .exe / service?

    All our Delphi services have Indy web interfaces, and I've never met this problem. The usual issue, if any, is a port conflict.

    ReplyDelete
  6. I had that problem on Windows 2008 and 2012.
    With the replaced SP it's vanished.

    ReplyDelete
  7. Lars Fosdal only the http component, but even when I restart the application the server port stills unavailable.

    Ronald Klitsche I'll try the SP but at a lowest activity on the server :)

    ReplyDelete
  8. Most of our servers are 2012R2, but we have a handful of 2008R2, as well as a growing bunch of 2016.

    ReplyDelete
  9. Same problem here. We run TidHttpServer as service (Tokyo 10.2.3).
    One other service (watchdog) is checking health of this service by sending http requests from time to time. If the webserver-service not does respond then it get stopped and then restartet.
    One some windows server (2008,2012,2016) we are not able to stop and restart the service at the same port. Something avoid the use of the port. On other windows servers it works without problem. We tried serveral things to find out what is going on. No success until now.

    ReplyDelete
  10. Problem here only with port 80 and TidHttpServer / Windows10 /Delphi 10 Berlin. We must use another Port. For netstat the port is free!

    ReplyDelete
  11. Jean-Marc Kiener If you stop the service. Is it fanished from the process list? In my cases not. I wasn't able to kill them with the task manager. reboot was the only option.
    The new MS Service Packs fix that on my servers.

    Andreas Schachtner In my case Port 443 also affected while using SSL.

    ReplyDelete
  12. Ronald Klitsche Port 443 works just fine.

    ReplyDelete
  13. Ronald Klitsche in my case the process is done and the port is free, I don't use 443 but 444 (W2012) and I have the problem on W8.1 on port 80, did try another port.

    ReplyDelete
  14. Ronald Klitsche The service is stopped and removed from the process list here. But restarting fails because something says that the port is still in use. So TidHTTPServer fails to start.
    Normaly our watchdog just write a ini entry for the webserver service. if the webserver service found this entry it trys to close the TidHTTPServer safetly and then close the app. if this not works then after some time the watchdog try to stop the service over winapi calls.
    Mostly such things occurs in relationship with some antivirus programs or software firewalls installed on the server. But i was not able to found the reason.

    ReplyDelete
  15. Jean-Marc Kiener I don't use any antivirus, MS Firewall is ON but Defender is OFF.

    ReplyDelete
  16. Watchdog madexcept says:
    thread $7a8 (TPrintMonitorServiceMonitorThread):
    007a3583 +4f printmonitorwatchdog.exe main 643 +8 TPrintMonitorServiceMonitorThread.Execute
    004aa153 +2b printmonitorwatchdog.exe madExcept HookedTThreadExecute
    00536eb9 +49 printmonitorwatchdog.exe System.Classes ThreadProc
    0040a864 +28 printmonitorwatchdog.exe System 2086 +0 ThreadWrapper
    004aa039 +0d printmonitorwatchdog.exe madExcept CallThreadProcSafe
    004aa09e +32 printmonitorwatchdog.exe madExcept ThreadExceptFrame
    75b2343b +10 kernel32.dll BaseThreadInitThunk
    >> created by main thread ($9b8) at:
    00536f44 +18 printmonitorwatchdog.exe System.Classes TThread.Create

    main thread ($9b8):
    771d0186 +0e ntdll.dll NtWaitForMultipleObjects
    76521714 +fa KERNELBASE.dll WaitForMultipleObjectsEx
    75b219f7 +89 kernel32.dll WaitForMultipleObjectsEx
    74dc087c +00 user32.DLL MsgWaitForMultipleObjectsEx
    74dc0b7c +1a user32.DLL MsgWaitForMultipleObjects
    00537d53 +6f printmonitorwatchdog.exe System.Classes TThread.WaitFor
    005370ba +46 printmonitorwatchdog.exe System.Classes TThread.Destroy
    00408a90 +08 printmonitorwatchdog.exe System 2086 +0 TObject.Free
    007a3756 +06 printmonitorwatchdog.exe main 660 +0 TPlotJetPrintMonitorWatchdogService.ServiceDestroy
    0053a48b +2b printmonitorwatchdog.exe System.Classes TDataModule.DoDestroy
    0053a35f +27 printmonitorwatchdog.exe System.Classes TDataModule.BeforeDestruction
    004091c1 +09 printmonitorwatchdog.exe System 2086 +0 @BeforeDestruction
    00660776 +02 printmonitorwatchdog.exe Vcl.SvcMgr TService.Destroy
    00408a90 +08 printmonitorwatchdog.exe System 2086 +0 TObject.Free
    00538510 +74 printmonitorwatchdog.exe System.Classes TComponent.DestroyComponents
    00661022 +4e printmonitorwatchdog.exe Vcl.SvcMgr DoneServiceApplication
    004506d9 +21 printmonitorwatchdog.exe System.SysUtils DoExitProc
    0040a715 +6d printmonitorwatchdog.exe System 2086 +0 @Halt0
    007b4aa7 +5f printmonitorwatchdog.exe printmonitorwatchdog 35 +19 initialization
    75b2343b +10 kernel32.dll BaseThreadInitThunk

    thread $fc8:
    771d0186 +0e ntdll.dll NtWaitForMultipleObjects
    75b2343b +10 kernel32.dll BaseThreadInitThunk

    thread $84c:
    771d1f6f +0b ntdll.dll NtWaitForWorkViaWorkerFactory
    75b2343b +10 kernel32.dll BaseThreadInitThunk

    thread $8e0:
    771d1f6f +0b ntdll.dll NtWaitForWorkViaWorkerFactory
    75b2343b +10 kernel32.dll BaseThreadInitThunk
    disassembling:
    [...]
    007a356d call -$2a70a ($778e68) ; WinServiceU.ServiceStop
    007a3572 643 mov ecx, $7a35fc
    007a3577 mov dl, 1
    007a3579 mov eax, [$449a48]
    007a357e call -$34c2a7 ($4572dc) ; System.SysUtils.Exception.Create
    007a3583 > call -$399554 ($40a034) ; System.@RaiseExcept
    007a3588 646 mov eax, $3e8
    007a358d call -$26b986 ($537c0c) ; System.Classes.TThread.Sleep
    007a3592 638 cmp byte ptr [ebx+$e], 0
    007a3596 jz loc_7a354a
    007a3598 648 pop edx
    [...]

    ReplyDelete
  17. No more problem on W8.1 since last update
    support.microsoft.com - support.microsoft.com/fr-fr/help/4343898/windows-81-update-kb4343898

    there's a note about "Addresses an issue that may cause the restart of the SQL Server service to fail occasionally with the error, “Tcp port is already in use”. in KB4338831

    ReplyDelete

Post a Comment