nextcloud-docker-dev icon indicating copy to clipboard operation
nextcloud-docker-dev copied to clipboard

stable24/ stable25: error on settings page with the admin user

Open Apfelwurm opened this issue 3 years ago • 4 comments

If i try to access the settings (http://stable24.local/index.php/settings/user) with the admin user on a fresh stable24 instance, i get the following error:

Internal Server Error
The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Technical details
Remote Address: 192.168.21.3
Request ID: PapRFdtJSUTZU7KrkTAo
Type: Exception
Code: 1
Message: assert(class_exists(LoadViewer::class)) in file '/var/www/html/apps/settings/lib/Settings/Personal/ServerDevNotice.php' line 82
File: /var/www/html/lib/private/AppFramework/Http/Dispatcher.php
Line: 165

Trace
#0 /var/www/html/lib/private/AppFramework/App.php(172): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Settings\Controller\PersonalSettingsController), 'index')
#1 /var/www/html/lib/private/Route/Router.php(298): OC\AppFramework\App::main('OCA\\Settings\\Co...', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#2 /var/www/html/lib/base.php(1030): OC\Route\Router->match('/settings/user')
#3 /var/www/html/index.php(36): OC::handleRequest()
#4 {main}

Previous
#0 /var/www/html/apps/settings/lib/Settings/Personal/ServerDevNotice.php(82): assert(false, 'assert(class_ex...')
#1 /var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php(129): OCA\Settings\Settings\Personal\ServerDevNotice->getForm()
#2 /var/www/html/apps/settings/lib/Controller/PersonalSettingsController.php(73): OCA\Settings\Controller\PersonalSettingsController->formatSettings(Array)
#3 /var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php(140): OCA\Settings\Controller\PersonalSettingsController->getSettings('personal-info')
#4 /var/www/html/apps/settings/lib/Controller/PersonalSettingsController.php(64): OCA\Settings\Controller\PersonalSettingsController->getIndexResponse('personal', 'personal-info')
#5 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(225): OCA\Settings\Controller\PersonalSettingsController->index('personal-info')
#6 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(133): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Settings\Controller\PersonalSettingsController), 'index')
#7 /var/www/html/lib/private/AppFramework/App.php(172): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Settings\Controller\PersonalSettingsController), 'index')
#8 /var/www/html/lib/private/Route/Router.php(298): OC\AppFramework\App::main('OCA\\Settings\\Co...', 'index', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
#9 /var/www/html/lib/base.php(1030): OC\Route\Router->match('/settings/user')
#10 /var/www/html/index.php(36): OC::handleRequest()
#11 {main}

The Container log entry:

stable24_1           | {"reqId":"PapRFdtJSUTZU7KrkTAo","level":3,"time":"2022-10-18T14:32:01+00:00","remoteAddr":"192.168.21.3","user":"admin","app":"index","method":"GET","url":"/index.php/settings/user","message":"assert(class_exists(LoadViewer::class)) in file '/var/www/html/apps/settings/lib/Settings/Personal/ServerDevNotice.php' line 82","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36","version":"24.0.6.1","exception":{"Exception":"Exception","Message":"assert(class_exists(LoadViewer::class)) in file '/var/www/html/apps/settings/lib/Settings/Personal/ServerDevNotice.php' line 82","Code":1,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\PersonalSettingsController"},"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\PersonalSettingsController","index",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},["personal-info","settings.PersonalSettings.index"]]},{"file":"/var/www/html/lib/base.php","line":1030,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/user"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":165,"Previous":{"Exception":"AssertionError","Message":"assert(class_exists(LoadViewer::class))","Code":1,"Trace":[{"file":"/var/www/html/apps/settings/lib/Settings/Personal/ServerDevNotice.php","line":82,"function":"assert","args":[false,"assert(class_exists(LoadViewer::class))"]},{"file":"/var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php","line":129,"function":"getForm","class":"OCA\\Settings\\Settings\\Personal\\ServerDevNotice","type":"->","args":[]},{"file":"/var/www/html/apps/settings/lib/Controller/PersonalSettingsController.php","line":73,"function":"formatSettings","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":[[[{"__class__":"OCA\\Settings\\Settings\\Personal\\PersonalInfo"}],[{"__class__":"OCA\\Settings\\Settings\\Personal\\ServerDevNotice"}]]]},{"file":"/var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php","line":140,"function":"getSettings","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal-info"]},{"file":"/var/www/html/apps/settings/lib/Controller/PersonalSettingsController.php","line":64,"function":"getIndexResponse","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal","personal-info"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"index","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal-info"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\PersonalSettingsController"},"index"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\PersonalSettingsController"},"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\PersonalSettingsController","index",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},["personal-info","settings.PersonalSettings.index"]]},{"file":"/var/www/html/lib/base.php","line":1030,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/user"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/apps/settings/lib/Settings/Personal/ServerDevNotice.php","Line":82},"CustomMessage":"--"}}

i have used the following commands to run the instance:

mkdir -p $HOME/temp_nextcloud
git clone https://github.com/juliushaertl/nextcloud-docker-dev $HOME/temp_nextcloud/nextcloud-docker-dev
cd $HOME/temp_nextcloud/nextcloud-docker-dev
./bootstrap.sh
cd $HOME/temp_nextcloud/nextcloud-docker-dev/workspace/server/
git fetch --unshallow
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin
git worktree add ../stable24 stable24
cd ../stable24
git submodule update --init
cd $HOME/temp_nextcloud/nextcloud-docker-dev
docker-compose up -d stable24 proxy database-mysql

Apfelwurm avatar Oct 18 '22 14:10 Apfelwurm

It seems you are missing the viewer app in the stable checkouts. A quick way to solve this is adding a work tree for them ass well:

cd $HOME/temp_nextcloud/nextcloud-docker-dev/workspace/server/apps/viewer
git worktree add ../../../stable25/apps/viewer stable25
git worktree add ../../../stable24/apps/viewer stable24

But we should indeed document this.

juliusknorr avatar Oct 18 '22 16:10 juliusknorr

ahh okay, makes sense.

i also get the following output when starting the container initially:

stable24_1           |    Could not download app "viewer
stable24_1           |    Could not download app profiler"

so i guess it should be installed automatically on the startup coming from NEXTCLOUD_AUTOINSTALL_APPS, but that seems to be broken.

You're suggested fix seems to work, but the viewer app seems to be located in the apps-extra folder, so for everyone looking in here and for the docs:

cd $HOME/temp_nextcloud/nextcloud-docker-dev/workspace/server/apps-extra/viewer
git worktree add ../../../stable25/apps/viewer stable25
git worktree add ../../../stable24/apps/viewer stable24

Thank you again :)

Apfelwurm avatar Oct 21 '22 12:10 Apfelwurm

so i guess it should be installed automatically on the startup coming from NEXTCLOUD_AUTOINSTALL_APPS, but that seems to be broken.

That only works for apps from the App Store or apps that are already cloned.

juliusknorr avatar Oct 21 '22 13:10 juliusknorr

ohh, it isn't in the appstore, nvm :D

Apfelwurm avatar Oct 21 '22 13:10 Apfelwurm

I've added a note to the readme for this https://github.com/juliushaertl/nextcloud-docker-dev/blob/master/README.md#4-running-different-stable-versions

juliusknorr avatar Nov 28 '22 07:11 juliusknorr