[Solved] Admin-UI 500 error with latest stable only in APP_ENV prod - not in dev

Hi,

I updated my home gear version from 0.7.35 to 0.7.47-3316. After starting the container, I get a 500 error.
Weirdly, I tried to enable the dev environment by changing “APP_ENV=prod” to “APP_ENV=dev” in the .env-file to get a stack trace, but now the UI works.
Changing back to “prod” provides the 500 error…
To keep my configuration, I did use the same directories and its contents from the previous version:

  • /var/log/homegear
  • /var/lib/homegear
  • /etc/homegear

In general all is working fine, except the admin-ui in prod

System:
QNAP TS-653B NAS, running docker.

homegear-management.err:
10/08/20 18:44:43.598 Could not connect to socket. Error: Connection refused

homegear.log:

10/08/20 18:44:41.335 Starting Homegear Management...
10/08/20 18:44:41.336 Info: Setting allowed core file size to "18446744073709551615" for user with id 0 and group with id 0.
10/08/20 18:44:41.336 Info: Core file size now is "18446744073709551615".
10/08/20 18:44:41.597 Startup complete.
10/08/20 18:44:43.598 Could not connect to socket. Error: Connection refused
10/08/20 18:44:45.606 Info: Homegears process ID is: 7766
10/08/20 18:44:45.606 Info: RPC methods successfully registered.
10/08/20 18:44:45.606 Info: Starting lifetick thread...

homegear-scriptengine.err:

10/08/20 18:44:46.576 Script engine (/var/lib/homegear/www/rpc/admin/index.php): PHP Fatal error:  Trait 'Symfony\Component\Routing\Matcher\Dumper\PhpMatcherTrait' not found in /var/lib/homegear/tmp/admin-ui/cache/prod/srcApp_KernelProdContainerUrlMatcher.php on line 10
2020-10-08T18:44:46+02:00 [critical] Fatal Error: Trait 'Symfony\Component\Routing\Matcher\Dumper\PhpMatcherTrait' not found
2020-10-08T18:44:46+02:00 [critical] Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\ClassNotFoundError: "Attempted to load trait "PhpMatcherTrait" from namespace "Symfony\Component\Routing\Matcher\Dumper".
Did you forget a "use" statement for another namespace?" at /var/lib/homegear/tmp/admin-ui/cache/prod/srcApp_KernelProdContainerUrlMatcher.php line 10

homegear-scriptengine.log:

10/08/20 18:44:46.576 Script engine (/var/lib/homegear/www/rpc/admin/index.php): PHP Fatal error:  Trait 'Symfony\Component\Routing\Matcher\Dumper\PhpMatcherTrait' not found in /var/lib/homegear/tmp/admin-ui/cache/prod/srcApp_KernelProdContainerUrlMatcher.php on line 10
10/08/20 18:44:46.747 Info: Script 1 exited with code 255.

homegear-webssh.err:

10/08/20 18:44:41.343 Warning: Can't invoke method ptyOutput as there is no open IPC connection.
10/08/20 18:44:41.343 Error: Could not call ptyOutput: Unknown application error.
10/08/20 18:44:41.444 Warning: Can't invoke method ptyOutput as there is no open IPC connection.
10/08/20 18:44:41.444 Error: Could not call ptyOutput: Unknown application error.
10/08/20 18:44:43.343 Could not connect to socket. Error: Connection refused

homegear-webssh.log:

10/08/20 18:44:41.338 Starting Homegear WebSSH...
10/08/20 18:44:41.338 Info: Setting allowed core file size to "18446744073709551615" for user with id 0 and group with id 0.
10/08/20 18:44:41.338 Info: Core file size now is "18446744073709551615".
10/08/20 18:44:41.338 Info: Dropping privileges to user homegear (102) and group homegear (102)
10/08/20 18:44:41.339 Info: Homegear WebSSH is (now) running as user with id 102 and group with id 102.
10/08/20 18:44:41.339 Info: Slave device is: /dev/pts/1
10/08/20 18:44:41.342 Startup complete.
10/08/20 18:44:41.343 Warning: Can't invoke method ptyOutput as there is no open IPC connection.
10/08/20 18:44:41.343 Error: Could not call ptyOutput: Unknown application error.
10/08/20 18:44:41.444 Warning: Can't invoke method ptyOutput as there is no open IPC connection.
10/08/20 18:44:41.444 Error: Could not call ptyOutput: Unknown application error.
10/08/20 18:44:43.343 Could not connect to socket. Error: Connection refused
10/08/20 18:44:45.345 Info: RPC methods successfully registered.

Any idea, what I can do?

regards,

André

P.S: I got confused with the version numbers as I pulled from docker hub, what was released as “home gear/homegear”… Not sure if I now got the correct version…

Paging @Micha

Hey @bigcookie,

looks strange. Unfortunately it’s really hard to debug without a full trace :confused:
Could you please try the following: keep “APP_ENV=prod” in the .env-file and set the UI-environment to debug with the following commands:

homegear -e rc ‘$hg->setData(“webEnv”,“env”,“prod”);’
homegear -e rc ‘$hg->setData(“webEnv”,“debug”,“1”);’

After that, clear the cache (rm -rf /var/lib/homegear/tmp/admin-ui/cache/*) and try to load the UI again.

– Micha

Thanks - looks all weird to me. Anyway, let’s try to fix it, or I will setup everything newly.

I tried to execute the commands as proposed. QNAP provides a shell access via browser. I will also try directly in the terminal later. But first command failed.

Terminal works… not sure, what the issue is/was… Forget the above…

Summary, after finally being able to execute the commands:
The UI loads fine without problems!
Thanks for your fast help! Next I will try emptying the cache prior

Shall I still provide log files? If not, it would be great, if you can share the default log level, so I will switch back to it :slight_smile:

Hey @bigcookie,

a screenshot of a trace (if available) would be enough for me. I don’t know the default loglevel of stable, 2 should be quiet :wink:

– Micha

Thanks - as stated. After deleting the cache, all is working fine and no trace is shown in the UI (as it works). Are you referring to information in the log?