So my nextcloud server was working fine up until I switched domain names. I changed the domain on /etc/hosts, did changes for the other services I run like AdGuardHome and Jellyfin, also generated new certificates for the new domain and everything works fine on the web side but nextcloud started acting strange.
I am not able to log in and as soon as it logs in I get the Internal Server Error screen. Upon changing the debug from false to true in the config.php, I see the following output:
Technical details
- Remote Address: 192.168.1.6
- Request ID: 2JDYSXfB6WH9tiEmOQHp
- Type: RuntimeException
- Code: 0
- Message: OpenSSL reported a problem
- File: /var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php
- Line: 462
Trace
#0 /var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php(106): OC\Authentication\Token\PublicKeyTokenProvider->newToken()
#1 /var/www/nextcloud/lib/private/Authentication/Token/Manager.php(53): OC\Authentication\Token\PublicKeyTokenProvider->generateToken()
#2 /var/www/nextcloud/lib/private/User/Session.php(650): OC\Authentication\Token\Manager->generateToken()
#3 /var/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php(45): OC\User\Session->OC\User\{closure}()
#4 /var/www/nextcloud/lib/private/User/Session.php(648): OC\User\Session->atomic()
#5 /var/www/nextcloud/lib/private/Authentication/Login/CreateSessionTokenCommand.php(48): OC\User\Session->createSessionToken()
#6 /var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php(22): OC\Authentication\Login\CreateSessionTokenCommand->process()
#7 /var/www/nextcloud/lib/private/Authentication/Login/CompleteLoginCommand.php(30): OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()
#8 /var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php(22): OC\Authentication\Login\CompleteLoginCommand->process()
#9 /var/www/nextcloud/lib/private/Authentication/Login/LoggedInCheckCommand.php(41): OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()
#10 /var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php(22): OC\Authentication\Login\LoggedInCheckCommand->process()
#11 /var/www/nextcloud/lib/private/Authentication/Login/EmailLoginCommand.php(51): OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()
#12 /var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php(22): OC\Authentication\Login\EmailLoginCommand->process()
#13 /var/www/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php(36): OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()
#14 /var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php(22): OC\Authentication\Login\UidLoginCommand->process()
#15 /var/www/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php(39): OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()
#16 /var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php(22): OC\Authentication\Login\UserDisabledCheckCommand->process()
#17 /var/www/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php(34): OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()
#18 /var/www/nextcloud/lib/private/Authentication/Login/Chain.php(90): OC\Authentication\Login\PreLoginHookCommand->process()
#19 /var/www/nextcloud/core/Controller/LoginController.php(326): OC\Authentication\Login\Chain->process()
#20 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(208): OC\Core\Controller\LoginController->tryLogin()
#21 /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(114): OC\AppFramework\Http\Dispatcher->executeController()
#22 /var/www/nextcloud/lib/private/AppFramework/App.php(161): OC\AppFramework\Http\Dispatcher->dispatch()
#23 /var/www/nextcloud/lib/private/Route/Router.php(302): OC\AppFramework\App::main()
#24 /var/www/nextcloud/lib/base.php(1003): OC\Route\Router->match()
#25 /var/www/nextcloud/index.php(24): OC::handleRequest()
#26 {main}
I didn’t want to do it but after scouring the web for days and doing lots of debugging with ChatGPT, I even tried reinstalling PHP and Nextcloud again but the issue still persists.
This is where it gets interesting, I believe while in the process of changing domain and creating the SSL certificates using letsencrypt, I might have accidentally removed /etc/ssl folder. I found out that it had keys and such which caused other problems like not being able to download updates or install repositories since my Debian Server couldn’t verify as it didn’t have the certificates.
I was able to restore (I hope everything) since everything else is working fine but I still believe that since the problem with nextcloud is related to OpenSSL not being able to generate Certs, it may be linked to that problem.
I don’t want to set my server again cause is a pain in the butt to get everything back to how it was. So many services, scripts, settings all need to be reconfigured. I’ve already lost my configuration on nextcloud. I had made a backup of /nextcloud/core folder, I wanted to do the full folder but it didn’t allow me to copy it, I didn’t look into it much but do tell me if anything usefull can be used from the core folder I made backup of. I was using custom backgrounds and favicon, symbols.
Nextcloud Server version:
- 30.0.4
Operating system and version: - Debian 12
- Web server and version:
- Apache/2.4.62
PHP version: - 8.3
Is this the first time you’ve seen this error?: - Yes
When did this problem seem to first start? - When I changed the domain name