Transfer folder ownership between users gives allways error

Steps to reproduce

  1. Two users created on ownCloud: “User1” and “User2”
  2. One folder shared with other users from account of user “User1” (owner of the folder shared)
  3. Run command: occ files:transfer-ownership --path="/Shared Folder1" User1 User2
  4. Gives always the error:
    “In Share.php line 173:
    [OCP\Files\NotFoundException]”

Expected behaviour

Folder should be moved to account of User2 (folder, subfolders, files, shares…)

Actual behaviour

After run command:
occ files:transfer-ownership --path="/Shared Folder1" User1 User2

Gives always the error:
“In Share.php line 173:
[OCP\Files\NotFoundException]”

Server configuration

Operating system:
Current UCS version is 4.4-4 errata652

Web server:

Database:

PHP version:

ownCloud version: (see ownCloud admin page)
10.3.2-1

Updated from an older ownCloud or fresh install:
Fresh install

Where did you install ownCloud from:
Univention (virtual Machine)

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

Integrity checker has been disabled. Integrity cannot be verified.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

root@0fbefea02aba: /var/www/owncloud # occ config:list system
{
    "system": {
        "apps_paths": [
            {
                "path": "\/var\/www\/owncloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/owncloud\/custom",
                "url": "\/custom",
                "writable": true
            }
        ],
        "trusted_domains": [
            "localhost"
        ],
        "datadirectory": "\/var\/lib\/univention-appcenter\/apps\/owncloud\/data\/files",
        "dbtype": "mysql",
        "dbhost": "172.17.42.1",
        "dbname": "owncloud",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "log_type": "owncloud",
        "supportedDatabases": [
            "sqlite",
            "mysql",
            "pgsql"
        ],
        "upgrade.disable-web": true,
        "integrity.check.disabled": true,
        "default_language": "en",
        "overwrite.cli.url": "http:\/\/localhost\/owncloud",
        "htaccess.RewriteBase": "\/owncloud",
        "logfile": "\/var\/lib\/univention-appcenter\/apps\/owncloud\/data\/files\/owncloud.log",
        "loglevel": 3,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "version": "10.3.2.2",
        "logtimezone": "UTC",
        "installed": true,
        "instanceid": "ocymhy8rqfyh",
        "ldapIgnoreNamingRules": false,
        "log_rotate_size": 104857600,
        "onlyoffice": {
            "verify_peer_off": true
        },
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "mysql.utf8mb4": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "redis",
            "port": "6379"
        },
        "lost_password_link": "true",
        "updatechecker": false
    }
}



*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:
Enabled:

  • activity: 2.5.3
  • announcementcenter: 1.2.1
  • brute_force_protection: 1.0.1
  • comments: 0.3.0
  • configreport: 0.2.0
  • dav: 0.5.0
  • diagnostics: 0.1.4
  • federatedfilesharing: 0.5.0
  • federation: 0.1.0
  • files: 1.5.2
  • files_external: 0.7.1
  • files_mediaviewer: 1.0.2
  • files_pdfviewer: 0.11.1
  • files_sharing: 0.12.0
  • files_texteditor: 2.3.0
  • files_textviewer: 1.0.3
  • files_trashbin: 0.9.1
  • files_versions: 1.3.0
  • firstrunwizard: 1.2.0
  • impersonate: 0.5.0
  • market: 0.5.0
  • notifications: 0.5.0
  • password_policy: 2.1.2
  • provisioning_api: 0.5.0
  • systemtags: 0.3.0
  • templateeditor: 0.4.0
  • updatenotification: 0.2.1
  • user_ldap: 0.15.0
    Disabled:
  • encryption
  • external
  • gallery
  • onlyoffice
  • richdocuments
  • user_external
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

**Are you using external storage, if yes which one:** local/smb/sftp/...
No

**Are you using encryption:** yes/no
No

**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...
No

Perhaps you need to specify the path differently, e.g with “files/” in front of it. Check the filesystem, give it a go and let us know.

1 Like

** Attention the command works for others users but not for “User1” **

Tried with this command:

  • occ files:transfer-ownership --path="/Files/Shared Folder1" User1 User2

Give the following error: Unknown path provided: Files/Shared Folder1

Another sugestion?

usually the folder is called ‘files’, not ‘Files’, UNIX filesystems are case sensitive.

1 Like

Same error:
root@xxxxxxxxx: /var/www/owncloud # occ files:transfer-ownership --path="/files/Shared Folder1" User1 User2
Unknown path provided: files/Shared Folder1

