nextcloud / nextcloud/updater

[Bug]: backup fails during upgrade, copy() function called wrong

Open
#728 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

⚠️ This issue respects the following points: ⚠️
Bug description

I am trying to upgrade via command php updater/updater.phar from 32.0.6 to 32.0.7.
It fails on backup:

 php updater/updater.phar 
Nextcloud Updater - version: v32.0.2-1-g59d8255 dirty

[27-Mar-2026 10:10:29 UTC] PHP Warning:  Trying to access array offset on false in phar:///nextcloud/updater/updater.phar/lib/UpdateCommand.php on line 97
[27-Mar-2026 10:10:29 UTC] PHP Warning:  Trying to access array offset on false in phar:///nextcloud/updater/updater.phar/lib/UpdateCommand.php on line 97
Current version is 32.0.6.

Update to Nextcloud 32.0.7 available. (channel: "stable")
Following file will be downloaded automatically: https://github.com/nextcloud-releases/server/releases/download/v32.0.7/nextcloud-32.0.7.zip
Open changelog ↗

Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done

Start update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[✔] Check for expected files
[✔] Check for write permissions
[ ] Create backup ...[27-Mar-2026 10:10:31 UTC] PHP Warning:  copy(): The second argument to copy() function cannot be a directory in phar:///nextcloud/updater/updater.phar/lib/Updater.php on line 447
[✘] Create backup failed
Could not copy "/nextcloud/3rdparty/nextcloud/lognormalizer/COPYING" to "/nextcloud/data/updater-oc4pb0djdhh0/backups/nextcloud-32.0.6.1-1774606231//3rdparty"

Update failed. To resume or retry just execute the updater again.
Steps to reproduce
  1. have nc version 32.0.6
  2. Try upgrading to version 32.0.7 via php cli
  3. upgrade fails on backup step with error as above
Expected behavior

upgrade finishes

Nextcloud Server version

32

Operating system

Other

PHP engine version

PHP 8.4

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 31 to 32)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

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

Reproduce the failure with php updater/updater.phar while upgrading from 32.0.6 to 32.0.7, then inspect lib/Updater.php around line 447 and lib/UpdateCommand.php around line 97. Confirm the backup step copies the reported 3rdparty content successfully and that the upgrade proceeds past backup.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli, release
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.