nextcloud / nextcloud/updater

Updater instructs to run ./occ upgrade, but occ is not executable on standard installations

Open Beginner friendly
#777 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug low
Dominant language
PHP
Stars
51
Forks
40
Avg merge
2d 19h
Merged PRs (30d)
3

Description

⚠️ This issue respects the following points: ⚠️
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.