Picture of tsn
Registered 4 years 358 days
tsn Wednesday, 14 October 2020, 01:23 PM
Several app instances and AP Manager
Hi guys,

I've faced with some strange behavior of AP Manager.
When I have two App instances and want to stop one of them I can see that both are stopped. However, this happens only in one of our environment and does not happen in another. Could you please clarify what may cause this behavior? Any logs I can check to better understand what is caused second instance to stop?

Best regards,
Sergey
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Wednesday, 14 October 2020, 01:36 PM
Re: Several app instances and AP Manager
Hi Sergey,

the AP Manager has an internal logic to kill the App Service completely, if one instance refuses to stop gracefully within 10 seconds.

You should verify, that your App instance calls appService->AppStopped(this) after closing all internal sessions and tasks.

You can also enable the "App" log flag of the AP Manager and investigate the logfiles of the AP Manager.

Greetings,
Daniel


Picture of tsn
Registered 4 years 358 days
tsn Wednesday, 14 October 2020, 02:24 PM
Re: Several app instances and AP Manager
Hi Daniel,

Thank you for quick reply.
In the logs I can see the following:

{
"mt": "InstanceAdded",
"appServiceID": "MyApp",
"appName": "MyApp",
"appDomain": "MyDomain1",
"webserver": "/var/run/webserver/webserver",
"webserverPath": "/MyDomain1/MyApp",
"dbHost": "",
"dbName": "username",
"dbUser": "password",
"tempFilePath": "/apps/MyApp/MyDomain1_MyApp.temp",
"workingPath": "/apps/MyApp/",
"appInitialStatus": true,
"appStatus": true,
"excludeFromBackup": false,
"logFlags": 0,
"databaseSize": 8278687,
"backupTime": 0,
"backupIndex": 0,
"appError": false
}

{
"mt": "InstanceAdded",
"appServiceID": "MyApp",
"appName": "MyApp",
"appDomain": "MyDomain2",
"webserver": "/var/run/webserver/webserver",
"webserverPath": "/MyDomain2/MyApp",
"dbHost": "",
"dbName": "username",
"dbUser": "password",
"tempFilePath": "/apps/MyApp/MyDomain2_MyApp.temp",
"workingPath": "/apps/MyApp/",
"appInitialStatus": true,
"appStatus": true,
"excludeFromBackup": false,
"logFlags": 0,
"databaseSize": 8278687,
"backupTime": 0,
"backupIndex": 0,
"appError": false
}

Then when I try to stop the second instance:

{
"mt": "StopInstance",
"appServiceID": "MyApp",
"appName": "MyApp",
"appDomain": "MyDomain2"
}

I receive the following error:

10-14 10:35:55.017 App::AppAvailable() taskStart 00000000 taskStop 01fec670 taskEdit 00000000 taskAdd 00000000 taskRemove 00000000
10-14 10:35:55.017 ManagerSession(01fd2750)::SendResult rcv:1 mt:StopInstanceResult error:errorInstanceNotAvailable srcsadnull) param1sadnull)
10-14 10:35:55.018 AppWebsocket(01fd2750)::AppWebsocketMessageSend {"error":"errorInstanceNotAvailable","mt":"StopInstanceResult"} connected:true

And after this both instances restarted.
I've checked that settings are fine and both apps instances successfully run, but stop doesn't work as expected.
Any ideas?
Picture of tsn
Registered 4 years 358 days
tsn Tuesday, 24 November 2020, 01:35 PM
Re: Several app instances and AP Manager
Hi guys, Any update on this?
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Tuesday, 24 November 2020, 01:41 PM
Re: Several app instances and AP Manager
Do you have a complete trace from the AP Manager, from adding the instance until the issue with the stop with the App log flag enabled inside the AP Manager?

Greetings,
Daniel
Picture of tsn
Registered 4 years 358 days
tsn Tuesday, 24 November 2020, 03:13 PM
Re: Several app instances and AP Manager
Hi Daniel,

Thank you for quick reply. I've check AP Manager logs and found one issue I want to check. Let me investigate it first and return to you with more details little bit later.

Best regards,
Sergey
Picture of tsn
Registered 4 years 358 days
tsn Tuesday, 1 December 2020, 11:39 AM
Re: Several app instances and AP Manager
Hi Daniel,

I've checked and it seems that issue wasn't caused this one.
Now when I try to stop App Service with these two App instances I receive a core dump for AP Manager. In the AP Manager logs I can see the following:

```
12-01 10:23:39.180 AppWebsocket(00a55c10)::AppWebsocketRecvResult {"mt":"StopService","appServiceID":"service_name"}
12-01 10:23:39.180 TaskStopService(00a58440)::TaskStopService
12-01 10:23:39.180 TaskStopService(00a58440)::Start stopping service service_name ...
12-01 10:23:40.626 Core dumped due to a crash (current app build 132628). Take a look at the core dump backtrace files!
```
Please find core dump and stacktrace attached.

Please let me know if you need anything else.

Best regards,
Sergey
manager-x86_64-core-20201201-102400.dump.zip
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Tuesday, 1 December 2020, 12:02 PM
Re: Several app instances and AP Manager
Hi Sergey,

we already discovered this bug on our side and it should be fixed with the upcoming SR21 release.

Greetings,
Daniel
Picture of tsn
Registered 4 years 358 days
tsn Tuesday, 1 December 2020, 12:07 PM
Re: Several app instances and AP Manager
Hi Daniel,

Great, thanks for the confirmation.
Could you please clarify when to expect SR21?

Best regards,
Sergey
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Tuesday, 1 December 2020, 01:03 PM
Re: Several app instances and AP Manager
We try to release on the second monday of a month, but this is not fixed, as our internal test process must succeed first.

This specific fix is also not yet totally assured for SR21, as I found out now ...

Greetings,
Daniel
Picture of tsn
Registered 4 years 358 days
tsn Tuesday, 1 December 2020, 04:09 PM
Re: Several app instances and AP Manager
Oh, ok, thank you for this update.
Will look forward to see when this will be available.
Please let me know the issue ID to track it accordingly.

Best regards,
Sergey
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Thursday, 3 December 2020, 10:06 AM
Re: Several app instances and AP Manager
Hi Sergey,

this fix solves this specific trap:
#101696 - AP Manager: prevent occasional trap if statistics are collected while manager is closing

It will be included in SR21.

Greetings,
Daniel
Picture of tsn
Registered 4 years 358 days
tsn Thursday, 3 December 2020, 10:21 AM
Re: Several app instances and AP Manager
Hi Daniel,

Thank you for the update. Will look forward for SR21.

Best regards,
Sergey

← You can define your color theme preference here