Passwords App causes Internal Server Error

I’m running Nextcloud 18 on Apache2.
After installing the Passwords App, I get an Internal Server Error when I try to open the Settings page or click on the Passwords tab.

I get one small and one massive error in nextcloud.log:
{“reqId”:“T5DH5QRwiipbq9eKxxev”,“level”:2,“time”:“2020-04-09T20:41:02+00:00”,“remoteAddr”:“192.168.9.1”,“user”:“eule”,“app”:“passwords”,“method”:“GET”,“url”:"/index.php/settings/user",“message”:“Login attempt with invalid session for eule”,“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0”,“version”:“18.0.3.0”}

{“reqId”:“T5DH5QRwiipbq9eKxxev”,“level”:3,“time”:“2020-04-09T20:41:02+00:00”,“remoteAddr”:“192.168.9.1”,“user”:“eule”,“app”:“index”,“method”:“GET”,“url”:"/index.php/settings/user",“message”:{“Exception”:“Exception”,“Message”:“Unable to verify user eule”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/apps/passwords/lib/Services/EnvironmentService.php",“line”:300,“function”:“loadUserInformation”,“class”:“OCA\Passwords\Services\EnvironmentService”,“type”:"->",“args”:[“eule”,{“class”:“OC\AppFramework\Http\Request”}]},{“file”:"/var/www/nextcloud/apps/passwords/lib/Services/EnvironmentService.php",“line”:160,“function”:“determineAppMode”,“class”:“OCA\Passwords\Services\EnvironmentService”,“type”:"->",“args”:[“eule”,{“class”:“OC\AppFramework\Http\Request”}]},{“function”:"__construct",“class”:“OCA\Passwords\Services\EnvironmentService”,“type”:"->",“args”:[“eule”,{“class”:“OC\AllConfig”},{“class”:“OC\AppFramework\Http\Request”},{“class”:“OC\Session\CryptoSessionData”},{“class”:“OCA\Passwords\Services\LoggingService”},{“class”:“OC\Authentication\Token\Manager”},{“class”:“OC\User\Manager”}]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:83,“function”:“newInstanceArgs”,“class”:“ReflectionClass”,“type”:"->",“args”:[[“eule”,{“class”:“OC\AllConfig”},{“class”:“OC\AppFramework\Http\Request”},{“class”:“OC\Session\CryptoSessionData”},{“class”:“OCA\Passwords\Services\LoggingService”},{“class”:“OC\Authentication\Token\Manager”},{“class”:“OC\User\Manager”}]]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:100,“function”:“buildClass”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[{“name”:“OCA\Passwords\Services\EnvironmentService”,“class”:“ReflectionClass”}]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:115,“function”:“resolve”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCA\Passwords\Services\EnvironmentService”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",“line”:415,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCA\Passwords\Services\EnvironmentService”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",“line”:386,“function”:“queryNoFallback”,“class”:“OC\AppFramework\DependencyInjection\DIContainer”,“type”:"->",“args”:[“OCA\Passwords\Services\EnvironmentService”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:70,“function”:“query”,“class”:“OC\AppFramework\DependencyInjection\DIContainer”,“type”:"->",“args”:[“OCA\Passwords\Services\EnvironmentService”,true]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:100,“function”:“buildClass”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[{“name”:“OCA\Passwords\Services\ConfigurationService”,“class”:“ReflectionClass”}]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:115,“function”:“resolve”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCA\Passwords\Services\ConfigurationService”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",“line”:415,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCA\Passwords\Services\ConfigurationService”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",“line”:386,“function”:“queryNoFallback”,“class”:“OC\AppFramework\DependencyInjection\DIContainer”,“type”:"->",“args”:[“OCA\Passwords\Services\ConfigurationService”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:70,“function”:“query”,“class”:“OC\AppFramework\DependencyInjection\DIContainer”,“type”:"->",“args”:[“OCA\Passwords\Services\ConfigurationService”,true]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:100,“function”:“buildClass”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[{“name”:“OCA\Passwords\Settings\AdminSettings”,“class”:“ReflectionClass”}]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:115,“function”:“resolve”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCA\Passwords\Settings\AdminSettings”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php",“line”:415,“function”:“query”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[“OCA\Passwords\Settings\AdminSettings”]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:134,“function”:“queryNoFallback”,“class”:“OC\AppFramework\DependencyInjection\DIContainer”,“type”:"->",“args”:[“OCA\Passwords\Settings\AdminSettings”]},{“file”:"/var/www/nextcloud/lib/private/Settings/Manager.php",“line”:178,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”:[“OCA\Passwords\Settings\AdminSettings”]},{“file”:"/var/www/nextcloud/lib/private/Settings/Manager.php",“line”:331,“function”:“getSettings”,“class”:“OC\Settings\Manager”,“type”:"->",“args”:[“admin”,“overview”]},{“file”:"/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",“line”:91,“function”:“getAdminSettings”,“class”:“OC\Settings\Manager”,“type”:"->",“args”:[“overview”,false]},{“file”:"/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",“line”:127,“function”:“formatSections”,“class”:“OCA\Settings\Controller\PersonalSettingsController”,“type”:"->",“args”:[{“0”:[{“class”:“OC\Settings\Section”}],“1”:[{“class”:“OC\Settings\Section”},{“class”:“OCA\Support\Settings\Section”}],“5”:[{“class”:“OC\Settings\Section”}],“10”:[{“class”:“OC\Settings\Section”}],“30”:[{“class”:“OCA\Theming\Settings\Section”}],“50”:[{“class”:“OC\Settings\Section”},{“class”:“OCA\Onlyoffice\AdminSection”},{“class”:“OCA\Passwords\Settings\AdminSection”}],“55”:[{“class”:“OCA\Activity\Settings\AdminSection”},{“class”:“OCA\WorkflowEngine\Settings\Section”}],“80”:[{“class”:“OCA\Survey_Client\Settings\AdminSection”}],“90”:[{“class”:“OCA\LogReader\Settings\Section”},{“class”:“OCA\ServerInfo\Settings\AdminSection”}],“98”:[{“class”:“OC\Settings\Section”}]},“personal-info”,“admin”,“personal”,false]},{“file”:"/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",“line”:76,“function”:“formatAdminSections”,“class”:“OCA\Settings\Controller\PersonalSettingsController”,“type”:"->",“args”:[“personal”,“personal-info”,false]},{“file”:"/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php",“line”:151,“function”:“getNavigationParameters”,“class”:“OCA\Settings\Controller\PersonalSettingsController”,“type”:"->",“args”:[“personal”,“personal-info”]},{“file”:"/var/www/nextcloud/apps/settings/lib/Controller/PersonalSettingsController.php",“line”:67,“function”:“getIndexResponse”,“class”:“OCA\Settings\Controller\PersonalSettingsController”,“type”:"->",“args”:[“personal”,“personal-info”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:170,“function”:“index”,“class”:“OCA\Settings\Controller\PersonalSettingsController”,“type”:"->",“args”:[“personal-info”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:99,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->",“args”:[{“class”:“OCA\Settings\Controller\PersonalSettingsController”},“index”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/App.php",“line”:125,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->",“args”:[{“class”:“OCA\Settings\Controller\PersonalSettingsController”},“index”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php",“line”:47,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::",“args”:[“OCA\Settings\Controller\PersonalSettingsController”,“index”,{“class”:“OC\AppFramework\DependencyInjection\DIContainer”},{“section”:“personal-info”,"_route":“settings.PersonalSettings.index”}]},{“function”:"__invoke",“class”:“OC\AppFramework\Routing\RouteActionHandler”,“type”:"->",“args”:[{“section”:“personal-info”,"_route":“settings.PersonalSettings.index”}]},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:299,“function”:“call_user_func”,“args”:[{“class”:“OC\AppFramework\Routing\RouteActionHandler”},{“section”:“personal-info”,"_route":“settings.PersonalSettings.index”}]},{“file”:"/var/www/nextcloud/lib/base.php",“line”:1008,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->",“args”:["/settings/user"]},{“file”:"/var/www/nextcloud/index.php",“line”:38,“function”:“handleRequest”,“class”:“OC”,“type”:"::",“args”:[]}],“File”:"/var/www/nextcloud/apps/passwords/lib/Services/EnvironmentService.php",“Line”:338,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0”,“version”:“18.0.3.0”}

Anybody got an idea how to fix this?
Thanks in advance!

Are you using the latest version of the app? (2020.4.0)

Yup. Maybe something wrong with my SSL certificates or something? They are behaving kinda weird sometimes.

Edit: It seems to behave correctly now. Very weird.

I’ve had odd quirks, too. I found that the only time everything worked as it should was when I used specific browsers, either Firefox or Waterfox. If I used Pale Moon, Vivaldi, or Edge, various apps would sometimes misbehave.

For example, the Apps app would hang with a spinning circle, or the Contacts app would display, but it wouldn’t let me view any contacts other than the first one displayed.

If you get the issue again, try using a different browser. This shouldn’t be an issue in 2020, the browser wars should have ended 20 years ago, but here we are again.

I’m experiencing something similar still here in 2021
Different browsers didn’t seem to make a difference and mine never started working again on its own, the only way I was able to gain access back into the server settings was by running

sudo nextcloud.occ app:disable passwords

from the command line
Hopefully readding the passwords app will make things work properly

Do you have PHP 7.3 installed?

I have the nextcloud snap app, I’m not sure how to check what version of PHP it’s running. PHP isn’t installed outside of the snap package. Snap says the version of the snap I have installed is 20.0.4snap1 (25284).

Also, in case anyone hit this issue, I was able to disable passwords with the command I mentioned earlier, then remove and reinstall from the Nextcloud web GUI. So far everything is working as expected again and I didn’t lose any data I had saved in the passwords app.

EDIT: Nevermind, it broke again, Readding the app is a very temporary solution

You can check for the php version in the system section in the nextcloud admin settings. But with the nextcloud snap it’s most likely PHP 7.4.

Can you check your nextcloud log (also in the admin settings) for any errors from the passwords app?

Yep I am on PHP 7.4.13
The only logs I’m getting from the password app itself are warnings stating “Login attempt with invalid attempt for agentflippy5”

Each one is accompanied by an error from the app “index” stating “Exception: Unable to verify user agentflippy5”

I thought it might have something to do with me singing in with my security key, so I signed out and in a few different ways and it’s working now. On a second computer that was giving the same error I tried signing out and back in (using my key) and it also worked. Apparently, that error is just wanting me to sign in again.

Might be worth mentioning that the password app on my phone has never stopped working

It seems like a weird error to me but as long as I know all I have to do to get around it is sign out and back in, that’s alright with me. Thank you @mdw!

Are you sure about this? it should usually say one of “invalid session”, “invalid authorization header”, “invalid basic auth” or “invalid session token”.

Do you mean you log in with just a hardware device like a yubikey?

Yes sorry, “Login attempt with invalid session for agentflippy5”

And also yes, I usually sign in with a yubikey, bypassing the need to enter my password
I also have TOTP 2FA enabled

Ah. I have never tested that. It’s likely that the app sees this as a token login, but the token is missing from the session.

I have that problem with passwords installed and enabled. The only solution I’ve come up with is to log out and back in.