Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 of 8 tasks
jplitza opened this issue Aug 12, 2023 · 2 comments
Open
4 of 8 tasks

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

jplitza opened this issue Aug 12, 2023 · 2 comments

Comments

@jplitza
Copy link

jplitza commented Aug 12, 2023

⚠️ 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?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@joshtrichards
Copy link
Member

Agreed. The cause is likely here:

updater/lib/Updater.php

Lines 449 to 452 in b0d2bc6

// If it is a file copy it
if ($fileInfo->isFile()) {
$state = copy($fileInfo->getRealPath(), $backupFolderLocation . $fileName);
if ($state === false) {

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants