Manager stop working after user select business

Hello,

I found very strange problem with one user, let say username is Alice.

Alice has access to 2 business (business1 and business2). After she login to Manager and select business2 my server which runs on Linux with Mono stop working with following error:

Jul 07 19:22:04 jdm-erp mono[6907]: at System.Threading.ExecutionContext.Run (System.Threading.Execut
ionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boo
lean preserveSyncCtx) [0x00000] in :0
Jul 07 19:22:04 jdm-erp mono[6907]: at System.Threading.ExecutionContext.Run (System.Threading.Execut
ionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031]
in :0
Jul 07 19:22:04 jdm-erp mono[6907]: at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <dbb
16e0bacdc4a0f87478e401bc29b6c>:0
Jul 07 19:22:04 jdm-erp systemd[1]: manager-server.service: Main process exited, code=exited, status=1/
FAILURE

In the same time she could normally work with business1.
How can I investigate this case?

This is really really strange. Can you do some isolation tests?

Is it just one user? Let’s say if you create user 2 named “Bob” with the exactly same user permissions, would “Bob” be able to crash the system too?

For now I found only one user with this problem. Also I’ve created Bob with the same permission and it works fine. No crashes found. For me it’s not a problem to create another user but If you need some additional information or some log according to this problem I am open to help you to found bug.

I could make a copy of my VM instance to make some tests.

If you delete Alice and re-create her as new user. Does it fixes the problem as well?

Yes, re-creation solved my problem.

Let’s just leave it at that for now. It is strange that is has happened but the issue cannot be reproduced from scratch. It could very easily be something strange going on in Mono. Eventually Manager will migrate to .NET Core anyway.

Unfortunately after few weeks problem appears again. But for now I don’t know who (what user) cause a problem.
Symptoms are the same. Manager stop working

service manager-server status

manager-server.service
   Loaded: loaded (/etc/systemd/system/manager-server.service; enabled; vendor preset: enabled)
   Active: failed (Result: start-limit-hit) since Tue 2019-07-23 10:09:27 CEST; 53min ago
  Process: 5348 ExecStart=/usr/bin/mono /home/erp/ManagerServer18.5.0/ManagerServer.exe -port 80 (code=exited, status=1/FAILURE)
 Main PID: 5348 (code=exited, status=1/FAILURE)

Jul 23 10:09:26 jdm-erp mono[5348]:   at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <81342d83acda4c5590ec19c7afdf26b9>:0
Jul 23 10:09:26 jdm-erp systemd[1]: manager-server.service: Main process exited, code=exited, status=1/FAILURE
Jul 23 10:09:26 jdm-erp systemd[1]: manager-server.service: Unit entered failed state.
Jul 23 10:09:26 jdm-erp systemd[1]: manager-server.service: Failed with result 'exit-code'.
Jul 23 10:09:27 jdm-erp systemd[1]: manager-server.service: Service hold-off time over, scheduling restart.
Jul 23 10:09:27 jdm-erp systemd[1]: Stopped manager-server.service.
Jul 23 10:09:27 jdm-erp systemd[1]: manager-server.service: Start request repeated too quickly.
Jul 23 10:09:27 jdm-erp systemd[1]: Failed to start manager-server.service.
Jul 23 10:09:27 jdm-erp systemd[1]: manager-server.service: Unit entered failed state.
Jul 23 10:09:27 jdm-erp systemd[1]: manager-server.service: Failed with result 'start-limit-hit'.

After last event I update Mono to the latest version.

Mono JIT compiler version 6.0.0.313 (tarball Sun Jul 14 09:59:19 UTC 2019)

This command helps me to start Manager again. But after some times it stopped working.

service manager-server start

Any ideas how to find what cause a problem?

I found user. So the situation very similar but user and database is not the same as in previous case.

We have user Kate, which trying to select database business3. After she login to Manager and select business3 my server which runs on Linux with Mono stop working. Systemd restart services. User again trying select business3, crashes, restart services, again, again, and after this we’ve got

