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

Invalid cross-device link at /var/www/html/lib/private/Files/Storage/Local.php#339 #1162

Closed
mmallejac opened this issue Jun 22, 2020 · 3 comments

Comments

@mmallejac
Copy link

Steps to reproduce

  • share a folder located under a local location mounted using files_external
  • using the share link, on another browser or computer, make some files and folder operations (upload, creation, delete)
  • it happens on one out of 10 operations, approximately

This happens only under these conditions :

  • while using a share link, as an external user
  • the share link points to a folder located on a docker volume
  • this docker volume is locally mounted with files_external

Expected behaviour

No error is shown

Actual behaviour

On screen : an error message appears "could not remove file ttt", then a page refresh shows expected results (that the file has been actually removed)

In nextcloud.log :

{"reqId":"hVBBG4y7Dep8VNlKqjVJ","level":3,"time":"2020-06-22T12:45:25+00:00","remoteAddr":"185.71.13.50","user":"--","app":"PHP","method":"DELETE","url":"/public.php/webdav/ttt","message":"rename(): The first argument to copy() function cannot be a directory at /var/www/html/lib/private/Files/Storage/Local.php#339","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0","version":"19.0.0.12"} {"reqId":"hVBBG4y7Dep8VNlKqjVJ","level":3,"time":"2020-06-22T12:45:25+00:00","remoteAddr":"185.71.13.50","user":"--","app":"PHP","method":"DELETE","url":"/public.php/webdav/ttt","message":"rename(//var/local/data/files/Direction/ttt,//var/www/html/data/adm4next/files_trashbin/files/ttt.d1592829925): Invalid cross-device link at /var/www/html/lib/private/Files/Storage/Local.php#339","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0","version":"19.0.0.12"}

Server configuration detail

Operating system: Linux 5.3.0-55-generic #49-Ubuntu SMP Thu May 21 12:47:19 UTC 2020 x86_64

Webserver: Apache/2.4.38 (Debian) (apache2handler)

Database: mysql 10.4.12

PHP version:

7.4.7
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, bcmath, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache

Nextcloud version: 19.0.0 - 19.0.0.12

Updated from an older Nextcloud/ownCloud or fresh install: fresh install

Where did you install Nextcloud from: official docker image nextcloud:19.0-apache

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.5.0
 - activity: 2.12.0
 - bruteforcesettings: 1.6.0
 - calendar: 2.0.3
 - cloud_federation_api: 1.2.0
 - comments: 1.9.0
 - contacts: 3.3.0
 - contactsinteraction: 1.0.0
 - dav: 1.15.0
 - deck: 1.0.3
 - federatedfilesharing: 1.9.0
 - federation: 1.9.0
 - files: 1.14.0
 - files_downloadactivity: 1.8.0
 - files_external: 1.10.0
 - files_pdfviewer: 1.8.0
 - files_rightclick: 0.16.0
 - files_sharing: 1.11.0
 - files_trashbin: 1.9.0
 - files_versions: 1.12.0
 - files_videoplayer: 1.8.0
 - firstrunwizard: 2.8.0
 - issuetemplate: 0.6.0
 - logreader: 2.4.0
 - lookup_server_connector: 1.7.0
 - nextbackup: 20.4.0
 - nextcloud_announcements: 1.8.0
 - notifications: 2.7.0
 - oauth2: 1.7.0
 - password_policy: 1.9.1
 - photos: 1.1.0
 - privacy: 1.3.0
 - provisioning_api: 1.9.0
 - rainloop: 7.0.1
 - recommendations: 0.7.0
 - serverinfo: 1.9.0
 - settings: 1.1.0
 - sharebymail: 1.9.0
 - spreed: 9.0.1
 - support: 1.2.1
 - survey_client: 1.7.0
 - systemtags: 1.9.0
 - tasks: 0.13.1
 - text: 3.0.1
 - theming: 1.10.0
 - twofactor_backupcodes: 1.8.0
 - updatenotification: 1.9.0
 - viewer: 1.3.0
 - workflowengine: 2.1.0
Disabled:
 - admin_audit
 - encryption
 - user_ldap

Configuration (config/config.php)
{
    "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
    },
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "test.cloud.4next.ch"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "19.0.0.12",
    "overwrite.cli.url": "https:\/\/test.cloud.4next.ch",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "default_language": "fr",
    "force_language": "fr",
    "default_locale": "fr_CH",
    "mail_smtpmode": "smtp",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtpsecure": "tls",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauth": 1,
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "overwriteprotocol": "https",
    "app_install_overwrite": [
        "issuetemplate"
    ]
}

Are you using external storage, if yes which one: local

Are you using encryption:

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0

Operating system: Ubunto 20.04 desktop

Logs

Web server error log

Nextcloud log
{"reqId":"hVBBG4y7Dep8VNlKqjVJ","level":3,"time":"2020-06-22T12:45:25+00:00","remoteAddr":"185.71.13.50","user":"--","app":"PHP","method":"DELETE","url":"/public.php/webdav/ttt","message":"rename(): The first argument to copy() function cannot be a directory at /var/www/html/lib/private/Files/Storage/Local.php#339","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0","version":"19.0.0.12"}
{"reqId":"hVBBG4y7Dep8VNlKqjVJ","level":3,"time":"2020-06-22T12:45:25+00:00","remoteAddr":"185.71.13.50","user":"--","app":"PHP","method":"DELETE","url":"/public.php/webdav/ttt","message":"rename(//var/local/data/files/Direction/ttt,//var/www/html/data/adm4next/files_trashbin/files/ttt.d1592829925): Invalid cross-device link at /var/www/html/lib/private/Files/Storage/Local.php#339","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0","version":"19.0.0.12"}
Browser log
@danfate
Copy link

danfate commented Jan 26, 2021

same issue here, do you find the solution?

@mmallejac
Copy link
Author

Nope, sorry.
We try now to avoid files_external folders as much as possible.
We're still looking for the most appropriate way to share he same data with two different systems (Nextcloud and Samba).

@joshtrichards
Copy link
Member

Duplicate of nextcloud/server#14743 & nextcloud/server#38569
Fixed in nextcloud/server#38623

Not an issue with the Docker image. This was in Nextcloud server. This repository isn't for server. :-)

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

No branches or pull requests

3 participants