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]: Error when deleting folder: rename(): The first argument to copy() function cannot be a directory #38569

Closed
6 of 9 tasks
mebtte opened this issue Jun 1, 2023 · 9 comments · Fixed by #38623
Closed
6 of 9 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 26-feedback bug

Comments

@mebtte
Copy link

mebtte commented Jun 1, 2023

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

When deleting a folder (whatever it is empty or not), it will report a error.
image

After reloading page, the folder is gone and I couldn't find it on trash bin or anywhere. The Logging has some errors:
image

Steps to reproduce

  1. select a existing folder or create a new folder
  2. delete it
  3. error happens

Expected behavior

The folder should be in the trash bin after deleting.

Installation method

Community Docker image

Nextcloud Server version

26

Operating system

Debian/Ubuntu

PHP engine version

8.2.6

Web server

Apache (supported)

Database engine version

MySQL

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

None

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

{
    "system": {
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "filesystem_check_changes": 1,
        "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
            }
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "26.0.2.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "maintenance": false
    }
}

List of activated Apps

Enabled:
  - activity: 2.18.0
  - cloud_federation_api: 1.9.0
  - comments: 1.16.0
  - dav: 1.25.0
  - federatedfilesharing: 1.16.0
  - files: 1.21.1
  - files_pdfviewer: 2.7.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.1
  - logreader: 2.11.0
  - lookup_server_connector: 1.14.0
  - notifications: 2.14.0
  - oauth2: 1.14.0
  - photos: 2.2.0
  - provisioning_api: 1.16.0
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - text: 3.7.2
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - twofactor_totp: 8.0.0
  - viewer: 1.10.0
  - workflowengine: 2.8.0
Disabled:
  - admin_audit: 1.16.0
  - bruteforcesettings: 2.6.0
  - circles: 26.0.0 (installed 26.0.0)
  - contactsinteraction: 1.7.0 (installed 1.7.0)
  - dashboard: 7.6.0 (installed 7.6.0)
  - encryption: 2.14.0
  - federation: 1.16.0 (installed 1.16.0)
  - files_external: 1.18.0
  - firstrunwizard: 2.15.0 (installed 2.15.0)
  - nextcloud_announcements: 1.15.0 (installed 1.15.0)
  - password_policy: 1.16.0 (installed 1.16.0)
  - privacy: 1.10.0 (installed 1.10.0)
  - recommendations: 1.5.0 (installed 1.5.0)
  - related_resources: 1.1.0-alpha1 (installed 1.1.0-alpha1)
  - sharebymail: 1.16.0 (installed 1.16.0)
  - support: 1.9.0 (installed 1.9.0)
  - survey_client: 1.14.0 (installed 1.14.0)
  - suspicious_login: 4.4.0
  - systemtags: 1.16.0 (installed 1.16.0)
  - updatenotification: 1.16.0 (installed 1.16.0)
  - user_ldap: 1.16.0
  - user_status: 1.6.0 (installed 1.6.0)
  - weather_status: 1.6.0 (installed 1.6.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

No response

@mebtte mebtte added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jun 1, 2023
@joshtrichards
Copy link
Member

Unable to reproduce.

Can you provide the entire stack trace please? You should be able to get to it by going to the far right of the log entry, clicking the clipboard icon that appears, and selecting Copy raw.

The only thing unusual in your base config I see is filesystem_check_changes set to 1. Was there a particular reason you need that parameter enabled? What is the underlying filesystem used for your datadirectory? Anything unusual about it?

@mebtte
Copy link
Author

mebtte commented Jun 2, 2023

@joshtrichards Here is the raw log:

{
  "reqId": "fT2UdsZKOcyJbsu2MjGj",
  "level": 3,
  "time": "2023-06-01T07:24:23+00:00",
  "remoteAddr": "172.18.0.1",
  "user": "{username}",
  "app": "PHP",
  "method": "DELETE",
  "url": "/remote.php/dav/files/{username}/download/test",
  "message": "rename(/var/www/html/data/{username}/files/download/test,/var/www/html/data/{username}/files_trashbin/files/test.d1685604263): Success at /var/www/html/lib/private/Files/Storage/Local.php#378",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
  "version": "26.0.2.1",
  "data": {
    "app": "PHP"
  },
  "id": "64795a57487fe"
}
{
  "reqId": "fT2UdsZKOcyJbsu2MjGj",
  "level": 3,
  "time": "2023-06-01T07:24:23+00:00",
  "remoteAddr": "172.18.0.1",
  "user": "{username}",
  "app": "PHP",
  "method": "DELETE",
  "url": "/remote.php/dav/files/{username}/download/test",
  "message": "rename(): The first argument to copy() function cannot be a directory at /var/www/html/lib/private/Files/Storage/Local.php#378",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
  "version": "26.0.2.1",
  "data": {
    "app": "PHP"
  },
  "id": "64795a5748828"
}

The reason I set filesystem_check_changes to 1 is the datadirectory shares with other services, like using qBittorrent to download something and then view it on nextcloud. The filesystem is ext4.

@solracsf solracsf changed the title [Bug]: php report error when deleting folder [Bug]: Error when deleting folder: rename(): The first argument to copy() function cannot be a directory Jun 2, 2023
@joshtrichards
Copy link
Member

Duplicate of #37741

(at least the NC26 follow-up comment one from the OP)

My bad - it just dawned on my that you're using External Storage and that download is a local External Storage mount.

Discovered a couple of interesting things, but still poking around.

Let's take follow-up over there.

@joshtrichards
Copy link
Member

Correction:

Duplicate of #14743

@mebtte
Copy link
Author

mebtte commented Jun 3, 2023

My docker compose like this:

version: '2'
services:
  nextcloud:
    container_name: nextcloud
    image: nextcloud
    restart: always
    user: 1000:1000
    ports:
      - {port}:80
    volumes:
      - /home/{username}/nextcloud:/var/www/html
      - /disk_mount_dir/nextcloud_data:/var/www/html/data
      - /disk_mount_dir/download:/var/www/html/data/{username}/files/download

@solracsf
Copy link
Member

solracsf commented Jun 5, 2023

Feel free to try #38623

@mebtte
Copy link
Author

mebtte commented Aug 14, 2023

Does this release? I have this issue still on 27.0.2.

@kesselb
Copy link
Contributor

kesselb commented Aug 14, 2023

28

@eugenov
Copy link

eugenov commented Sep 14, 2023

Have this issue with 27.0.2. No external storage, ext4

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 26-feedback bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants