Occ files:transfer-ownership possible bug or...?

The Basics

  • Nextcloud Server version:
    • 30.0.6
  • Operating system and version:
    • Gentoo linux
  • Web server and version:
    • Apache 2.4.63
  • Reverse proxy and version:
    • none
  • PHP version:
    • 8.2.28
  • Is this the first time you’ve seen this error?:
    • yes
  • When did this problem seem to first start?
    • can’t make any assumptions, I never attempted this before
  • Installation method
    • Gentoo package (basically raw untar)
  • Are you using CloudfIare, mod_security, or similar?
    • no

Summary of the issue you are facing:

Issuing the command as follows

sudo -u apache php occ files:transfer-ownership --path=test.xlsx 4ce16f3c-28c2-4bc3-ac3e-ed3222a815d6 keycloak-5086070f-5f8c-4cde-a0cb-ef42c8bd6bcf

gives

Validating quota
Analysing files of 4ce16f3c-28c2-4bc3-ac3e-ed3222a815d6 ...
    0 [->--------------------------]
Collecting all share information for files and folders of 4ce16f3c-28c2-4bc3-ac3e-ed3222a815d6 ...
   23 [============================]
Transferring files to keycloak-5086070f-5f8c-4cde-a0cb-ef42c8bd6bcf/files/Transferred from some_user on 2025-07-24 13-42-13 ...

In View.php line 894:

  Moving a storage (4ce16f3c-28c2-4bc3-ac3e-ed3222a815d6/files/test.xlsx) into another storage (keycloak-5086070f-5f8c-4cde-a0cb-ef42c8bd6bcf) is not allowed


files:transfer-ownership [--path PATH] [--move] [--transfer-incoming-shares [TRANSFER-INCOMING-SHARES]] [--] <source-user> <destination-user>

The two users however are on the same (local) storage:

No mounts configured by 4ce16f3c-28c2-4bc3-ac3e-ed3222a815d6
No mounts configured by keycloak-5086070f-5f8c-4cde-a0cb-ef42c8bd6bcf

The only difference is that the user with the file is from the LDAP backend and the recipient user is from the database backend, having registered via keycloak and social login plugin.

Log entries

There is nothing in the logs.

Configuration

Nextcloud

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.6.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "forcessl": true,
        "ldapIgnoreNamingRules": false,
        "maintenance": false,
        "maintenance_window_start": 2,
        "theme": "",
        "trusted_domains": [
            "mydomain.full",
            "192.168.170.50"
        ],
        "secret": "***REMOVED SENSITIVE VALUE***",
        "log_type": "syslog",
        "syslog_tag": "Nextcloud",
        "logfile": "\/var\/log\/nextcloud",
        "loglevel": 3,
        "log_rotate_size": 0,
        "trashbin_retention_obligation": "30, 31",
        "versions_retention_obligation": "auto, 30",
        "overwrite.cli.url": "https:\/\/mydomain.full\/nextcloud",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": "true",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "singleuser": false,
        "onlyoffice": {
            "jwt_header": "AuthorizationJwt"
        },
        "allow_user_to_change_mail_address": "",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "default_phone_region": "IT",
        "mysql.utf8mb4": true
    }
}

Apps

Enabled:

  • activity: 3.0.0
  • app_api: 4.0.6
  • bruteforcesettings: 3.0.0
  • calendar: 5.2.0
  • circles: 30.0.0
  • cloud_federation_api: 1.13.0
  • comments: 1.20.1
  • contacts: 7.0.4
  • contactsinteraction: 1.11.0
  • dashboard: 7.10.0
  • dav: 1.31.1
  • federatedfilesharing: 1.20.0
  • files: 2.2.0
  • files_downloadlimit: 3.0.0
  • files_external: 1.22.0
  • files_pdfviewer: 3.0.0
  • files_reminders: 1.3.0
  • files_sharing: 1.22.0
  • files_trashbin: 1.20.1
  • files_versions: 1.23.0
  • firstrunwizard: 3.0.0
  • impersonate: 1.17.1
  • logreader: 3.0.0
  • lookup_server_connector: 1.18.0
  • nextcloud_announcements: 2.0.0
  • notifications: 3.0.0
  • oauth2: 1.18.1
  • onlyoffice: 9.7.0
  • password_policy: 2.0.0
  • photos: 3.0.2
  • privacy: 2.0.0
  • provisioning_api: 1.20.0
  • recommendations: 3.0.0
  • related_resources: 1.5.0
  • serverinfo: 2.0.0
  • settings: 1.13.0
  • sharebymail: 1.20.0
  • sociallogin: 6.0.2
  • support: 2.0.0
  • survey_client: 2.0.0
  • systemtags: 1.20.0
  • text: 4.1.0
  • theming: 2.6.0
  • twofactor_backupcodes: 1.19.0
  • user_ldap: 1.21.0
  • user_saml: 6.5.0
  • user_status: 1.10.0
  • viewer: 3.0.0
  • webhook_listeners: 1.1.0-dev
  • workflowengine: 2.12.0
    Disabled:
  • admin_audit: 1.20.0
  • encryption: 2.18.0
  • federation: 1.20.0 (installed 0.1.0)
  • files_rightclick: 0.15.1 (installed 1.6.0)
  • files_texteditor: 2.15.1 (installed 2.15.1)
  • suspicious_login: 8.0.0
  • tasks: 0.16.0 (installed 0.16.0)
  • twofactor_nextcloud_notification: 4.0.0
  • twofactor_totp: 12.0.0-dev
  • updatenotification: 1.20.0 (installed 0.2.1)
  • weather_status: 1.10.0 (installed 1.7.0)

I know I can do cp, rescan and call it a day, but it seems to me that this warrants some investigation.
Thank you for any insight!

it looks like you try to transfer one single file

occ is not designed/described to perform this

It is also possible to transfer only one directory along with its contents. This can be useful to restructure your organization or quotas. The --path argument is given as the path to the directory as seen from the source user

please review the docs

Thank you very much! I made a mistake while trying to make a test as simple as possible, indeed a similar test with a directory containing a single text file completed successfully!

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.