Updater instructs to run ./occ upgrade, but occ is not executable on standard installations
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
After updating Nextcloud in Ubuntu, using the CLI updater, the final message is:
Current version is 31.0.14.
Update to Nextcloud 32.0.12.
Should the "occ upgrade" command be executed? [Y/n] y
Please now execute "./occ upgrade" to finish the upgrade.
However, on a standard Linux installation, the suggested command does not work:
./occ upgrade
Result:
-bash: ./occ: Permission denied
The reason is that the occ file is not executable by default, and the recommended way to run OCC commands is through PHP.
The following commands work correctly:
sudo -u www-data php occ upgrade
or
sudo -u www-data php ./occ upgrade
I believe the updater message should be updated to recommend executing php occ upgrade (or mention that the command should be run through PHP), as the current instruction may confuse users and make it appear that the update has failed.
Steps to reproduce
Type: ./occ upgrade
Expected behavior
After the updater finishes, it should display a command that works on a standard Nextcloud installation.
Instead of:
./occ upgrade
it should suggest:
php occ upgrade
or, when applicable:
sudo -u www-data php occ upgrade
This would prevent confusion and ensure that users can complete the upgrade without encountering a "Permission denied" error.
Nextcloud Server version
32
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.4
Web server
Apache (supported)
Database engine version
MySQL
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 in the updater's CLI output path by searching the source for the exact "./occ upgrade" message. Change the displayed command to invoke occ through PHP, then verify the completed updater flow shows the corrected instruction and avoids the permission error described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100