nextcloud / updater

:arrows_counterclockwise: The updater app to keep your Nextcloud up-to-date
GNU Affero General Public License v3.0
45 stars 33 forks source link

[Bug]: Updater backups don't support symlinks #484

Open jplitza opened 1 year ago

jplitza commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

When running the updater, it backups symlinked files multiple times.

Steps to reproduce

  1. Install the "recognize" app
  2. Download the models and everything to make it ready to run
  3. Update Nextcloud
  4. The updater creates a backup, which contains three copies of the 400 MB file apps/recognize/node_modules/@tensorflow/tfjs-node-gpu/deps/lib/libtensorflow.so.2.9.1 in its symlinks apps/recognize/node_modules/@tensorflow/tfjs-node-gpu/deps/lib/libtensorflow.so.2 and apps/recognize/node_modules/@tensorflow/tfjs-node-gpu/deps/lib/libtensorflow.so

Expected behavior

apps/recognize/node_modules/@tensorflow/tfjs-node-gpu/deps/lib/libtensorflow.so.2.9.1 is only backed up once, and the symlinks are preserved as such.

Installation method

Community Manual installation with Archive

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

None

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?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

joshtrichards commented 6 months ago

Agreed. The cause is likely here:

https://github.com/nextcloud/updater/blob/b0d2bc63283c593ce97b3d2145b96f2c895e06c6/lib/Updater.php#L449-L452

isFile() is resolving the target of the symbolic link. Need to add an isLink() check with additional handling for symbolic links in the backups.

joshtrichards commented 6 months ago

In the mean time, using --no-backup may be a workaround.