You are not logged in.
The error was reported by a user.
Situation:
- Both the client and server are on the same machine, they communicate via HTTP. So the network is OK.
- Aside from this error, The TSQLHttpClient is working correctly - it's not that it could not connect to the server at all - it can.
Stack trace:
thread $afc (TOmniThread), inner exception level 1:
>> Exception, LastErrorMessage: {"EWinHTTP":"winhttp.dll error 12002 (The operation timed out)"}
.
URL: root
.
Method: GET
.
Exception Msg: winhttp.dll error 12002 (The operation timed out)
00b9c34d MyApp1.exe DbCli 139 TDbCli.CatchAllErrors
008dd3a4 MyApp1.exe mORMot 35385 TSQLRestClientURI.SetLastException
008dda6f MyApp1.exe mORMot 35515 TSQLRestClientURI.URI
77b605ba ntdll.dll KiUserExceptionDispatcher
77865b8f KERNELBASE.dll RaiseException
00b7fc40 MyApp1.exe SynCrtSock 6824 THttpRequest.Request
00b8939a MyApp1.exe mORMotHttpClient 866 TSQLHttpClientRequest.InternalRequest
00b87a5f MyApp1.exe mORMotHttpClient 486 TSQLHttpClientGeneric.InternalURI
008dd800 MyApp1.exe mORMot 35478 TSQLRestClientURI.URI
008db05d MyApp1.exe mORMot 34734 TSQLRestClientURI.ExecuteList
008d631f MyApp1.exe mORMot 32933 TSQLRest.MultiFieldValues
008cda56 MyApp1.exe mORMot 30237 TSQLRecord.CreateAndFillPrepare
008cdaeb MyApp1.exe mORMot 30250 TSQLRecord.CreateAndFillPrepareI appreciate any input!
AOG, thanks, with your roadmap, with the efforts by you and ab and other contributors, I have the confidence to use mORMot for web servers for Linux.
@AOG,
New result
===
Thanks! So I've just tested - with the latest version, the 30-MVCServer server was successfully compiled for Linux X86_64 target, and runs properly under Ubuntu 14.04.
However, under an old Ubuntu 10.04.4 LTS 64bit (that failed to upgrade to 14.04 for unknown reasons), it is not running, not sure why and I'm not planning to check it ![]()
Questions
===
1 - Would you tell me the reason(s) why you are not using the MVC module?
2 - One question you might have over looked - does your server serving behind nginx/apache or directly to the Internet? ![]()
3 - There are 5 types of T2 instance, which type do you use?
Thanks again.
Thanks for your effort, AOG.
BTW, Several general questions about running mORMot under linux -
1 - Do you use the MVC part of the mORMot framework under linux?
2 - Does your mORMot web server server the Internet users standalone or behind something like nginx?
3 - How do you monitor the mORMot web server problems, such as when it's hang, when there were an error, when the traffic is to heavy, etc?
Thanks again.
@AOG,
I'm not that hurry, so I'll leave it for now, I guess these fix will be included in future release of mORMot, right?
It looks like the daemon code posted by AOG need to be updated in order to compile. I can not find a class called TSOHITServer in the mORMot source code.
TSOHITServer should be AOG's derived class, but not a class included by the mORMot framework...
Hi Alfred,
Added the {$define AES_PASCAL} define in SynCrypto.pas, or {$define PUREPASCAL} define in Synopse.inc, it still emits error, and the error messages were changed to:
An unhandled exception occurred at $000000000060FA20:
EAccessViolation: Access violation
$000000000060FA20
$0000000000613E61 FULL, line 4849 of ../../../SynCrypto.pas
$0000000000611877 SHA256, line 1621 of ../../../SynCrypto.pas
$00000000005AEC26 SETPLAINPASSWORD, line 194 of MVCModel.pas
$00000000005AED1B INITIALIZETABLE, line 209 of MVCModel.pas
$000000000059B6BF CREATEMISSINGTABLES, line 1063 of ../../mORMotSQLite3.pas
$0000000000401619 main, line 43 of MVCServer.dprGreat AOG!
A - The Windows version with cross-compiling was also done by fpcup?
B - I assume I can just run cross_linux_armhf_rtti.bat to update my copy of fpc/lazarus to the latest svn snapshot? (On windows I think I can configure cmd.exe to use the ShadowSocks proxy which is more stable and fast (with the help of Final Speed))
C - And here is a good news - result of my further experiments:
On a Ubuntu server 14.04 64bit, after added the i386 architecture following this instruction (http://askubuntu.com/questions/454253/h … ntu-64-bit), the MVCServer example successfully started and was running without error!
Anyways, I also have tried the x86_64 target when cross-compiling, and on the same Ubuntu server it failed to start and output the following error, I'm just posting it here as a feedback:
edwin@mysvr:~/download$ ./MVCServerx64
An unhandled exception occurred at $0000000000610037:
EAccessViolation: Access violation
$0000000000610037 SHA256EXPANDMESSAGEBLOCKS
$0000000000613D6B FINAL, line 4827 of ../../../SynCrypto.pas
$0000000000613DD1 FULL, line 4848 of ../../../SynCrypto.pas
$0000000000611957 SHA256, line 1621 of ../../../SynCrypto.pas
$00000000005AEC26 SETPLAINPASSWORD, line 194 of MVCModel.pas
$00000000005AED1B INITIALIZETABLE, line 209 of MVCModel.pas
$000000000059B6BF CREATEMISSINGTABLES, line 1063 of ../../mORMotSQLite3.pas
$0000000000401619 main, line 43 of MVCServer.dpr
Hi AOG,
That fixed the compilation error. Thanks.
BTW, is it correct that the downloads you provided were all completely generated by https://github.com/LongDirtyAnimAlf/Reiniero-fpcup ?
@AOG,
Thanks again! Downloaded the windows version, Lazarus started OK, great! When cross-compiling the MVC server sample it failed, not sure what's wrong. Log messages.
Compile Project, OS: linux, CPU: x86_64, Target: MVCServer: Exit code 1, Errors: 1, Warnings: 189, Hints: 1603
MVCServer.dpr(4,2) Note: APPTYPE is not supported by the target OS
.....
MVCViewModel.pas(448,21) Hint: Function result variable of a managed type does not seem to be initialized
MVCViewModel.pas(443,5) Note: Local variable "auto" is assigned but never used
C:\fpclazrtticross\fpc\units\x86_64-linux\rtl\cprt0.o: In function `_start':
(.text+0x3c): undefined reference to `__libc_csu_init'
C:\fpclazrtticross\fpc\units\x86_64-linux\rtl\cprt0.o: In function `_start':
(.text+0x43): undefined reference to `__libc_csu_fini'
MVCServer.dpr(62,1) Error: Error while linkingWhat am I missing? Thanks AOG.
@AOG, wow! Using your fork, the "30 - MVC Server" example works! Great!
Several questions if you don't mind:
Inside my Virtualbox VM, Any Ctrl or Alt key strokes, for example, Ctrl + F9 does not work for Lazarus, any hint?
Would you also share Windows version of the "latest Lazarus with RTTI for **Windows**"? I'd rather develop under Windows, and compile the final result under Linux ![]()
Have a nice weekend!
And the failed tests:
1.2. Low level types:
- RTTI: 410 assertions passed 1.16ms
- Url encoding: 200 assertions passed 978us
! Low level types - Encode decode JSON
! Exception EAccessViolation raised with messsage:
! Access violation
- Variants: 48 assertions passed 234us
- Mustache renderer: 146 assertions passed 6.15ms
- TDocVariant: no assertion 326us
- BSON: no assertion 133us
- TSynTableStatement: 206 assertions passed 350us
- TSynMonitorUsage: 1,202 assertions passed 500us
Total failed: 5 / 284,795 - Low level types FAILED 4.63s
2.4. Memory based:
- Database direct access: 20,246 assertions passed 259.74ms
- Virtual table direct access: 12 assertions passed 9.83ms
- TSQLTableJSON: 144,070 assertions passed 311.32ms
- TSQLRestClientDB: 402,407 assertions passed 2.71s
- TRecordVersion: 20,060 assertions passed 270.42ms
- RTree: 140,000 assertions passed 1.18s
! - Shard write: 100 / 10,602 FAILED 1.22s
! - Shard read: 20,000 / 140,001 FAILED 1.35s
! - Shard read after purge: 2 / 114,003 FAILED 1.22s
Total failed: 20,102 / 991,401 - Memory based FAILED 8.56sI'm using your fork of mORMot, and it's Much less errors than the version compiled by the official Lazarus public release.
Well done AOG!
Thanks AOG! So I installed it and successfully compiled the mORMot self test suites.
Here is the commands I used, maybe of help to other **linux newbies** like me.
# Extract it to the correct place
sudo tar xf newfpcbig.tar.gz -C /
#Run the installed Lazarus 1.7
sudo ./Lazarus_newfpc@AOG, Thanks for sharing!
I'm still not clear about that, What problems I might have if I use the the official Lazarus 1.6? Since currently it already compiles the latest mORMot (Arnaud's version, not tested your version yet).
My concern is that, is the version you kindly provided shares the same configuration data with the official Lazarus release? You know, since I'm new to Lazarus, but when upgrading Delphi it's really a pain to configure the paths, the 3rd party libs and tools, etc, I'm not sure if it's also that case with Lazarus.
AOG, if it's ok, please publish the FPC/Lazarus RTTI distro.
I will figure out how to build the latest fpc/Lazarus.
AOG,
Re. fpcup is not working, because almost all internet connections from inside China going outbound are NOT stable, because of this: (https://en.wikipedia.org/wiki/Great_Firewall), the svn checkout will not get to the end. It's a real pain in the ass, if you ask me...
On the other hand, if I use TortoiseSVN, I can check out this FPC source (https://github.com/graemeg/freepascal). But I haven't had the time to check how to use it with my Lazarus 1.6 installation, if you have any hints, I'll be appreciated...
@AGO, Wow! Another good news again!
So for Lazarus I should use this fork instead, right?
Regarding the "FPC/Lazarus RTTI distro", what is it?
My Lazarus (downloaded from getlazarus.org) for Windows 7 64bit:
Lazarus version: 1.7
Lazarus svn revision: Unknown
Lazarus build date: 2016/03/06
Lazarus was compiled for i386-win32
Lazarus was compiled with fpc 3.1.1My Lazarus (downloaded from sf.net) inside my Linux Mint Xfce 32bit inside a Virtualbox:
version: 1.6
Lazarus svn revision: Unversioned directory
Lazarus build date: 2016/02/15
Lazarus was compiled for i386-linux
Lazarus was compiled with fpc 3.0.0Thanks for the info ab.
May 13, 2016 updates:
Installed Lazarus 32bit 1.6 under Linux Mint Xfce 32bit and successfully compiled and executed:
- The self tests.
- 01 - In Memory ORM
- 04 - HTTP Client-Server
Wow! That feels so good
Thanks Arnaud and other contributors like AOG!
Other notes:
Running self tests emitted quite a lot of errors (same as when being compiled with XE4).
Now I should look around for a way to update my FPC to the latest trunk since fpcup doesn't work on my netowork, so anybody has any hints would be welcomed!
That sounds good, AOG, thanks for the info!
Further finding, according to (https://help.ubuntu.com/community/MultiArch), it seems that plain 32bit executables without external libraries just works under 64bit Ubuntu and debian!
The latest Linux Mint Xfce 17.3 runs much faster than Ubuntu (forgot the version number, I tried it few months ago) inside a Virtualbox VM, and the UI is quite slick!
I failed to install Lazarus with fpcup due to network problems (mostly likely it's because of the GFW (local gov. censoring).
So I installed the latest Lazarus 1.6 deb files from sourceforget.net. The installation process was quite smooth.
I checked out the latest mORMot sources from github.com, setup the paths, etc. And I got this error:
SynCrypto.pas(2552,40) Error: Generating PIC, but reference is not PIC-safeAfter some research, I realized that mORMot does NOT support FPC/Lazarus 64bit yet.
And then I did some more researches, I figured I'd **for now** give up the idea of writing mORMot-based web app for Linux - mORMot has quite some ASM code (for good reasons, I know), and I wonder when, if even, it'll will compile under Linux/Lazarus 64bit. According to some articles I read, it's not always as easy as running some apt-get commands to setup linux64bit to run 32bit apps.
Hope these info make sense to be posted here, for future explorers.
@EMartin, how does TSynRestDataset determine the field types? I'm asking this question because the built-in ToClientDataset() function determine the field types by guessing, which is not always accurate.
another-best idea: donate some bucks to Mr. AB
Awesome Mr.AB does treat his clients with dignity and respect.
This is a response to @warleyalex's suggestion to @aroxing in another post.
It's just a small amount - EUR 50 ![]()
So let me just follow @warleyalex's advocation - if you benefit from ab's great work, consider send him a donation ![]()
mORMot is an very useful open source project, what's really awesome is that this project has been **very actively** developed for many years and ab is usually respond to issues **very quickly** - the level of support provided by ab is top and is over many commercial vendors.
@aroxing,
It'll be helpful to others if you report back your usage experiences later ![]()
@aroxing, In my case I needed to have bought another commercial websockets library (http://websockets.esegece.com/), I've not fully integrate it into my program, but according some simple tests it worked as expected - I think they have tested with some standards.
PS, I got a forum msg sent from you saying you want to **answer** a WebSockets-related question of mine, but obviously you are wanting an anwser ![]()
And main mORMot has been reported to work with OSX, but not with Delphi, but with FPC.
Hey ab, this is a very vulnerable info to me! Thanks!
Hi Arnaud,
Since Delphi 10.1 Berlin, Delphi has native support for Utf8String and RawByteString type on all platforms:
http://stackoverflow.com/questions/8460 … uced-depre
AFAIK, mORMot doesn't support Mac OS X yet. With the above-mentioned new language features, can I assume that it'll make it possible (easier?) to make mORMot support Mac OS X? Thanks.
Hi ab,
I'm not just trying to argue, but I view it as **exceptional** if you use BatchStartAny() and then BatchDelete(ID: TID) without providing a TSQLTable class, but because it's not expected to be so.
Thanks MPV! I'll try and let you know the result ![]()
Hi ab,
If you allow me, I'd like to suggest that this design is error-prone - as you can see in my reported case.
Raising exception is a better way for catching errors, because, quoting from SO user Ned Batchelder:
if you forget to do what you should be doing with status returns, you ignore errors. If you forget to do what you should be doing with exceptions, the exception bubbles up to the outer layer of the software where it becomes visible.
Raising exceptions is a modern software design for error handle, people says.
You can check this StackoverFlow discussion for further info: http://stackoverflow.com/questions/4670 … error-code
Just my 2 cents ![]()
Hi Arnaud,
I was "trapped" by a case, and I'm wondering if it's worth posting here for your information ![]()
Problem: BatchDelete() might have no effects at all, while the results and TSQLRestClientURI.OnFailed() will not report anything about it.
Steps to reproduce the issue:
1 - Use BatchStartAny, but NOT BatchStart();
2 - Use BatchDelete(ID: TID), but NOT BatchDelete(Table: TSQLRecordClass; ID: TID).
3 - Now BatchSend will just return HTML_Success and OnFailed will not report anything.
Thanks for your time!
Hi ab,
How to have all SQL statements executed by the framework to be logged? I tried several approach, but failed:
//TSynLog.Family.Level := LOG_VERBOSE; //I thought this will work but it's not.
TSynLog.Family.Level := [sllNone, sllInfo, sllDebug, sllTrace, sllWarning, sllError,
sllEnter, sllLeave,
sllLastError, sllException, sllExceptionOS, sllMemory, sllStackTrace,
sllFail, sllSQL, sllCache, sllResult, sllDB, sllHTTP, sllClient, sllServer,
sllServiceCall, sllServiceReturn, sllUserAuth,
sllCustom1, sllCustom2, sllCustom3, sllCustom4, sllNewRun,
sllDDDError, sllDDDInfo, sllMonitoring]; //not working...
TSynLog.Family.EchoToConsole := [sllSQL]; //not working...
//my other settings if they are useful here:
TSynLog.Family.AutoFlushTimeOut := 10;
TSynLog.Family.OnArchive := EventArchiveZip;
TSynLog.Family.ArchiveAfterDays := 7; // archive after 7 day
TSynLog.Family.DestinationPath := GetServerLogsFolder;
ForceDirectories(TSynLog.Family.DestinationPath);I use the sqlite db. I serached all over the web but was not lucky, so post the question here.
@Stephen, @ab,
Regarding:
So I can write a service that has methods like:
function LoadCustomers(out customers: IList<TCustomer>): Boolean
But this already fails at startup because interface parameters are currently not supported.
Is the issue fixed, can we use the Spring4D collection in a mORMot service now?
AFAIK It's not possible with the current version.
I guess that can be achieved by using attributes (http://wiki.freepascal.org/Property_attributes), which is also supported by FPC (). But I'm afraid Arnaud will have to abandon support for earlier versions of Delphi and Kylix, but I doubt he will.
Another idea would be allow defining a class method for TSQLRecord, something like TSQLRecord.GetAutoPersistedFieldsInCSVFormat(), where people can return a CSV-formatted string like 'ID, Name, Year', to define which fields will be handled by the framework. But I'm not sure if that will work, ab can tell us ![]()
Yes, the batch mode is very efficient and useful!
hi ab,
I'm not using external FTS4 tables, but I'll provide feedback if I do in the future.
I don't think the .obj file size is a real concern nowadays, all after all, it'll still be in the "light" level. I just read the FTS5 document:
FTS5 has no matchinfo() or offsets() function, and the snippet() function is not as fully-featured as in FTS3/4...
That doesn't sound very interesting...
This is already supported by the framework.
See http://synopse.info/files/html/Synopse% … ml#TITL_93
Hi ab,
That sounds very useful! Does RemoteDataCreate() support FTS4/FTS5 records?
BTW, It seems that mORMot only supports FTS4, FTS5 is not added yet?
For inspiration ![]()
https://github.com/timothycrosley/hug
Description: Hug aims to make developing Python driven APIs as simple as possible, but no simpler. As a result, it drastically simplifies Python API development.
Make sure check that GIF animation - how easy it's to develop a web front end!
Great! I see now, thanks ab!
Thanks ab. The first link is broken. I went through the second forum post.
In short, if I use TByteDynArray instead of TSQLRawBlob as the type for my binary fields, the binary data will be transferred by BatchAdd() and BatchUpdate(), is this correct? Thanks again!
Hi,
It seems that batch mode doesn't support adding/updating BLOB data, right? If so, is there a way to do that? That'll be extremely useful. Thanks.
edwinsn wrote:I'm not able to help, but I'm interested in this topic.
I've implemente this using jwt.io, please see: http://synopse.info/forum/viewtopic.php?id=3167
Thanks, is your client html/js or Delphi? I mostly interested in JS (in browser) ![]()
Hi, maybe the recent FPC change below, is what breaking the FPC-compatibility of the mORMot source?
I'm not able to help, but I'm interested in this topic.
I think ab's approach is good - using string values instead, it offers flexibility.
Well done guys!
Great! Well done!
Great! Thanks Arnaud!
Well done AOG, although I wish you have used AngularJS or other popular js frameworks those are more obvious to customize the UI at the html/css level instead ![]()
@ab, as a similar question, the last time you asked me to have created a ticket about intercepting all **exceptions** in a single place on the **client** side. Are you still interested in that ticket ![]()