You are not logged in.
Pages: 1
Hello everyone,
Our application has been experiencing some connection issues lately. And we are having a hard time figuring out why...
It doesn't happen on our headquarter's computers at all (Win10 and Win11), it happens on the clients, but not always, they will have trouble connecting (or requests fail mid-session) randomly.
When a request fails we find two different errors (with the same error code):
- winhttp.dll error 12019 (The handle is in the wrong state for the requested operation)
- winhttp.dll error 12019 (00002EF3)
It doesn't help the fact we can't debug this because we are not having the issue on our computers, and we never know on what client's computer it will happen...
We now have a dedicated server on a hosting company running the server application, before that, we used a VPS on another hosting company, and the issues persisted on this brand new dedicated server with new config, new SSL certificate, new domain, and IP.
I did find this topic: https://synopse.info/forum/viewtopic.php?id=5550
In our case the issue is intermittent, I guess it rules out the Proxy configuration.
We don't have the {$R Vista.res} resource on our .dpr project files, can this be it?
We are at a loss here...
Offline
If you don't have Vista.res then Windows 10 won't be detected, but the project will still detect WIndows 7 so in fact TWinHttp.InternalConnect won't use WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY...
This is the only place when a missing Vista.res manifest could be relevant.
I have two questions:
1. Do the clients use a proxy?
2. Which class are you using on the client side for the connection?
Try to use new WinHttpForceProxyDetection global flag as true to force proxy detection (if your systems are WIndows 8.1 or newer):
https://github.com/synopse/mORMot2/commit/53de10b0
and https://github.com/synopse/mORMot2/commit/730ac233
Offline
Thank you ab..
I think some clients use a proxy, but the majority don't...
Some clients report problems when using their home internet provider also (very simple direct PC-Router connection with no proxy)...
We use TSQLHttpClient (TSQLHttpClientWinHTTP) and TSQLRestClientURINamedPipe.
The change between local/cloud uses TSQLRestClientRedirect.
The issues only happen when TSQLRestClientRedirect is Redirect To TSQLHttpClient.
Offline
Ah you are right... not with mORMot 1.
Try to comment those lines:
procedure TWinHTTP.InternalConnect(ConnectionTimeOut,SendTimeout,ReceiveTimeout: DWORD);
var OpenType: integer;
Callback: WINHTTP_STATUS_CALLBACK;
CallbackRes: PtrInt absolute Callback; // for FPC compatibility
protocols: DWORD;
begin
if fProxyName='' then
{if (OSVersionInfo.dwMajorVersion>6) or
((OSVersionInfo.dwMajorVersion=6) and (OSVersionInfo.dwMinorVersion>=3)) then
OpenType := WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY else} // Windows 8.1 and newer
OpenType := WINHTTP_ACCESS_TYPE_NO_PROXY else
OpenType := WINHTTP_ACCESS_TYPE_NAMED_PROXY;
You could still use a proxy, with manual settings.
Offline
I had the same issue (same error) happening randomly while communicating to some API rest server. Never managed to find the cause: server, cliient, routers or CloudFlare. Solution I used was to reastablish connection and repeat the request.
Offline
Pages: 1