You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot add remote share in some environments #9125
Message "Couldn't add remote share".
Nothing appears in the logs neither in the local server nor the remote server.
This was mentionned by @schiesbn before and I just happen to have reproduced it in a new setup (remote server is a VM and local server is my workstation)
Needs further research in either of our setups until we find out what exact criteria is causing this.
Setting to OC 7 CE as it could happen for other users.
I debugged it a little bit more. I also can't open the public link with cadaver using the token as username. With cadaver I get a authentication error. With the debugger I discovered that PublicAuth in apps/files_sharing/lib/connector/publicauth.php gets initialized but the method validateUserPass() never gets called.
Some debugging revealed that some servers don't have the HTTP header "Authorization", or at least PHP doesn't expose it so SabreDAV which makes the token authentication fail.
Target server was Ubuntu 12.04 with PHP 5.3.10 and Apache 2.2.22
Working server was openSUSE 12.1 with PHP 5.4.20 with Apache 2.4.6
@karlitschek You seem to have missed the point I was trying to make. People don't use CGI because it spawns a PHP process when the request comes in, which is usually very slow or at least inefficient. Instead people are using FastCGI/ FPM, usually with pools of PHP processes already running.
It doesn't work for me. I'm using nginx + php-fpm with the nginx config posted on documentation, no errors at owncloud.log and nginx logs in debug mode looks normal, i mean PATH_INFO looks good
"PATH_INFO: /apps/files_sharing/external" any idea?
Just to let you know guys that I'm using two different owncloud installations (with different domains) in the same server and I can't add remote shares neither.
I'm not using a self signed certificate, but now I discovered that is was a problem with StartCom (StartSSL) certificates:
ERROR: cannot verify owncloud.mydomain.com.br's certificate, issued by ‘/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 1 Primary Intermediate Server CA’:
Unable to locally verify the issuer's authority.
Activity
PVince81 commentedon Jun 24, 2014
I'll try to debug this tomorrow. Assigning to self.
PVince81 commentedon Jun 25, 2014
In my environment the remote server has two section, the URL is like "http://example.com/test/owncloud/", but it was converted to "http://example.com/test" because it was assuming that there is only one level of path.
I'll submit a PR for that one.
As for @schiesbn 's issue it's probably something different.
schiessle commentedon Jun 26, 2014
I debugged it a little bit more. I also can't open the public link with cadaver using the token as username. With cadaver I get a authentication error. With the debugger I discovered that PublicAuth in apps/files_sharing/lib/connector/publicauth.php gets initialized but the method validateUserPass() never gets called.
PVince81 commentedon Jun 26, 2014
Assigning to you as I can't investigate on my side.
craigpg commentedon Jun 26, 2014
Fix for oC7 CE
PVince81 commentedon Jun 30, 2014
Some debugging revealed that some servers don't have the HTTP header "Authorization", or at least PHP doesn't expose it so SabreDAV which makes the token authentication fail.
Target server was Ubuntu 12.04 with PHP 5.3.10 and Apache 2.2.22
Working server was openSUSE 12.1 with PHP 5.4.20 with Apache 2.4.6
Needs further research.
PVince81 commentedon Jun 30, 2014
Turns out that the target environment didn't have the "rewrite" module enabled.
After enabling it the authentication works properly.
It looks like our
.htaccessfile is doing something with theAuthorizationheader when the "rewrite" module is enabled.This means that having the "rewrite" module MUST be enabled on the remote server to have server to server sharing working.
Can someone help clear this out ? @bantu @nickvergessen @DeepDiver1975 @karlitschek
bantu commentedon Jun 30, 2014
@PVince81 Yes, that seems to be a problem mostly on PHP via CGI on Apache. Not sure about FastCGI, probably also affected. Also see https://github.com/phpbb/phpbb/blob/develop-ascraeus/phpBB/.htaccess#L5-L9 I don't think there is a way around it. Either enable rewrite or don't use CGI (or don't use Apache).
PVince81 commentedon Jun 30, 2014
Is there any reason why an admin would want to disable the rewrite module ? Security probably ? (CC @LukasReschke).
Looks like our docs already recommend enabling it, so I guess we can close this issue.
bantu commentedon Jun 30, 2014
Nobody should be using PHP via CGI nowadays, at least not for ownCloud. So these are probably using FastCGI/FPM which seems to be affected as well. There is some additional information in http://php.net/manual/en/features.http-auth.php and I found some alternative solutions and an explanation of the root problem (in german) here: http://www.administrator.de/wissen/zugriff-auf-http-authorization-in-php-155065.html#toc-7
karlitschek commentedon Jun 30, 2014
@bantu Unfortunately people do. And there are use-cases for that. You can run different vhosts with different user privileges.
schiessle commentedon Jun 30, 2014
I just checked it. The test server uses mod_php, but it still needs mod_rewrite to authenticate the server-to-server share.
bantu commentedon Jun 30, 2014
@karlitschek You seem to have missed the point I was trying to make. People don't use CGI because it spawns a PHP process when the request comes in, which is usually very slow or at least inefficient. Instead people are using FastCGI/ FPM, usually with pools of PHP processes already running.
bantu commentedon Jun 30, 2014
That is very interesting. Maybe Apache thinks that no module should see any auth headers now.
bantu commentedon Jun 30, 2014
Depending on the password used, this may also be an issue caused by strip_tags(). https://github.com/owncloud/core/blob/master/lib/base.php#L477
karlitschek commentedon Jun 30, 2014
@bantu True. FastCGI is of course better.
nikosamus commentedon Sep 9, 2014
It doesn't work for me. I'm using nginx + php-fpm with the nginx config posted on documentation, no errors at owncloud.log and nginx logs in debug mode looks normal, i mean PATH_INFO looks good
"PATH_INFO: /apps/files_sharing/external" any idea?
mhterres commentedon Dec 6, 2014
Just to let you know guys that I'm using two different owncloud installations (with different domains) in the same server and I can't add remote shares neither.
mhterres commentedon Dec 6, 2014
I'm not using a self signed certificate, but now I discovered that is was a problem with StartCom (StartSSL) certificates:
ERROR: cannot verify owncloud.mydomain.com.br's certificate, issued by ‘/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 1 Primary Intermediate Server CA’:
Unable to locally verify the issuer's authority.