You are not logged in.
Pages: 1
Hi ab,
under Win64 (XE6) I got this error in all Browsers (Safari, Chrome, Firefox) at xhr response for big contents.
With mORMot(1.18) there is no such error.
Are there options I've to set for mORMot2?
Do you further informations?
Daniel
Offline
Same configuration, absolute no changes.
We are using mORMot2 for production since 2-3 weeks and all works well. This error comes some days ago. I don't thought about mORMot2 but WLAN/network issues.
But this comes definitely from/with mORMot2 but just for larger responses, small one works fine.
Thanks for your great work again!
PS: for jit I personally would prefer BESEN. What I've seen and heart from bero simply destroys my self-confidence
Last edited by danielkuettner (2021-08-11 16:55:44)
Offline
How is the big content sent back to the client?
As regular in-memory buffers? As files?
Have you an estimate of the content size threshold which triggers the error?
Are you using the socket mORMot server on Linux/Windows, or the http.Sys mORMot server on Windows?
Is there a reverse proxy in-between mORMOt and the client?
Does it have a cache configured?
http://lfender6445.github.io/applicatio … -mismatch/
Offline
result := inherited Request(Ctxt);
in HttpServer.Request from a service call with standard RawJSON result (result:[JSON-Content from Service])
Offline
Do you use a reverse proxy?
Have you an estimate of the content size threshold which triggers the error?
Are you using the socket mORMot server on Linux/Windows, or the http.Sys mORMot server on Windows?
Is there any exception/error in the mORMot server log?
Offline
1. Yes I'm using a reverse proxy (apache2) from the beginning of my career.
2.
Length of Res (Service-Result) = 123579733
Length of Ctxt.OutContent = 123579746 (this is +13 of 123579733 (because of +'{"result":[]}' what's correct))
3.
No, no sockets
4. No exceptions, only in Client(Browser) with ERR_CONTENT_LENGTH_MISMATCH
PS: a Length of 28403957 works, but this is just an example, not a gap
Last edited by danielkuettner (2021-08-11 16:57:08)
Offline
120MB of content is indeed huge.
I am not able to see how Ctxt.OutContent may be smaller than expected.
Is Call.OutBody length correct?
Please try the following in TBaseWriter.AddNoJsonEscape:
...
FlushToStream;
until false;
i.e. delete all "if Len < f .... break;" part of the code.
Offline
error still occurs after last update (14d8508bf1578e996542c44887e63efe91115972).
Ctxt.OutContent is not smaller, it's bigger, but seems to be wrong (when I can trust the Browsers).
I will follow your advices and give feedback...
Offline
at Service level Result is ok, in Http.Request Ctxt.OutContent is wrong often (not always).
Although length of Ctxt.OutContent is correct, you can't convert Ctxt.OutContent to _JSON (json is invalid here).
With mORMot1 length is the same as under mORMot2, but you can convert Ctxt.OutContent to _JSON without error.
In TBaseWriter.AddNoJsonEscape P can't parsed to json with _Json (TDocVariantData(Value).InitJson(Json, Options) gives false), but P parsed with JSON-Lint says "valid json"
I've to compare the P (mORMot1<>2) tomorrow.
Last edited by danielkuettner (2021-08-11 16:58:02)
Offline
What I usually do is to save huge context to files, then use a comparison tool like WinMerge or TotalCommander for comparison.
Maybe there is a buffer limit problem in some border case of TTextWriter... with file comparison it may become obvious.
Offline
I've looked for tools for that too and under linux there are also xxd and vimdiff or colordiff.
Last edited by danielkuettner (2021-08-12 04:56:01)
Offline
Ctxt.OutContent is perfectly identical (mORMot1 vs. mORMot2)! Not what I expected.
Seems to be a wrong content-length in http header. How can I check this value? In Ctxt I haven't found it?
As a side note, content won't parsed under mORMot2 by
_Json(JSON, Result, [dvoReturnNullForUnknownProperty, dvoAllowDoubleValue, dvoValueCopiedByReference]);
--> var JSON: RawUTF8, Result: Variant)
whereas under mORMot1 it will.
Offline
I have tried to reproduce the problem, having a new method returning 100MB of RawJson during the regression tests.
There was indeed a problem, and I just fixed TBaseWriter.AddNoJsonEscape to allow the CancelLastComma pattern to work as expected.
But I am not sure it was what happened for you.
Could you zip the content which fails to be parsed and put a link here (or send by email), so that I could try to reproduce it?
Offline
Pages: 1