#1 2022-04-27 13:26:04

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Suddenly getting "Method Not Allowed" after updated mORMot

@ab,

I'm using `ExecuteList` without supplying the `Tables` parameter, something like:

myDbClient.ExecuteList([], 'select...')

Both the client and the server has been running ok for years (the mORMot version was last years), but recently after upgraded to the latest mORMot, the client is getting 'Method Not Allowed' errors, but I couldn't identify since which revision of mORMot the issue is start raising.

Does it have anything to do with reSQLSelectWithoutTable or TSQLAllowRemoteExecute? Please advise how to make ExecuteList work without supplying the `Tables` parameter. Thanks.

Last edited by edwinsn (2022-04-27 13:29:01)


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2022-04-27 13:40:28

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Suddenly getting "Method Not Allowed" after updated mORMot

ok, Since I use the default 'User' user,  I guess it has something to do with the fact that in `TSQLAuthGroup.InitializeTable`, it excludes the `reSQLSelectWithoutTable` attribute:

...
          Exclude(A.AllowRemoteExecute,reSQLSelectWithoutTable);
...

Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#3 2022-04-29 04:35:06

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Suddenly getting "Method Not Allowed" after updated mORMot

ok, another related issue must be related - in a project that's not using the mORMot authentication (aHandleUserAuthentication is False for TSQLRestServerDB.Create), the batch update operation is no longer allowed - BatchSend returns HTTP_FORBIDDEN 403

I will now have to check mORMot commit logs one by one to determine which revision changed the behavior...


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#4 2022-04-29 07:58:14

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Suddenly getting "Method Not Allowed" after updated mORMot

OK, I'm getting  the following error:

Project My_Server.exe raised exception class EORMBatchException with message 'TDbServer.EngineBatchSend: Unknown @GeneralEvent'.

Where GeneralEvent is a table name.

Strange, I check the project's svn logs and there is no recent changes, but just updated mORMot. But I don't know where and the old mORMot revsion. I think now I should have a text file for recording each time I pull the latest mORMot source to local...


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#5 2022-04-29 09:10:32

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Suddenly getting "Method Not Allowed" after updated mORMot

Wow! Unbelievable! The issue is neither coming from the mORMot code nor my code, it's an issue of TortoiseSVN - I use TortoiseSVN to download latest mORMot source from github and since I've done minor changes in SynCommons.pas, it somehow  failed to update/merge that file. See attached screenshot.

I think I should now switch to a real git client to pull public code, but I really like TortoiseSVN shows what files were changed/added after executing the "Update" command.

m-ORMot-Syn-Commons-compare.png


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#6 2022-04-29 10:37:09

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 210

Re: Suddenly getting "Method Not Allowed" after updated mORMot

Nice that you found out why but it really isn't the tools fault, there was clearly a conflict with your manual changes. The tool did it's job and prevented the loss of your modifications, it warned you that there is a conflict but you probably just closed the window. What you had to do is to click on the conflicted file in the update window and click manual resolve.... Then you would get an editor where you could manually merge or update the conflicted lines. The same thing would happen if you used any other tool/client.

I also like the Tortoise client, the only thing I change is that I use Beyond Compare as the editor of choice for merges&conflicts, highly recommend.

Last edited by pvn0 (2022-04-29 10:57:21)

Offline

#7 2022-04-29 13:52:30

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Suddenly getting "Method Not Allowed" after updated mORMot

pvn0 wrote:

Nice that you found out why but it really isn't the tools fault, there was clearly a conflict with your manual changes.

Thanks for your comments, but no no no, the code differences as shown in the screenshot I posted above IS NOT my manual changes, I did not change those two lines.

I actually don't know why the code differences existed, my changes were located in other 3 lines related to the `DOPATCHTRTL` definition. The screenshot above was captured after I synced my changes to the latest downloaded source and only leaving the mysterious code differences as shown in the screenshot.

sorry I didn't make it clear.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#8 2022-04-29 20:36:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,206
Website

Re: Suddenly getting "Method Not Allowed" after updated mORMot

The commit in the above screenshot is indeed a real commit, https://github.com/synopse/mORMot/commi … 0717d58c5a

smile

Offline

#9 2022-04-30 03:28:09

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Suddenly getting "Method Not Allowed" after updated mORMot

ab wrote:

The commit in the above screenshot is indeed a real commit, https://github.com/synopse/mORMot/commi … 0717d58c5a
smile

Yes, I knew it's a real commit, what I said I don't know is why svn didn't merge it correctly smile

PS, may this case of mine can be listed in that kind of "what strange bugs you've experienced" article wink


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#10 2022-04-30 06:19:29

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 210

Re: Suddenly getting "Method Not Allowed" after updated mORMot

I wasn't referring to the screenshot per se

edwinsn wrote:

since I've done minor changes in SynCommons.pas, it somehow  failed to update/merge that file.

I would 100% expect tortoise to not auto overwrite your modifications if the two conflicted. Maybe you encountered a bug like you said but this just sounds normal operation to me. I've done the same thing in the past, I introduced manual changes in SynCommons for debugging or some other reason and tortoise would always soft-fail the repo update and I either had to dismiss my changes or manually merge the file in question.

Then again this is software big_smile, maybe you were/are using a tortoise version where such a bug exists. OR perhaps it has something to do with using a Subversion tool to update from a git repo, that may very well be the case.

Offline

#11 2022-05-01 07:22:27

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Suddenly getting "Method Not Allowed" after updated mORMot

pvn0 wrote:

I would 100% expect tortoise to not auto overwrite your modifications if the two conflicted. Maybe you encountered a bug like you said but this just sounds normal operation to me.

Actually my manual changes to the SynCommons.pas file were not shown in the above screenshot at all, my changes were in other lines, all are similar to:

//{$define DOPATCHDISPINVOKE}

these change of mine are not shown in the above screenshot.
So I'm 100% sure the code differences shown in the above screenshot were not done by me wink


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB