nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.74k stars 4k forks source link

Can't share folders by email, files work fine #4219

Closed krisj closed 7 years ago

krisj commented 7 years ago
### Steps to reproduce 1. create a folder 2. try sharing it via email (share by mail app enabled) 3. observe error message ### Expected behaviour being able to share a folder ### Actual behaviour I get an UX error saying "Error" In the chrome dev tools I see a 403 returned on the json request going to "https://cloud.mydomain.net/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json" with POST data: "shareType=4&shareWith=myemail%40gmail.com&permissions=31&path=%2FNotes" ### Server configuration **Operating system**: CentOS 7.3 **Web server:** Nginx **Database:** mysql 5.5.52 **PHP version:** 7.0.16 **Nextcloud version:** (see Nextcloud admin page) 11.0.2 daily **Updated from an older Nextcloud/ownCloud or fresh install:** updated from Owncloud 9... **Where did you install Nextcloud from:** github **Signing status:**
Signing status ``` Login as admin user into your Nextcloud and access http://example.com/index.php/settings/integrity/failed paste the results here. ``` No errors have been found.
**List of activated apps:**
App list ``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your Nextcloud installation folder ```
**Nextcloud configuration:**
Config report ``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder or Insert your config.php content here. Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …) ```
**Are you using external storage, if yes which one:** local/smb/sftp/... **Are you using encryption:** yes/no **Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/... #### LDAP configuration (delete this part if not used)
LDAP config ``` With access to your command line run e.g.: sudo -u www-data php occ ldap:show-config from within your Nextcloud installation folder Without access to your command line download the data/owncloud.db to your local computer or access your SQL server remotely and run the select query: SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap'; Eventually replace sensitive data as the name/IP-address of your LDAP server or groups. ```
### Client configuration **Browser:** **Operating system:** ### Logs #### Web server error log
Web server error log ``` Insert your webserver log here ```
#### Nextcloud log (data/nextcloud.log)
Nextcloud log ``` Insert your Nextcloud log here ```
#### Browser log
Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
MorrisJobke commented 7 years ago

cc @schiessle

schiessle commented 7 years ago

I can't reproduce it. Do you have any additional errors in your apache error log or the nextcloud.log? Would be also interesting to know if there is anything in the response body of the request.

krisj commented 7 years ago

@schiessle I will give you as much as I can, including response etc. you can even have access to the system if you like.

This instance runs on Nginx by the way. So, could be to do with that of course.

faichelbaum commented 7 years ago

on my side, I'm not using Apache: I'm using a n-tier setup with nginx (with SSL) + php-fpm and files stored on an NFS I don't have additional error messages besides the CSRF error if I click on the URL provided in the JS console

krisj commented 7 years ago

@faichelbaum you would have to look at the response body in the network activity...

@schiessle My response body is in fact a full 403 page instead of json which I believe would be normal expected response?

faichelbaum commented 7 years ago

`<!DOCTYPE html>

Actility Shared Storage
  • Access forbidden

`

faichelbaum commented 7 years ago

Hi guys, any update ?

schiessle commented 7 years ago

I still have no idea how to reproduce it... @rullzer do you have more luck?

rullzer commented 7 years ago

I'm betting the error message is NGINX's fault.

Please make sure that

error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;

is removed from your nginx config.

faichelbaum commented 7 years ago

That worked !

thanks @rullzer

krisj commented 7 years ago

@rullzer thanks, thats it, that worked! I wonder why were they recommended in the Doc in the first place. Does it break or remove some other functionality if removed? Certainly fixes this issue though.

rullzer commented 7 years ago

Aaah it is still in the old docs I think. Let me fix that right away.

It is to show fancy error pages. But it should only do that when the server can't find the file. If a status code is set by php it should not meddle with it. My nginx foo is not good enough to handle that.

rullzer commented 7 years ago

Doc pr in https://github.com/nextcloud/documentation/pull/409

rullzer commented 7 years ago

Anyway since it is fixed now lets close this.

Micha-Btz commented 7 years ago

I have the same problem with an apache. I chose the mail nc finds the user from my carddav entrys and then it goes wrong.Sharing a single file works. NC 11.0.3 Sharing App 1.0.1 Sharing Web Hoster error from firefox web console, nothing in nextcloud.log

https://owncloud.xxxxx/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json POST Data: shareType=4 shareWith=xxxxxx@online.de permissions=15 path=/share Request header POST /ocs/v2.php/apps/files_sharing/api/v1/shares?format=json HTTP/1.1 Host: owncloud.xxxxx User-Agent: Mozilla Firefox 53.03 Accept: application/json, text/javascript, /; q=0.01 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Content-Type: application/x-www-form-urlencoded; charset=UTF-8 requesttoken: BnA9vPxcU9H9B/xLchvKC1j/lmvU2s5keiwj9cV12kw=:Yjlbzo8yGueab8gBKHqkXiKOwzuBr/tVFlZlnrJHvH0= OCS-APIREQUEST: true X-Requested-With: XMLHttpRequest Content-Length: 70 Cookie: nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; oca2cf00c606=fbb476sqd1201lbve3i60ur864; oc_sessionPassphrase=r1cfyGXtgVf7ycLmtHFk64%2FLKQ95GFMguy%2F9SBUQcVeEWmEHDsuUGAx1FB8Csd96e%2FGn2GQIYPXRHNSyuWK%2BWTSToAiYhAIiYP1o%2B4v1898YFhrow%2BAGeSFGL30Dh6oo DNT: 1 Connection: keep-alive Response header HTTP/1.1 403 Forbidden Date: Tue, 23 May 2017 05:30:20 GMT Server: Apache/2.4.10 (Debian) X-Powered-By: PHP/7.0.16 Expires: Thu, 19 Nov 1981 08:52:00 GMT Pragma: no-cache X-Xss-Protection: 1; mode=block X-Content-Type-Options: nosniff X-Frame-Options: Sameorigin X-Robots-Tag: none X-Download-Options: noopen X-Permitted-Cross-Domain-Policies: none Cache-Control: no-cache, must-revalidate Content-Security-Policy: default-src 'none' Content-Length: 102 Keep-Alive: timeout=1, max=1000 Connection: Keep-Alive Content-Type: application/json; charset=utf-8

then the webinterface is showing Public upload not allowed.

I'm not the only one with this problem it seems. https://help.nextcloud.com/t/mail-sharing-gives-public-access-error/12207

Micha-Btz commented 7 years ago

@rullzer Can you please reopen this since it is not fixed for all. https://help.nextcloud.com/t/mail-sharing-gives-public-access-error/12207