Error with verbose activated:

root@xxxxxxx: /var/www/owncloud # occ -vvv files:transfer-ownership --path="/Shared Folder1" User1 User2
Analysing files of User1 …
95 [============================] 1 sec 20.0 MiB
Collecting all share information for files and folder of User1 …
2 [–>-------------------------] 1 sec 22.0 MiB
In Share.php line 173:

[OCP\Files\NotFoundException]

Exception trace:
at /var/www/owncloud/lib/private/Share20/Share.php:173
OC\Share20\Share->getNode() at /var/www/owncloud/apps/files/lib/Command/TransferOwnership.php:267
OCA\Files\Command\TransferOwnership->OCA\Files\Command{closure}() at n/a:n/a
array_filter() at /var/www/owncloud/apps/files/lib/Command/TransferOwnership.php:269
OCA\Files\Command\TransferOwnership->collectUsersShares() at /var/www/owncloud/apps/files/lib/Command/TransferOwnership.php:165
OCA\Files\Command\TransferOwnership->execute() at /var/www/owncloud/lib/composer/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /var/www/owncloud/lib/composer/symfony/console/Application.php:982
Symfony\Component\Console\Application->doRunCommand() at /var/www/owncloud/lib/composer/symfony/console/Application.php:255
Symfony\Component\Console\Application->doRun() at /var/www/owncloud/lib/composer/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /var/www/owncloud/lib/private/Console/Application.php:165
OC\Console\Application->run() at /var/www/owncloud/console.php:106
require_once() at /var/www/owncloud/occ:11

files:transfer-ownership [–path PATH] [–]

This should be fixed in the incoming 10.5.0 version. You can check https://github.com/owncloud/core/pull/37568

As a workaround, you could transfer the whole account and then remove whatever you don’t need in the new account. It will be heavier, but it should get the things done.

2 Likes

Thanks for your reply but i can’t transfer the whole account to another account, the user tis still active in our company (it changed from one department to another). I only want to move three folders (he have eight folders in this account) not more not less.

I updated to 10.5.10 and I still also get the error when trying to transfer ownership of one directory

/srv/camcloud/data# sudo -u www-data ${PHPCMD} /camgian/sbin/occ files:transfer-ownership -vv --path=“Demo-Reports” 3fc7ea64-667b-1036-8762-31a2b47e0fca 3fe04c58-667b-1036-8772-31a2b47e0fca
Analysing files of 3fc7ea64-667b-1036-8762-31a2b47e0fca …
49 [============================] < 1 sec
Collecting all share information for files and folder of 3fc7ea64-667b-1036-8762-31a2b47e0fca …

In Share.php line 173:

[OCP\Files\NotFoundException]

Exception trace:
at /var/www/owncloud_10_5_0/lib/private/Share20/Share.php:173
OC\Share20\Share->getNode() at /srv/camcloud/apps/files/lib/Command/TransferOwnership.php:267
OCA\Files\Command\TransferOwnership->OCA\Files\Command{closure}() at n/a:n/a
array_filter() at /srv/camcloud/apps/files/lib/Command/TransferOwnership.php:269
OCA\Files\Command\TransferOwnership->collectUsersShares() at /srv/camcloud/apps/files/lib/Command/TransferOwnership.php:165
OCA\Files\Command\TransferOwnership->execute() at /var/www/owncloud_10_5_0/lib/composer/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /var/www/owncloud_10_5_0/lib/composer/symfony/console/Application.php:1000
Symfony\Component\Console\Application->doRunCommand() at /var/www/owncloud_10_5_0/lib/composer/symfony/console/Application.php:271
Symfony\Component\Console\Application->doRun() at /var/www/owncloud_10_5_0/lib/composer/symfony/console/Application.php:147
Symfony\Component\Console\Application->run() at /var/www/owncloud_10_5_0/lib/private/Console/Application.php:165
OC\Console\Application->run() at /var/www/owncloud_10_5_0/console.php:116
require_once() at /var/www/owncloud_10_5_0/occ:11

files:transfer-ownership [–path PATH] [–]

Hi,
Why did you upgrade to 10.5?
If you go through the trouble to upgrade, I’d recommend to go to latest (10.8).
10.5. was release over a year ago and since 10.6. there is a new command occ files:troubleshoot-transfer-ownership which is meant to help in exactly these situations.
So, I would recommend to go to 10.8 and then try again, and if it still doesn’t work, use the new command to figure out why.
Cheers,

2 Likes

The upgrade to 10.8 happens after COB today.

Thank you

1 Like