You are not logged in.
Pages: 1
I couldn't compile in Win64 version.
I got this error when compile.
[dcc64 Fatal Error] F2084 Internal Error: L3226
Delphi 10.3 with mORMot 1.18.6416
So I try to test compiling with SQLite3/Samples
on 01 - In Memory ORM ==> Compiles Success
on 02 - Embedded SQLite3 ORM ==> Compiles Failed!!!!
After test it fail if include SynSQLite3Static
So I search and try
- download new latest version from github .obj / .o is 30 Sep 2022 checked.
- download sqlite3-64.dll and copy to where Project02.exe are. Still got same error as above L3226
- I cant find how to use dynamic link on wher to call and I use TOleDBMSSQL2012ConnectionProperties
Do I miss something?
Okay, I will try with Win64.
Thank you for your assistance. ^_^
No sir, what is the difference between compiling with Win32 and Win64?
And which one should we really use?
[more detail I forgot to mention on topic]
* Service only spend 350MB the time they have this problem.
I got this error message
TOleDBConnection: Not enough storage is available to complete this operation
I already check RAM is fine used 14 GB out of 32 GB. And service only spend 350MB the time they have this problem.
I run this service on WindowsVM using MSSQL, mdf and ldf is unlimited no capped.
Could it be from shrinking DB from 400GB to 100GB make db file corrupt or something?
Thanks for helping, I totally have no clues right now @_@
Information I want is
- InputBody
- InputHeader (i sent something useful from Angular) (UserAgent and RemoteIP also)
- OutputBody (so OnServerBeforeURI won't have this data like OnAfterBeforeURI?)
- MicroSecondsElapsed (OnAfterBeforeURI has Ctxt.MicroSecondsElapsed)
Actually I try AddInterceptor(), every data I want is all fine except just
Ctxt.MicroSecondsElapsed always 0
This is when I start service
....
aProps := TOleDBMSSQL2012ConnectionProperties.Create(servername, databasename, username, password);
ServerDB := TSQLRestServerWS.Create(Model, ':memory:', True);
ServerDB.OnAfterURI := OnServerAfterURI;
HttpServer := TSQLHttpServer.Create(port, [ServerDB]);
.....
Callback function
procedure TSM.OnServerAfterURI(Ctxt: TSQLRestServerURIContext);
begin
UT.Log(Ctxt.Call.InBody);
end;
UT.Log is just function that log text to file
This is what I got on output.txt
[
"{"onlyunread":"Y","size":9999999} 9999}"
There is newline after the bracket and garbage at the end which screw JSON format
This is what Angular actually sent
["{"onlyunread":"Y","size":9999999}"]
I just want to log what Angular sent me as input when they request API to mORMot.
PS. sorry for my bad English. I'm not a native speaker U_U
Did you enable saoUserByLogonOrID?
Could you try it debugging what seems weird in TSQLRestServerAuthentication.GetUser?
I never seen this saoUserByLogonOrID before so i look into code and I see that this options is set by default, so i never know.
file: mORMot
constructor TSQLRestServerAuthentication.Create(aServer: TSQLRestServer);
begin
fServer := aServer;
fOptions := [saoUserByLogonOrID];
end;
So then I try disable it instead by using this code, now it works!!
serverAuth := (ServerDB.AuthenticationRegister(TSQLRestServerAuthenticationDefault) as TSQLRestServerAuthenticationSignedURI);
serverAuth.Options := [];
Thank you :3
In my dbo.USERS there is 47 users with ID from 1-47 (ID is primary key with auto-inc)
I have one user with LogonName is 019 and try to login but it failed.
So I try change it to 025 047 47 it also failed
But when I change it to 048 48 it works!!!!!!
So I think, if LogonName can parse into number like 047=47 or 0000047=47
and if that number is same as ID it will failed when login.
below is just simple startService function that I use
aProps := TOleDBMSSQL2012ConnectionProperties.Create(servername, databasename, 'sa', password);
VirtualTableExternalRegister(Model, TSQLGroups, aProps, 'dbo.GROUPS');
VirtualTableExternalRegister(Model, TSQLUsers, aProps, 'dbo.USERS');
//
ServerDB := TSQLRestServerWS.Create(Model, ':memory:', True);
ServerDB.CreateMissingTables(0);
//
ServerDB.ServiceRegister(TServiceDocument, [TypeInfo(IDocument)], sicShared);
ServerDB.ServiceRegister(TServiceDatabase, [TypeInfo(IDatabase)], sicShared);
ServerDB.ServiceRegister(TServiceKacc, [TypeInfo(IKacc)], sicShared);
ServerDB.ServiceRegister(TServiceCuisine, [TypeInfo(ICuisine)], sicShared);
//
ServerDB.ServiceMethodByPassAuthentication('Download');
//
HttpServer := TSQLHttpServer.Create(port, [ServerDB]);
HttpServer.AccessControlAllowOrigin := '*';
I'm using Mormot_610624
@ab
Not work either.
Try put breakpoint on ServerDB := TSQLRestServerWS.Create(Model, ':memory:', True); not break here too.
Did I do something wrong about debugging?
@emaxx
Try adding but error still happen
function TSM.StartService(port, databasename: String): Boolean;
begin
aProps := TOleDBMSSQL2012ConnectionProperties.Create(servername, databasename, username, password);
VirtualTableExternalRegister(Model, TSQLGroups, aProps, 'dbo.LOT_GROUPS');
VirtualTableExternalRegister(Model, TSQLUsers, aProps, 'dbo.LOT_USERS');
ServerDB := TSQLRestServerWS.Create(Model, ':memory:', True);
ServerDB.CreateMissingTables(0);
ServerDB.ServiceRegister(TServiceDatabase, [TypeInfo(IDatabase)], sicShared);
ServerDB.ServiceRegister(TServiceDatabase2, [TypeInfo(IDatabase2)], sicShared);
(ServerDB.AuthenticationRegister(TSQLRestServerAuthenticationDefault) as TSQLRestServerAuthenticationSignedURI).NoTimeStampCoherencyCheck := true;
HttpServer := TSQLHttpServer.Create(port, [ServerDB]);
HttpServer.AccessControlAllowOrigin := '*';
Result := True;
end;
Trying to debug but don't know what i'm doing wrong. Put breakpoint but never stop here U_U.
Hello everyone, I try searching everywhere but nothing solve my problem.
I can login and everything works fine. Except that once in a while when client(angular2) call API to mormot server, it will throw error on chrome-debug with
{errorCode:403, errorText:"Authentication Failed: Invalid signature (0)"}
Likely to happen more frequent when server has many access at that time.
This is my SessionSign method on angular2
private SessionSign(url) {
var Tix, Nonce, s, ss, d = new Date();
Tix = d.getTime();
if (this.fLastSessionTickCount == Tix) {Tix = Tix + 1;}
this.fLastSessionTickCount = Tix;
Nonce = Tix.toString(16);
while(Nonce.length < 8) { Nonce = '0'+Nonce; }
if (Nonce.length > 8) { Nonce = Nonce.slice(Nonce.length-8, Nonce.length) }
ss = crc32(url, crc32(Nonce, this.fSessionPrivateKey)).toString(16);
while(ss.length < 8) { ss = '0'+ss; }
s = url.indexOf("?") == -1 ? url+'?session_signature=' : url+'&session_signature=';
return s + this.fSessionIDHexa8 + Nonce + ss;
}
This is when I start service on Server
function TSM.StartService(port, databasename: String): Boolean;
begin
aProps := TOleDBMSSQL2012ConnectionProperties.Create(servername, databasename, username, password);
VirtualTableExternalRegister(Model, TSQLGroups, aProps, 'dbo.LOT_GROUPS');
VirtualTableExternalRegister(Model, TSQLUsers, aProps, 'dbo.LOT_USERS');
ServerDB := TSQLRestServerWS.Create(Model, ':memory:', True);
ServerDB.CreateMissingTables(0);
ServerDB.ServiceRegister(TServiceDatabase, [TypeInfo(IDatabase)], sicShared);
ServerDB.ServiceRegister(TServiceDatabase2, [TypeInfo(IDatabase2)], sicShared);
HttpServer := TSQLHttpServer.Create(port, [ServerDB]);
HttpServer.AccessControlAllowOrigin := '*';
Result := True;
end;
Called method
function AuditLog_GetAuditLog(dataobj: RawUTF8): TServiceCustomAnswer;
var res: ISQLDBRows;
sql,data,lotstatus,onlyunread: RawUTF8;
watch,size: Integer;
obj: Variant;
showAll: Boolean;
begin
obj := _JSON(dataobj);
size := 1000;
showAll := False;
if obj.Exists('size') then begin
size := obj.size;
end;
if obj.Exists('showAll') and (obj.showAll='Y') then
showAll := True;
//---- build SQL command ----
sql := 'select TOP '+size.ToString+' * from AuditLog';
if not showAll then
sql := sql + Format(' where (UserID=%s or ChangeUserID=%s)', [SQLB.Str(obj.userid), SQLB.Str(obj.userid)]);
sql := sql + ' order by ID';
res := SM.aProps.ExecuteInlined(sql, True);
Result.Content := Data_Content(res, 'false'); // make json
Result.Header := 'Content-type: application/json';
end;
Pages: 1