Internal Server Error (500) on first login attempt

Hi everyone,

I’m facing a strange issue with my Nextcloud server.
When I try to authenticate (login) using the desktop client or access the web file panel, I get an “Internal Server Error” (500).

However, if I refresh the page after the error, the system asks again for username and password — and this time the login works normally.

This behavior happens consistently: the first login always fails with an internal error, and the second attempt (after refresh) succeeds.

Has anyone experienced something similar? What could cause this error only on the first authentication attempt?

Thanks in advance! :folded_hands:

Yes, that’s usually caused by a caching or session handling issue. It could be related to Redis, PHP session storage, or your reverse proxy setup. Check your Nextcloud and webserver logs right after the first failed login — you’ll likely see a PHP or Redis connection error there. Also make sure your config.php has the correct Redis socket/host and that php-redis and redis-server are running properly.

Thanks, I’ll perform the checks and configuration changes, if it’s successful, I’ll let you know!