Hello,
I did the upgrade yesterday to NextCloud 18. Since then, I am no longer able to share files with other (internal) users. I get an error popup when I try and noticed an error 404 in the browser for URL /ocs/v2.php/apps/files_sharing/api/v1/shares . There is no log on the server side.
Note: I have file_sharing 1.10.1 installed.
Note 2: already shared files are still working fine.
Would you be able to help ? I can provide more details if you let me know what you need to reproduce.
Thank you.
Hello,
same here but if you reload the page there's a log "shared with user" on activities and in my case it then is shared.
Not in my case: no activity log and folder still not shared :(
Hello,
I also reported this issue. Unfortunately it was moved over to the nextcloud/maps repo :(
https://github.com/nextcloud/maps/issues/286
I would like to warn you to play around with shares right now. I also noticed that I still had my old shares, but to collect some debug data I created new shares and unshared them and during that time I lost all my old shares.
So I don't know what action exactly deleted all the shares (DB table is empty) and it might have been the "unsharing". Just to be safe, better don't do it, until the issue is fixed.
Awesome, you are great @kesselb !
Thanks a lot for linking me to that issue and the fix.
@ ppattard, turned out it is really the maps app, causing the issue, that sharing files doesn't work. I just disabled the maps app and sharing works again.
A fixed version is on the way.
And as kesselb is linking to the other case, that is the issue causing my shares to get deleted. So, there is a fix as well.
@Schmuuu thanks for pointing to your ticket! I have checked what is explained and to be honest I'm not convinced since in my case I don't even have the Maps app installed... So could be something similar with another app I suppose, but which one then ?
@ppattard oh, good question then. The devs found out about the maps app as issue for me by the nextcloud.log. Maybe you can share your logfile as well and they can find out.
For me the issue is really solved by just disabling Maps.
Actually I found that sharing works on all folders BUT on external file storage folders (which is what I was trying to share since the beginning). Still trying to figure out if I can narrow down the problem. So clearly another problem than the maps one, and this one is linked to external file storage.
For the record:
Hello,
Any news concerning my issue ? How can I help ? I've tried to set the logs in debug mode but either I failed or there is really nothing printed.
Thx.
Have the same issues. Had to disable maps to still be able to share data with other contacts. =(
Edit: A few minutes ago I was able to update to maps 0.1.5. The bug seems to be gone.
Again, this ticket is NOT about the issue with maps. There is another ticket for that already. This ticket is about sharing files stored on external storage not working (even if maps plugin not activated of course)
Calm down, I will no longer publish a workaround or feedback.
I'm having probably the same issue. I do not have maps app installed, I'm on NC 18.0.1, External storage support 1.9.0 and File sharing 1.10.1.
I'm able to add shares for regular internal folders, but not for external, in my case a SMB share.
EDIT: I even tested NC Android App 3.10.1 as client. There is no error shown, but the share is also not created.
EDIT2: I tested another type than SMB and Local: an external Nextcloud share works fine, I can share subfolders to other users.
EDIT3: I tested SFTP, sharing does also NOT work like SMB or Local.
@ManOki did you manage to get logs ? I've tried to set loglevel to 0 but there is absolutely nothing shown, as if I had not changed anything. I tried to change the logfile and it works, but no debug log. All I can see is this 404 Error in the browser console.
EDIT: I have just found in the doc it is possible to add "debug: true". After that, I have much more logs but still nothing interesting, and apparently nothing really triggerd on the action... mostly a repeated message about "Application is not setup via query()".
No, I don't see any logs on the server, but i also managed to see 404 like you mentioned:
xhr.js:178 POST https://nextcloud.mydomain.com/nextcloud/ocs/v2.php/apps/files_sharing/api/v1/shares 404
ShareRequests.js:61 Error while creating share Error: Request failed with status code 404
at t.exports (createError.js:16)
at t.exports (settle.js:17)
at XMLHttpRequest.d.onreadystatechange (xhr.js:61)
There are also two warnings before (I don't know, if they are related)
showDetailsView is deprecated! Use OCA.Files.Sidebar.activeTab. It will be removed in nextcloud 20.
globals.js:66 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
I debugged javascript and found the corresponding request.
With curl and the following command, I'm able to reproduce the error on command line:
curl -u "username:password" -X POST --header "OCS-APIRequest: true" https://nextcloud.mydomain.com/nextcloud/ocs/v2.php/apps/files_sharing/api/v1/shares -d path="/myshare" -d shareType=0 -d shareWith=otherusername
The server response is:
<?xml version="1.0"?>
<ocs>
<meta>
<status>failure</status>
<statuscode>404</statuscode>
<message>Kann die Berechtigungen von /username/files/myshare nicht erh枚hen</message>
</meta>
<data/>
</ocs>
The message is German, translated "Can't increase permissions of /username/files/myshare".
Offtopic: The statuscode is a bit confusing as it could be misinterpreted as HTTP code 404 (File not found, a client error), but this time the server is responding an error message (which should be a HTTP code 500+ for server errors).
EDIT: Just for clarification, I can share regular directories to other users with the curl command.
Good catch. I checked the server code, the error is thrown here:
// Check that we do not share with more permissions than we have
if ($share->getPermissions() & ~$permissions) {
$message_t = $this->l->t('Can鈥檛 increase permissions of %s', [$share->getNode()->getPath()]);
throw new GenericShareException($message_t, $message_t, 404);
}
I added a debug log and I can see that
$share->getPermissions() = 31 = READ | UPDATE | CREATE | DELETE | SHARE
but
$permissions (which is = $share->getNode()->getPermissions() | DELETE | UPDATE) = 27 = READ | UPDATE | DELETE | SHARE.
So indeed the AND condition fails because the permission CREATE is missing.
I don't know at all what this means since I don't know the code of Nextcloud at all.
All I can say for now to precise the case is that:
The lines in question have apparently been changed in July via this commit: https://github.com/nextcloud/server/commit/85a80b05acbb6e13d8b49d1ee7f79e9a8c708066 from @nickvergessen Don't know if it is related (probably not since it is merged since 17.0.0)...
Is there any news about this? I just ran into the same issue.
NextCloud: 18.0.3
External Storage: 1.9.0
File Sharing: 1.10.1
The external storage I want to share is a SMB share, mounted on my host as read only with 555. That external storage is then added as "Local" to NextCloud.
Same issue here. Would be great to get an update on this...
Same issue here. My external storage is then added as "Local" to NextCloud.
NextCloud: 18.0.3
External Storage: 1.9.0
File Sharing: 1.10.1
The error is:
Error loading the shares list Error: Request failed with status code 404
at t.exports (createError.js:16)
at t.exports (settle.js:17)
at XMLHttpRequest.d.onreadystatechange (xhr.js:61)
The returned message is:
{"ocs":{"meta":{"status":"failure","statuscode":404,"message":"Wrong path, file\/folder doesn't exist"},"data":[]}}
I found the issue in my case: the external local storage was added using a relative path that made the file_exists function in lib/private/Files/Storage/Local.php (at line 231) fail, because it was called with an incorrect relative path. Modifying the relative path to an absolute path in the GUI fixed the issue.
@ppattard @systemofapwne @stjosh does this works for you too?
Thank you for the reply.
Unfortunately, I already use absolute paths.
On my VM, I mounted my NAS in /mnt/nas. That location on the otherhand is then overlayed via docker to the container, where I am running nextcloud in it. Here, the mount point is simply /nas. In the nextcloud gui, I have set that path (/nas). Yet, direct sharing to other people does not work (sharing via a link on the otherhand still works).
@ppattard @systemofapwne @stjosh does this works for you too?
Thanks, however, the error message you describe and the one which is originally described in this issue is differing quite a bit (see @ManOki 's comment above)
@stjosh Nope, still not working for me. I'm using an absolute path as well and still not working despite the recent updates. I still believe the issue is related to permissions as commenting the code mentioned above makes it work (at the price of losing all security...).
Same problem for me :(
When I try to share an external folder, an error message appears and the folder is not shared. No log entry is generated.
Seems to be broken since one oder two versions ago, because it worked some time ago...
EDIT: Same error in 18.0.4
Push, still cannot share external folders...
Please let me know if I can help somehow.
EDIT: Installed 19.0.0 RC3. Same error.
@ppattard where did you find $permissions (which is = $share->getNode()->getPermissions() | DELETE | UPDATE) = 27 = READ | UPDATE | DELETE | SHARE in the code? I can't find it. Or is it debug output?
Hi,
Same problem here, with release 19.0.0. Nothing on log.
Ready for tests if needed.
Thank you.
@ppattard where did you find
$permissions (which is = $share->getNode()->getPermissions() | DELETE | UPDATE) = 27 = READ | UPDATE | DELETE | SHAREin the code? I can't find it. Or is it debug output?
@codingHahn Just a few lines before the line I mentioned there is the assignment of $permissions (it is inside an if...else and I tested that it ends up in the else). For the values, yes I added some extra debug logs to find it.
Thank you @cdammanintopix !!!
I'm using nextcloud 19.0.0 in docker container and some "local" external storage, which is a NFS share on host. I was able to create/copy files/folders onto that storage, but not able to move/share with "not writable" and "unable to load share..." error messages.
The defined local share had a green flag.
I mounted the volume in docker-compose:
"/mnt/nas/nextcloud:/var/www/html/nas"
and in nextcloud external storage configuration with simple location relative path "nas".
Once I changed the location to absolute path to:
"/var/www/html/nas"
Evyrything started to work as it should!
I am mounting a local path with External Storage and have exactly the same problem IF i check the "Read Only" Box in the external storage settings. If i mount them writable, sharing with other users works. I can then revoke write permission from them, so this is a workaround for me. Time to set default share permissions to READ only i guess. This is on Version 19.0.0 .
Very good findings. I was able to reproduce this behavior. This is a bit annoying though, but works for me right now: I am anyway mounting a read-only FS right now, but want to switch to RW at some point. I hope this bug gets fixed in the near future
Same problem for me :(
When I try to share an external folder, an error message appears and the folder is not shared. No log entry is generated.
Seems to be broken since one oder two versions ago, because it worked some time ago...EDIT: Same error in 18.0.4
My share problem was solved after upgrading Nextcloud from 18.0.6 to 18.0.7.
Solved for me as well after the update to 18.0.7
Updating to docker/nextcloud:latest (seems to be 19.0.1) fixed it for me too: I can share external storage with ro. Fantastic!
It does work for me with NC19.0.1, too.
But there is still a problem, if the external share is offline. If the original sharer does not log into NC after the share is gone offline, the user, who received the share does not even see his own files. see #16880
I confirm, version 19.0.1 fixes the issue. Hence closing the ticket.
Most helpful comment
Push, still cannot share external folders...
Please let me know if I can help somehow.
EDIT: Installed 19.0.0 RC3. Same error.