Jul 23 10:09:27 jdm-erp systemd[1]: manager-server.service: Start request repeated too quickly.

I will try to move database to local Linux machine and check.

I was able to reproduce error on my local machine

Here is full log output:


Manager Server [Version 18.5.0]
Copyright (c) 2018 NGSoftware.  All rights reserved.

Syntax:

    mono ManagerServer.exe [options]

Options:

    -port [number]     Set port on which HTTP server should listen on.
    -path [directory]  Set directory where Manager should look for data.

Examples:

    mono ManagerServer.exe
    mono ManagerServer.exe -port 80
    mono ManagerServer.exe -port 80 -path "/root/.local/share/Manager"


[6:22:30 AM] HTTP server listening on port 8080

Unhandled Exception:
System.InvalidOperationException: Sequence contains more than one matching element
  at System.Linq.Enumerable.SingleOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Fun                                                                                                                         c`2[T,TResult] predicate) [0x0004a] in <fb28f09769054726b681ecb6df11a20b>:0
  at ManagerServer.Extensions.HttpHandlerExtensions.GetCurrentUserPermissions (ManagerServer.HttpHandler httpHandler                                                                                                                         ) [0x000b7] in <94a0c97cdbb64311a246c63c3c5d45ff>:0
  at ManagerServer.HttpApplication.ProcessRequest (HttpFramework.HttpRequest request, HttpFramework.HttpResponse res                                                                                                                         ponse) [0x00341] in <94a0c97cdbb64311a246c63c3c5d45ff>:0
  at HttpFramework.HttpServer.Worker () [0x00099] in <80129d04b9b948588b57db825f4266c3>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in <65984520577646ec9044386ec                                                                                                                         4a7b3dd>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threa                                                                                                                         ding.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <65984520577646ec90                                                                                                                         44386ec4a7b3dd>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.Con                                                                                                                         textCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <65984520577646ec9044386ec4                                                                                                                         a7b3dd>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.Con                                                                                                                         textCallback callback, System.Object state) [0x0002b] in <65984520577646ec9044386ec4a7b3dd>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <65984520577646ec9044386ec4a7b3dd>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Sequence contains more than one matching elemen                                                                                                                         t
  at System.Linq.Enumerable.SingleOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Fun                                                                                                                         c`2[T,TResult] predicate) [0x0004a] in <fb28f09769054726b681ecb6df11a20b>:0
  at ManagerServer.Extensions.HttpHandlerExtensions.GetCurrentUserPermissions (ManagerServer.HttpHandler httpHandler                                                                                                                         ) [0x000b7] in <94a0c97cdbb64311a246c63c3c5d45ff>:0
  at ManagerServer.HttpApplication.ProcessRequest (HttpFramework.HttpRequest request, HttpFramework.HttpResponse res                                                                                                                         ponse) [0x00341] in <94a0c97cdbb64311a246c63c3c5d45ff>:0
  at HttpFramework.HttpServer.Worker () [0x00099] in <80129d04b9b948588b57db825f4266c3>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in <65984520577646ec9044386ec                                                                                                                         4a7b3dd>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threa                                                                                                                         ding.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <65984520577646ec90                                                                                                                         44386ec4a7b3dd>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.Con                                                                                                                         textCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <65984520577646ec9044386ec4                                                                                                                         a7b3dd>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.Con                                                                                                                         textCallback callback, System.Object state) [0x0002b] in <65984520577646ec9044386ec4a7b3dd>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <65984520577646ec9044386ec4a7b3dd>:0

https://pastebin.com/JE7SzQs3

The same error on latest version 19.7.24

Alright, this is more helpful. The stack trace you have posted contains enough information for me to work with.

1 Like

Let me know if you need anything else from my side.

Check the latest version (19.7.31). The error should be fixed now.

1 Like

Thank you so much! It seems that in new version no problem found.