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]: moving files to external storage, copies them and raises an error #39516

Closed
5 of 8 tasks
SaswatPadhi opened this issue Jul 21, 2023 · 3 comments
Closed
5 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug

Comments

@SaswatPadhi
Copy link

⚠️ This issue respects the following points: ⚠️

Bug description

I noticed this issue after 26.0.3 -> 27.0.0 upgrade, and it seems unfixed in 27.0.1.

When I try to copy files from my local storage to an external storage, the file is copied and then I get an error notification that says:

Could not move "<filename>"

Inspecting the log file reveals the following error:

rename(//data/saswat/files/<filename>, //external/<filename>): Operation not permitted at /var/www/html/lib/private/Files/Storage/Local.php#378

Since a rename wouldn't work across filesystems, I suspect NC is trying to copy + delete, but then it only copies and fails to delete the source file, and instead raises this error!?

Steps to reproduce

(I have not tested this on a fresh NC27 installation, but only on 26 -> 27 upgrade)

  1. Mount an external storage and allow a user to write files to it
  2. As the user, try to move a local file to the external storage
  3. Notice that NC shows a progress bar and then an error that the file could not be moved
  4. Go to the external storage mount point and notice that a copy of the source file was created

Expected behavior

I expect the file to be moved without any errors -- the source file should be removed and only the destination file should exist.

Installation method

None

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 22 to 23)

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

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwriteprotocol": "https",
        "overwritewebroot": "\/cloud",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "trusted_domains": [
            "***MANUALLY REDACTED***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "27.0.1.2",
        "overwrite.cli.url": "***MANUALLY REDACTED***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "maintenance": false,
        "enabledPreviewProviders": [
            "OC\\Preview\\Image",
            "OC\\Preview\\Movie",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOffice2007",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\PDF",
            "OC\\Preview\\SVG",
            "OC\\Preview\\TIFF"
        ],
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/exiftool-bin\/exiftool-aarch64-glibc",
        "theme": "",
        "app_install_overwrite": [
            "facerecognition"
        ]
    }
}

List of activated Apps

Enabled:
  - activity: 2.19.0
  - admin_audit: 1.17.0
  - bruteforcesettings: 2.7.0
  - cloud_federation_api: 1.10.0
  - contacts: 5.3.2
  - contactsinteraction: 1.8.0
  - dav: 1.27.0
  - facerecognition: 0.9.20
  - federatedfilesharing: 1.17.0
  - files: 1.22.0
  - files_external: 1.19.0
  - files_pdfviewer: 2.8.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - notifications: 2.15.0
  - oauth2: 1.15.1
  - photos: 2.3.0
  - previewgenerator: 5.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - systemtags: 1.17.0
  - tasks: 0.15.0
  - text: 3.8.0
  - theming: 2.2.0
  - theming_customcss: 1.14.0
  - twofactor_backupcodes: 1.16.0
  - twofactor_totp: 9.0.0
  - viewer: 2.1.0
  - workflowengine: 2.9.0
Disabled:
  - circles: 27.0.1 (installed 25.0.0)
  - comments: 1.17.0 (installed 1.15.0)
  - dashboard: 7.7.0 (installed 7.5.0)
  - encryption: 2.15.0
  - federation: 1.17.0 (installed 1.15.0)
  - firstrunwizard: 2.16.0 (installed 2.14.0)
  - maps: 1.1.0 (installed 1.1.0)
  - metadata: 0.19.0 (installed 0.19.0)
  - nextcloud_announcements: 1.16.0 (installed 1.14.0)
  - password_policy: 1.17.0 (installed 1.15.0)
  - recommendations: 1.6.0 (installed 1.4.0)
  - related_resources: 1.2.0 (installed 1.0.3)
  - sharebymail: 1.17.0 (installed 1.15.0)
  - support: 1.10.0 (installed 1.8.0)
  - survey_client: 1.15.0 (installed 1.13.0)
  - suspicious_login: 5.0.0 (installed 4.3.0)
  - updatenotification: 1.17.0 (installed 1.15.0)
  - user_ldap: 1.17.0
  - user_status: 1.7.0 (installed 1.5.0)
  - weather_status: 1.7.0 (installed 1.5.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

rename(//data/saswat/files/InstantUpload/Camera/2023/07/PXL_20230713_011111821.TS.mp4,//external/FAMILY/VIDEOS/PXL_20230713_011111821.TS.mp4): Operation not permitted at /var/www/html/lib/private/Files/Storage/Local.php#378

Additional info

Related to #14743, but that issue is only about directories.
In my case, moving files doesn't work either.

@SaswatPadhi SaswatPadhi added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jul 21, 2023
@SemaiCZE
Copy link

SemaiCZE commented Aug 5, 2023

I have the same issue. My setup is Nextcloud in Docker container, main data folder is one mounted volume, external storage is another mounted volume, this one is added as local External Storage into the Nextcloud instance. When I try to move file from the main data folder into the second one I get an error and the file is copied (the original one is not deleted). In the Nextcloud logs I can see only

{"reqId":"ZzPG1JSh9THFsuErJexA","level":3,"time":"2023-08-05T20:51:57+00:00","remoteAddr":"172.21.0.1","user":"user","app":"PHP","method":"MOVE","url":"/remote.php/dav/files/user/logo.png","message":"rename(//var/www/html/data/user/files/logo.png,//mnt/user_nas/Photos/logo.png): Operation not permitted at /var/www/html/lib/private/Files/Storage/Local.php#378","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0","version":"27.0.1.2","data":{"app":"PHP"},"id":"64ceb68bab08b"}

But I found a pull request #38623 which could help in this case. I'll wait for a next Nextcloud release and test this again.

@kesselb kesselb closed this as completed Aug 16, 2023
@kesselb
Copy link
Contributor

kesselb commented Aug 16, 2023

Thanks, please create a new issue when the problem continues to occur with Nextcloud 28.

@SemaiCZE
Copy link

Nextcloud 28 is out and moving files to external storage works! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug
Projects
None yet
Development

No branches or pull requests

4 participants