BadFunctionCallException: passwordHash is not a valid attribute at lib/public/AppFramework/Db/Entity.php line 136

I’ve encountered Internal Server Error after login on Nextcloud web. And logs shows that “BadFunctionCallException: passwordHash is not a valid attribute at lib/public/AppFramework/Db/Entity.php line 136”

Nextcloud Version: 25.0.4
OS: CentOS Stream 9

Heya.

Try replacing the:

/nextcloud-data-dir/lib/private/Authentication/Token/PublicKeyToken.php

file with the latest one:

https://raw.githubusercontent.com/nextcloud/server/master/lib/private/Authentication/Token/PublicKeyToken.php

That solved my problem.