[Bug]: Web updater breaks file permissions and causes 500 errors
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 51
- Forks
- 40
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 3
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
I updated my Nextcloud instance using the built-in web updater. After the update completed, the instance returned a 500 Internal Server Error with no useful feedback in the logs.
Upon investigation, I found that:
• nextcloud.log was not being written to
• Apache error logs were unhelpful
• The actual issue was that the file and directory permissions had been changed, and ownership was no longer set to www-data:www-data
Manually running: sudo chown -R www-data:www-data /var/www/nextcloud
sudo find /var/www/nextcloud/ -type d -exec chmod 750 {} ;
sudo find /var/www/nextcloud/ -type f -exec chmod 640 {} ;
Resolved the issue.
This is the second time this has happened. The updater should either:
• Restore correct permissions at the end
• Alert the user that shell access will be required to manually fix this
Please fix or document this more clearly, as this breaks production instances that use the GUI for updates.
Steps to reproduce
- Open Admin
- Run GUI Updater
- Wait for this to happen
Expected behavior
I expected the update to finish and not think about it. It is an update wizard, it kind of should just work.
Nextcloud Server version
30
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.3
Web server
None
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
Start at the Admin GUI Updater entry point and reproduce the update on the reported Debian/Ubuntu and PHP 8.3 setup. Investigate how the updater handles file ownership and permissions after completion. Done means the update preserves usable permissions or clearly alerts users when shell access is required to repair them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- debian, php, ubuntu
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100