Login hangs or times out when configured Local external storage is unavailable
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
When logging in with a user that has configured external storage that is not accessible (in my case an NFS-share), login in the web interface hangs until eventually timing out with HTTP error 504, and the Android app is stuck on refreshing the folder structure.
I can find a similar issue from 2020: https://help.nextcloud.com/t/bad-gateway-connection-refused-while-connecting-to-upstream-via-reverse-proxy-nginx-le-companion/111529
I think this must be a bug, because a network share will sometimes be unavailable, and the server must be able to tolerate that.
My setup is:
- selfhosted on a vps behind reverse proxy (nginx) on the same machine
- the official nextcloud snap (currently version 31.0.2snap2)
- available at my own public domain
- some storage is local to the VPS,
- some storage is NFS via a Wireguard tunnel to an almost always on fileserver behind a CGNAT
After a restart of the VPS, I could not get past the login screen using either my main user or the admin user.
VPS was up and running, log entries for the nextcloud_proxy showed "Connection refused while connecting upstream" after pressing the login button. The landing page itself loaded as usual.
After reading the issue linked above, I realised the Wireguard tunnel to my fileserver was down and therefore the NFS share unavailable. Immediately after activating the Wireguard interface, the NFS share with the external storage volume became available and login could succeed as expected.
So in short: a non-automated VPN setup revealed that Nextcloud does (still/again) not tolerate unavailable external storage.
Steps to reproduce
- Add external storage (via NFS)
- Make NFS share unavailable to Nextcloud server)
- Try to login
Expected behavior
I can login, but the external storage will be unavailable.
Nextcloud Server version
31
Operating system
Debian/Ubuntu
PHP engine version
None
Web server
Apache (supported)
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by configuring NFS external storage, making the share unavailable, and attempting web or Android login. Start by tracing the login request and external-storage access, then verify that login completes while the unavailable storage remains inaccessible. Done means no 504 timeout or stuck folder refresh when the share is down.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- apache, nginx, php
- Domain
- authentication, backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100