Sharing to local users: Autocompletion fails

Hi there!

I’m currently having an issue similar to this one: Can’t share to a local User,
i.e. when typing the name of a local user to share a file or directory, no result will be found.

However, contrary to above montioned issue, this only happens with one specific user. This has not happened befor for this specific user and doesn’t seem to be related to the solution of the other issue. That issue was about NC 11, where I’m running 14.0.3 and only since July.

Logging gives me:

|Error|PHP|TypeError: Argument 1 passed to OC\Federation\CloudIdManager::resolveCloudId() must be of the type string, null given, called in /path/to/webspace/nextcloud/lib/private/Collaboration/Collaborators/MailPlugin.php on line 137 at /path/to/nextcloud/lib/private/Federation/CloudIdManager.php#37|2018-10-31T18:34:40+0100|

|Error|PHP|Undefined index: CLOUD at /media/webspace/nextcloud/lib/private/Collaboration/Collaborators/MailPlugin.php#137|2018-10-31T18:34:40+0100|

I was able to share with the troublesome user by deactivating auto completion but would still like to fix the issue.

Does anybody have an idea as how to fix this?
I’m glad for any advise!

Thanks in advance,

Does that happen on a specific device or on that user account with multiply Accounts? I heavent experienced any errors sharing to a user using the version 14.0.3 - is this maybe an Error because the device of the user cached some Js-Files and sends an invalid request to the Server? Try to reset the cache.

If its not the problem of the client, try to open the inspector (F12), go on the Console-Tab and tick the box “Log XHR-Requests” (Chrome), type in something into the browser window and look if the request to https://yournextcloud/ocs/v1.php/apps/files_sharing/api/v1/sharees is completed with a Http Status Code 200, the response of the server should contain a json with a top-level “ocs” and the subpoints “meta” and “data”.

If its not an issue caused by an invalid request, try to disable the Federated Cloud Sharing in you Admin-Settings - the Error you posted seems to be caused in a file related to this part of nextcloud.

Hope this helps,
mineehen :wink:

Thanks for the quick response!

The error does not seem to be realated to the device. It occoured in the app, different browsers (on different laptops, also after reseting caches) and in the Windows Client.

I’m not that familiar with the console in Chrome. This is, what I tried on from Linux terminal:

curl -u usr:pwd -H "OCS-APIRequest: true"


<?xml version="1.0"?>
  <message>Missing itemType</message>

So, something seems to be missing. Can you tell, what it is and/or how to fix it?

Just for completeness, I also tried disabeling FCS and reenabeling auto completion - without luck (surprise).

I would be thankfull for further help!

Hey - sorry for my late response - I heaven’t got any notifications that you’ve replied to that topic, sorry.

This response is normal, because you haeven’t specified a search subject, just try again with a search string appended to the request: https://nc_instance/ocs/v1.php/apps/files_sharing/api/v1/sharees?format=json&search=&perPage=200&itemType=folder, just replace the to find a local user - if this works something has to be wrong on the client side. I don’t know any reason because this error occours only for one account, Nextcloud has no user-specific permission system.

Also, you can try to cleanup the federation cache, this is the only occ command I found which is related to the shares, but maybe it’s worth a try: php occ sharing:cleanup-remote-storages

Hey, no problem.

Ok, I see.
Anyway, when running the request with specified itemType, I get

{"message":"CSRF check failed"}.

When entering the request directly in the browser, a page will show telling me “Access denied, CSRF check failed”. I gooogled the CSRF-thing but didn’t quite understand it. As far as I can see, several fixes have been made, that should be contained in 14.0.1. Most reports mention problems on login or folder drag&drop.

Also: php occ sharing:cleanup-remote-storages gives me

0 remote storage(s) need(s) to be checked
0 remote share(s) exist
no storages deleted

If you have any other idea, I would be glad. Thanks for taking the time!

Sorry I again recived no notification… Should check my E-Mail-Settings.

Maybe it helps to delete the user and create it again?

No problem at all.
Mh, I guess I’ll have to consider it.
I just did some testing first: Let me call the username making trouble “Bob”. I created a now user called “Bobby” and reactivated autocompletion. As before autocompletion worked for all users exepct Bob and Bobby. However, wenn typing “Bobb”, autocompletion works for “Bobby”.
Also, creating a new users that does not share the first letter with any other user, will work with autocompletion.
This gives me hope, that delete-and recreate will work. I just will have to do some backup-work beforehand …
Thanks again for your support!

1 Like

No Problem! I hope this helps, because I don’t know any reason why this feature doesn’t work on specific users (except that a group they are member of is excluded from this feature) - maybe there is only a database entry wrong for the user.

Long time no see …
I finally found the time to try the “delete and recreate” way - it worked just fine!
To avoid re-uploading all the data, I transfered the data to the new user before deleting the old one:

<create user temp>
sudo -u www-data php occ files:transfer-ownership Bob temp
<delete user Bob>
<create user Bob>
sudo -u www-data php occ files:transfer-ownership temp Bob
<delete user temp>

Note: This only transfers files, no calendars and contacts. Unfortunately I did not find a simple way to do that.

Leaving this her for completeness.

1 Like