#1 2021-08-31 14:29:38

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

[Solved] IInvokable has no GUID

Hi @ab,

I have converted Project31ChatClient to "pure" mormot2.

Everything works correctly, but when disconnecting the client it generates "IInvokable has no GUID" error on the server, and as a consequence a memory leak.

log

mormot.rest.memserver.TRestServerFullMemory(015ed360) TRestServerRoutingRest.Error: {  "errorCode":406,  "error":  {"EInterfaceFactory":  {   "ClassName": "EInterfaceFactory",   "Address": "tinterfacefactory.create",   "Message": "TInterfaceFactoryRtti.Create: IInvokable has no GUID"  }}  }

mormot.core.interfaces, 3734

...
 if IsNullGuid(fInterfaceIID) then
    raise EInterfaceFactory.CreateUtf8(
      '%.Create: % has no GUID', [self, aInterface^.RawName]);  <<--- here

Sample project on git

Lazarus + FPC Win 32
Cross compiled to Win x64

Last edited by macfly (2021-09-01 16:28:20)

Offline

#2 2021-09-01 15:55:42

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

Re: [Solved] IInvokable has no GUID

Small side note: under Lazarus, you would rather install the mormot2 package, then include it as dependency to your project.
So you won't need to setup the mORMot folders, which are relative to your own setup/computer.

I have just fixed the "IInvokable" problem.
Check https://github.com/synopse/mORMot2/comm … 532bcb0ae1

But it sounds like if our WebSockets support is a bit unstable on mORMot 2.
So any feedback is welcome.
I will need to add WebSockets support to our newly introducing async HTTP sockets server. It will allow any number of concurrent websockets clients, whereas the current WS server uses on thread per client which exhausts the system resources quickly.
So perhaps the debug phase would take place with this new WS server.

Offline

#3 2021-09-01 16:28:03

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

Thank you ab,

Issue resolved in this latest update.

These are my first tests with websockets and mormot, any observation I can tell.

Good news about the asynchronous http server.
Hadn't noticed this new feature, I'll see.

Good tip about packages. It is already installed to run the tests.
I will use it from now.

Offline

#4 2021-09-01 16:35:45

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

Re: [Solved] IInvokable has no GUID

The trick is to include the package as dependency to your project options in Lazarus.

Offline

#5 2021-09-01 16:52:25

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

Yes, I'm using it from now on.

Offline

#6 2021-09-09 21:28:05

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

I'm playing with Websockets and when using a rawbytestring parameter the server freezes at some point to process the request.

  IRunService = interface(IServiceWithCallbackReleased)
    ...
    procedure CacheContentInServer(const ACacheName: String; AContent: RawByteString; out ASaved: Boolean; out AError: String);
  end; 

I didn't get many clues in the debug but it caused a memory leak:
https://gist.github.com/devaex/d6b7ad7c … 9fd811e8af

The error disappeared when changing the parameter to RawUtf8.

For my case, the correct type would be RawUft8 because the content are text.
But I believe this will be a problem for anyone who needs to send binary content with RawbyteString.


mormot2 + Lazarus + FPC Win32 + Cross to Win 64.

Offline

#7 2021-09-09 21:44:23

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

Forget about it, my mistake.

Analyzing better the memory leak I saw that could be due to logs being generated for the console.

The logs are sending the entire content of the request to the console.

Fixed reducing logs level and/or disabling the output to console.

Offline

#8 2021-09-12 02:19:48

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

Hi ab, after this last update I'm getting a 404 timeout on the server when calling any callback method.

It can be verified in the same example:
https://github.com/devaex/ClientServerWebSocketSample

EInterfaceFactory {Message:"TInterfacedObjectFakeServer.FakeCall(IChatCallback.NotifyBlaBla) failed: 'TWebSocketServerRest.Callback(2) received status=404 from root/ChatCallback.NotifyBlaBla/1'"}

Both Server and Client compiled with lastet version.

Complete log:
https://gist.github.com/devaex/b06194e8 … ab28325767

Offline

#9 2021-09-12 14:23:49

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

Re: [Solved] IInvokable has no GUID

I am not able to reproduce the problem.

Offline

#10 2021-09-13 00:24:08

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

Really everything is ok.

The Settings property was removed in the update, and for inattention, for the project to compile I commented the entire line including WebSocketsEnable.

Sorry for the inconvenience

  // HttpServer.WebSocketsEnable(Server,PROJECTEST_TRANSMISSION_KEY).Settings.SetFullLog;  

Offline

#11 2021-09-14 21:51:40

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

ab wrote:

But it sounds like if our WebSockets support is a bit unstable on mORMot 2.
So any feedback is welcome.

I'm getting random 404 on the client side.
Same machine, and right after opening server and client, so it's not related to downtime.

It occurs much more frequently on linux than on Windows. On Windows it is rare, on linux it is constant.

 TInterfacedObjectFakeClient.FakeCall(IClientService.ListDetails) failed: 'URI root/ClientService.ListDetails[] returned status 'Not Found' (404 - Network problem or request timeout)'

Note: I'm registering 2 services on the server.
And I'm pretty sure this only happens when I register more than one service.

Because it hasn't happened yet when I removed one of the services.
But I still need to run more tests to confirm.

Update: I'm not sure I can actually register more than one service on the same server. Maybe this really isn't supported.

Resolved by creating a server for each service.

Last edited by macfly (2021-09-15 12:50:07)

Offline

#12 2021-09-15 01:06:14

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

It seems that after the last updates the server doesn't accept new connections when the  client disconnects.

Reproducible through the example project.
https://github.com/devaex/ClientServerWebSocketSample

1 - Connect to server with 1 client only
2 - Disconnect
3 - The server no longer accepts new connections and freezes.

Update: This is caused by the -gh option (report memory leaks) in Server.
The error went away after disabling. And it only occurs on Linux.

Last edited by macfly (2021-09-15 12:52:29)

Offline

#13 2021-09-15 12:49:56

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

Updates to the posts above, both resolved

Offline

#14 2021-09-15 13:45:14

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

Re: [Solved] IInvokable has no GUID

You should be able to register several services per server, for sure.

Offline

#15 2021-09-16 13:22:19

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: [Solved] IInvokable has no GUID

ab wrote:

You should be able to register several services per server, for sure.

Okay, ab.

Strangely, in my real application I experience freezes and slowdowns that I can't reproduce in the WebSocketChat sample.

The difference is that in the application the server is running in a daemon.

I'm going to modify the WebSocketChat  to do more testing.

Offline

Board footer

Powered by FluxBB