You are not logged in.
Pages: 1
I am getting the following exception in the logs
31/10/2024 10:57:40.832 Exception 8 ESqlDBPostgres {Message:"TSqlDBPostgresLib Exec failed: 22021 [ERROR: invalid byte sequence for encoding \"UTF8\": 0xa2\nCONTEXT: unnamed portal parameter $14\n]",Statement:null} [R1:testdv1testdv0] at 8ccdc6 ../../../../../DG/mORMot2/src/db/mormot.db.raw.postgres.pas (437) ../../../../../DG/mORMot2/src/db/mormot.db.sql.postgres.pas (1015)
Offline
Thank you @ab.
Is it possible to check if a string is utf8 or has invalid characters?
Offline
An other error I usually find:
Exception: 20241112 17391118 # EXC ENetSock {LastError:"nrClosed",Message:"THttpClientSocket.SockRecv(283) read=0 [Closed - #5]"} [Main] at b2bf7e mormot.net.sock.pas TCrtSocket.SockRecv (5862) mormot.net.client.pas THttpClientSocket.RequestInternal (2408) fastmm5.pas FastMM_GetMem_GetSmallBlock (7186) System.pas @GetMem (4969) System.pas @NewAnsiString (26157) System.pas @LStrSetLength (30045) mormot.net.client.pas THttpClientSocket.Request (2516) mormot.rest.client.pas TRestClientUri.IsOpen (2155) mormot.rest.client.pas TRestClientUri.IsOpen (2227) mormot.rest.http.client.pas TRestHttpClientSocket.InternalRequest (780) mormot.rest.http.client.pas TRestHttpClientGeneric.InternalUri (580) mormot.rest.http.client.pas TRestHttpClientGeneric.InternalUri (582) rest.wsclient.pas TPCHRclient.setJWTheader (278) rest.wsclient.pas TPCHRclient.setJWTheader (279) rest.wsclient.pas TPCHRclient.setJWTheader (280) mormot.rest.client.pas TRestClientUri.OnBackgroundProcess (1980) mormot.rest.client.pas CallInternalUri (2524) mormot.rest.client.pas TRestClientUri.Uri (2556) System.pas TMonitor.TryEnter (20364) System.pas TMonitor.TryEnter (20364) System.Generics.Collections.pas TListHelper.InternalDeleteRange4 (3873) System.Generics.Collections.pas TListHelper.InternalDeleteRange4 (3879) fastmm5.pas FastMM_GetMem_GetSmallBlock (7186) System.pas @GetMem (4969) System.pas @NewAnsiString (26157) mormot.soa.client.pas DoClientCall (643) mormot.soa.client.pas TServiceFactoryClient.InternalInvoke (688) mormot.soa.client.pas TServiceFactoryClient.Invoke (583) mormot.core.interfaces.pas TInterfacedObjectFake.FakeCallGetJsonFromStack (3448) mormot.core.interfaces.pas TInterfacedObjectFake.FakeCallInternalProcess (3544) mormot.core.interfaces.pas TInterfacedObjectFakeRaw.FakeCall (3307)
Is this expected due to network conditions?
Offline
The following can exist also:
Exception: 20241108 20071551 ! EXC EInterfaceFactory {Message:"TInterfacedObjectFakeClient.FakeCall(ImwbService.GetDBormvers) failed: 'Invalid returned JSON content: expects {result:...}, got "} [Main] at 45df37 mormot.core.text.pas ESynException.RaiseUtf8 (9507) fresultcomp.pas Tresultcomp.FormCreate (150) Vcl.Forms.pas TCustomForm.DoCreate (5516) Vcl.Forms.pas TCustomForm.AfterConstruction (5384) System.pas @AfterConstruction (19735) Vcl.Forms.pas TCustomForm.Create (5373) feditdoc.pas Teditdocument.b_protoClick (713) Vcl.Controls.pas TControl.Click (8037) AdvGlowButton.pas TAdvCustomGlowButton.Click (3798) Vcl.Controls.pas TControl.WMLButtonUp (8177) AdvGlowButton.pas TAdvCustomGlowButton.WMLButtonUp (4342) Vcl.Controls.pas TControl.WndProc (7921) Vcl.Controls.pas TWinControl.IsControlMouseMsg (10886) Vcl.Controls.pas TWinControl.WndProc (11156) Vcl.Controls.pas TWinControl.MainWndProc (10823) System.Classes.pas StdWndProc (19092) Vcl.AppEvnts.pas TMultiCaster.GetAppEvents (687) Vcl.Forms.pas TApplication.ProcessMessage (13376) Vcl.Forms.pas TApplication.HandleMessage (13406) Vcl.Forms.pas TApplication.Run (13545)
GetDBormvers is declared as:
function GetDBormvers:rawjson;
Offline
I am using last version from GitHub,
Offline
In a legacy application I have a mormot2 httpd server in a random port and the application user interface does calls to this server.
Sometimes after multiple requests to this server it happens the following:
When the interface function called in the server the response (before function ends) seems ok:
The client from the above request has the following after the call is finished:
I noticed that the json is somehow different.
After a while (after other calls to the server), everything seems ok.
@ab Any idea, how to check further this problem?
Offline
Run your project in the MM in full debug mode, to try to identify the cause of the memory corruption.
Our tests can't reproduce such behavior.
It does not look like memory corruption, but unexpected compression.
Offline
FastMM5 runs in full debug mode without reporting memory corruption or memory leaks
Usually this problem can happen when I am expecting to receive calls from server in the websockets and at the same time I am using the same http websocket client to do calls to the server.
Should I keep a websocket http client just to receive and do all client's calls to the server through an other usual http client?
Concerning compression, clients and server are enabled for compression
Offline
Just a question about that:
websocket's client can be used from other threads inside Synchronize/Queue ?
Offline
Pages: 1