You are not logged in.
Ok back again, i testet now Win64 Server with OPENSSL and libcrypt 3.1
There i get this Error:
20251212 09523554 " EXC EOpenSslNetTls {LastError:1,OpenSsl:"30100030",Message:"TOpenSslNetTls.AfterAccept accept: OpenSSL 30100030 error 1 [SSL_ERROR_SSL (error:0A000126:SSL routines::unexpected eof while reading)]"} [R0:IMSYS ThumbnailCache BinaryD] at 0112fd97 mormot.lib.openssl11.pas EOpenSsl.CheckFailed (2879) {8 3.51 3.70 1 20GB/63.9GB 23f00f01}
I testet both client (Win64) with OpenSSL and without OpenSSl, Error is only on Server, and Client works as expected.
SRY i have to test again, i have to define FORCE_OPENSSL in my dproj
Just to say, the Server is running and full responsive, im only wondering if this error is an error or something like a warning ?!
Ok with 64 Bit Windows the Error is a little bit other displayed, but from the content the same
20251212 09343114 % EXC ESChannel {Message:"recv: Handshake aborted"} [R3:IMSYS ThumbnailCache BinaryD] at 01091990 mormot.net.sock.windows.inc TSChannelNetTls.FreeAndCheckSocket (2057) {8 3.47 3.68 1 19.4GB/63.9GB 23f00f01}Do you compile as a Win64 executable?
It may be due to PRISM itself, especially to the fact that this emulator does not like multiple threads, so it becomes unstable on WinArm.
With PRISM, we had to reduce the number of threads to let mormot2tests pass.
It is as known and documented.
No it was a 32Bit Debug executable. I try with 64 Bit
I testet it with OpenSSL (USE_OPENSSL defined) same error, is there anything more i have to do to activate openssl ?
It happens on the Server, Windows 11 ARM
Hello Arnaud, we are also using m2 with self-signed certificates in our test environment.
In mormot.net.sock.windows.inc there is a place where you raise: ESChannel {Message: "recv: Handshake aborted"}
when res = 0
in FreeAndCheckSocket.
Is it necessary for this very frequent exception to appear as an error in the log?
It’s a bit confusing. Or is it actually an error and we need to do something differently here?
Also like to ask if there is an option to shorten the Exception:
20251211 19560724 # EXC ESChannel {Message:"recv: Handshake aborted"} [R1:IMSYS ThumbnailCache BinaryD] at 0116540e LiteStaticUni.pas sqlite3win64_xe5.sqlite3BtreeOpen (1439) System.Classes.pas .{System.Generics.Collections}TList<System.Classes.TPersistentClass> (3555) System.Classes.pas .{System.Generics.Collections}TList<System.Classes.TPersistentClass> (3555) System.pas ReductionPi2n (10160) LiteStaticUni.pas sqlite3win64_xe5.sqlite3BtreeOpen (1439) LiteStaticUni.pas sqlite3win64_xe5.sqlite3PagerClose (1439) LiteStaticUni.pas sqlite3win64_xe5.sqlite3PagerSetPagesize (1439) LiteStaticUni.pas sqlite3win64_xe5.sqlite3Select (1439) LiteStaticUni.pas sqlite3win64_xe5.sqlite3CreateIndex (1439) LiteStaticUni.pas sqlite3win64_xe5.sqlite3CreateIndex (1439) LiteStaticUni.pas sqlite3win64_xe5.sqlite3CreateForeignKey (1439) .{System.Generics.Collections}TList<DFDatenbankenStruktur.TDFESIndex> System.Generics.Collections.pas TArray.BinarySearch<System.Pointer> (1389) System.pas Ln (11082) {8 3.36 2.74 18.5GB/63.9GB 23f00f01}without the call Stack ?
great i'll test it ![]()
Hi Arnaud, today i looked at SQLite.org and saw that there is 3.50.4
Normally mormot was in sync with latest SQLite Releases.
Is there a reason, why mormot stays at 3.46.1 ?
(its just a question)
Hi Arnaud, i have a question / Feature for Logging.
Is it possible to Disable Logging for 1 Thread after calling function like DisableLog
Reason: I have recurring Function called by a Timer which do nothing if Query gives no result, but flod the log with "useless" stuff if they find something by Query i will Enable Log.
here a sample
function DoOnTimer;
begin
TSynLog.DisableLog;
if ....Orm.RetrieveListObjArray(list, TOrmQueue, 'Status=?', [ord(TOrmStatus.New)], '*') then begin
TSynLog.EnableLog; // Enables Log
// Do something with logging enabled
TSynLog.Enter('Data Found');
end;
// Calls EnableLog on exit (Like Enter/Leave) if Log enabled does nothing :)
end;Thank you it works
there are only 2 Places where i got the Error
mormot.core.variants.pas - 9400
and the above unit
Hi Arnaud,
compiling with new 32Bit Compiler for Release Mode, we get the following Error:
[dcc32 Fataler Fehler] mormot.core.interfaces.pas(8256): F2084 Interner Fehler: C2802
The Reason is:
TDocVariant.NewFast(result);With this WorkAround it works:
var LResult : variant;
TDocVariant.NewFast(LResult);
result := LResult;In my case i have 6 Server registered in HttpServer and using BoilerplateServer derived from resthttpserver
May be the error was in default options of boilerplate redirecting to index.html...
i changed this 2 things.
Thank you I found the solution: I had to to set AServer.RootRedirectGet which wasn’t required before.
Hi Arnaud,
did you change something with this feature ? atm our base url is not redirected
We use RootRedirectToURI as before ?
best regards
One Question where can i set this Option globally ?
Looks good, TYVM
one thing: in mormot.ui.pdf the unit mormot.crypt.other, is missing !
Hi Arnaud, since 3Month or so JSON Output write null for TDateTime if Date is 0
Before it wrotes a empty String "" in JSON Output.
Is it possible to enable old Feature OnDemand ?
Because we have old SynCrossplatform Clients throwing exception implicit converting Variant Null to String
For new Clients i added this to SynCrossplatformJSON:
function Iso8601ToDateTime(const Value: Variant): TDateTime; overload;
function Iso8601ToDateTime(const Value: string): TDateTime; overload;there is a solution for iis we use, Install URL Rewrite 2.0 or higher and ARR (Application Request Routing Cache) Work perfekt !
atm i us a SOA call which gives blob for guid to solve problem
Yes i can:
Object looks like this:
TBild = class(TDFDomBase)
private
fBildID : TBildBildID;
fGUID : TBildGUID;
fBinaerdaten : RawBlob;
public
procedure SetBinaerdaten(const ABinaerdaten : RawBlob);
published
property BildID: TBildBildID read fBildID;
property GUID: TBildGUID read fGUID;
property Binaerdaten : RawBlob read fBinaerdaten;
property Datenformat : RawUtf8 read fDatenformat;
end;SOA Function like this:
function FillBildStreamFromBDS(var ABild : TBild) : TresultRec;
begin
var LBinaerdaten : RawBlob;
Result := GetBildBinaerdaten(ABild.GUID, LBinaerdaten);
if Result.Erfolgreich then
ABild.SetBinaerdaten(LBinaerdaten);
end;In Log Binaerdaten is null but was filled with 4MB PNG before
Hi Arnaud, i like to get an Object containing a RawBlob Field by SOA Call.
Blob is filled on Server side, but not sent to client, in JSON Blob:null is postet.
Is there an Option to send the Blob Data here ?
Thanks, the session cookies are working again now.
Hi Arnaud,
after your mvc rework, the Cookies do not work anymore.
In Former Version you set OutCookie and InCookie to the Cookie.
In the New Version only outcookie is set, but InCookieSearch does not find it.
We derived out Application from new TMVCApplicationRest
may be you can solve it.
Hi Arnaud, im using a managed Record as Result of a SOA function.
result = packed record
public
class operator Initialize(out Dest : result);
end;
// SOA Function:
function Test : result;if Test is called directly result.Initialize is called
if it is called remote (by mormot.core.interface.CallMethod) result.Initialize is not called and record uninitialized
is it possible to call it ?
Hi Arnaud,
added uses mormot.core.os to mormot.core.base to prevent compiler Error
Hi Arnaud, via ChatGPT i found this and it seems to help:
In Registry:
HKEY_CURRENT_USER\Software\Embarcadero\BDS\22.0\DebuggingAdd EnableWaitChainDetection as DWORD with value 0
it disables the Thread Wait Chain Feature from Delphi.
Sry today long wait times, did not fix the problem - I investigate further
Hi Arnaud, via ChatGPT i found this and it seems to help:
In Registry:
HKEY_CURRENT_USER\Software\Embarcadero\BDS\22.0\Debugging
Add EnableWaitChainDetection as DWORD with value 0
it disables the Thread Wait Chain Feature from Delphi.
Without it runs as the 32Bit Version
Yes there must something the Debugger does what the exe dont like, but i dont know what
After a long time i had to debug my m2 service with 64Bit again today.
and there is a delay of 55s at the moment. Starting Service in RS 12.3 64Bit Debugger
https://imgtr.ee/image/image.SE1M
Using the 32Bit exe with RS 12.3 Debugger it only takes 1s at the same function
Int the Picture there is a gap in the log at 12:14:12.528 -> 12.15.02.944 of 50s I don't know what the programm does at this point ???
Ty arnaud, i'll try it
i made this serious observation running a lengthy prozess:
https://imgtr.ee/image/image.SDgW
at 23:00 many small log files are created
TSynLog.Family.RotateFileDailyAtHour := ServiceManager.EinstellungenManager.ReadInteger(cRotateFileDailyAtHour, 23);
may be it depends ot the rotatefiledailyathour, but i think that the log shoult not create that many files, because older logs are overwritten (lost) then.
Hi i found the Error
My Enum is like this:
TEinheitEnum = (
first,
second,
third,
fourth
);
in class constructor i set member fEinheit to "third" (Because i like it initialized with third value) The Enum is kind of sorted ![]()
Now in client its set to "first"
if its set to first, the value is missing in JSON - Data send to server (as you said its optimized)
Because of this the expected Value is not sent to server.
As Solution i put my desired default value in top of enum
enum is now : (third, first, second, fourth)
It does not look good, but it works now.
Hm what previous Value do you mean. I only change 1 Value in Object then put whole Objekt to soa call ?
All members are transfered except the enum one.
On Server Site a wrong value is in that enum field.
Hi Arnaud,
i have the same problem in
TRestServerUriContext.InternalExecuteSoaByInterface
Here you call DoLog and DoLog cuts the the received string, is it possible to add something like LogResponseMaxBytes here ?
Else i have to look at client Log what's send and this is not possible in many times.
it is not a generell problem, sending other Object containing enum value works as expected...
Hi Arnaud, im sending objects with soa call to server.
This Object contains a enum
published
property Einheit : TEinheitEnum read fEinheit
the Value Einheit is not contained in the JSON send to m2 Server, Einheit on Server is uninitialized
i checked ctxt on client an not Entry for Einheit.
What can i do ?
itSDS wrote:i think no one will make a server on mobile platform.
Our "peer cache" feature relies on local UDP/TCP servers, and could benefit on client side too, but I don't know how it is possible on the mobile, especially about firewall port opening.
I would think about a "pure client" peercache feature, without any UDP/TCP server.
I used http server on mobile a time ago and did not have to open any port but may this changed meanwhile
I too asked this question long time ago
and actually using SynCrossPlatform Client with some Patches. It works generally great.
The Problem is that you have to generate special Client.pas Unit from Server. And it would be great if this step can be removed.
for the iOS/Android it is not neccessary to port the whole m2. only the client stuff and rtti because i think no one will make a server on mobile platform.
Ty Arnaud it solves my problem
Hi Arnaud, ty for your patch.
Today we wanted to see the Result of a SOA Call in Log. In former Versions there was the complete JSON Array.
In the new m2 there is only 1 line saying Response with 1.7MB
Is it possible to add the complete JSON to Log again. We need it to debug problems. Log Size and Performance does not matter in our case ! More important is to log the Information.
A switch to enable / Disable Big Data would be ok too.
As Workaround i changed:
procedure TRest.InternalLogResponse(const aContent: RawByteString;
const aContext: shortstring; Level: TSynLogLevel);
begin // caller checked that self<>nil and sllServiceReturn in fLogLevel
// fLogFamily.Add.LogEscape(Level, '%', [aContext], pointer(aContent), length(aContent), self);
fLogFamily.Add.Log(Level, aContent, self, MAX_SIZE_RESPONSE_LOG);
end;Hi Arnaud,
today i saw that some SOA Parameters i formerly could read are shortened now.
There was a const MAX_SIZE_RESPONSE_LOG which i changed to a larger Value
now this const is not used any more and at the places it was formerly used InternalLogResponse is called!
InterlogResponse uses LogEscape which uses a ShortString now an cuts all after 200 Char.
This is not very useful.
TY Daniel, this makes sense if you like to add something else to the Log.
My Question was concerning the Use of the Cast to PUtf8Char
Hi Arnaud i have a may be stupid question how to handle your Change in TSynLog.DoLog/Enter in our Programs
you changed one Parameter from RawUtf8 to PUtf8Char
what is the best way to fix the Compiler Errors:
Sample 1:
old:
var XYZ: String := 'test'; // Sometimes we got String Var
TSynLog.Enter(StringToUtf8(XYZ), ...);
new:
TSynLog.Enter(PUtf8Char(StringToUtf8(XYZ)), ...); // is this the best way ?
Im not sure what this cast really does ![]()
TY looks good !
Hi As BUGFix i commented the Lines 1539-1541 in mormot.rest.mvc
result := fContext.Validate(
cookie, PRecordData, PRecordTypeInfo, PExpires, nil, Invalidate);
// if result <= 0 then
// // delete any invalid/expired cookie on server side
// Finalize;
end;Please try with tonight's code.
It should keep track of the finalized sessions, and reject them.
I also switched the cookie signature and encryption to AES-GCM-128 which is both very fast and cryptographically secure.
As far as I can tell, there is no advantage of using a JWT in respect to our TBinaryCookieGenerator now.
Hi Arnaud, sorry i testet wrong. The Problem was not solved correctly.
I didn't provide function for fApplication.OnSessionFinalized so invalidate was not called.
But if i provide function there is an Stack Overflow generated because finalize is called recursive.
I think both Variants are to complicated. I genereate ContentSecurityPolicy in GetViewInfo which generates 2 Nonce Values for script and style
This both values i give to mustache {{main.cspnonce}}
if i use callback it is called after mvc, how could i add my nonces to main.xy ?
if i use ttomas version i have to add my code to every function, i have a lot
To make it easy, i made a little patch to TRestUriParams and added a new value: ContentSecurityPolicy
LowLevelUserAgent: RawUtf8;
/// itSDS: für ContentSecurityPolicy !
ContentSecurityPolicy: RawUtf8; // itSDS
/// initialize the non RawUtf8 values
procedure Init; overload;Then i added a little bit of code to mormot.rest.http.server.pas
call.LowLevelUserAgent := Ctxt.UserAgent;
call.ContentSecurityPolicy := ''; // itSDS
if fHosts.Count > 0 then Ctxt.OutCustomHeaders := call.OutHead;
if call.ContentSecurityPolicy <> '' then // itSDS
Ctxt.AddOutHeader(['Content-Security-Policy: ', call.ContentSecurityPolicy]);
if call.OutInternalState <> 0 thenwhat do you think ?