Skip to content

Cannot add remote share in some environments #9125

Closed

Description

@PVince81

Steps

  1. Open public link from remote server
  2. Enter local server URL, click "Save"
  3. In the prompt box click "Yes"

Expected result

Remote share was mounted

Actual result

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.

Activity

  1. added this to the ownCloud 7 CE milestone on Jun 20, 2014
  2. PVince81 commented on Jun 24, 2014

    @PVince81
    ContributorAuthor

    I'll try to debug this tomorrow. Assigning to self.

  3. self-assigned this
    on Jun 24, 2014
  4. PVince81 commented on Jun 25, 2014

    @PVince81
    ContributorAuthor

    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.

  5. schiessle commented on Jun 26, 2014

    @schiessle
    Contributor

    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.

  6. PVince81 commented on Jun 26, 2014

    @PVince81
    ContributorAuthor

    Assigning to you as I can't investigate on my side.

  7. craigpg commented on Jun 26, 2014

    @craigpg

    Fix for oC7 CE

  8. PVince81 commented on Jun 30, 2014

    @PVince81
    ContributorAuthor

    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.

  9. PVince81 commented on Jun 30, 2014

    @PVince81
    ContributorAuthor

    Turns out that the target environment didn't have the "rewrite" module enabled.
    After enabling it the authentication works properly.

    It looks like our .htaccess file is doing something with the Authorization header 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

  10. bantu commented on Jun 30, 2014

    @bantu

    @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).

  11. PVince81 commented on Jun 30, 2014

    @PVince81
    ContributorAuthor

    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.

  12. bantu commented on Jun 30, 2014

    @bantu

    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

  13. karlitschek commented on Jun 30, 2014

    @karlitschek
    Contributor

    @bantu Unfortunately people do. And there are use-cases for that. You can run different vhosts with different user privileges.

  14. schiessle commented on Jun 30, 2014

    @schiessle
    Contributor

    I just checked it. The test server uses mod_php, but it still needs mod_rewrite to authenticate the server-to-server share.

  15. bantu commented on Jun 30, 2014

    @bantu

    @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.

  16. bantu commented on Jun 30, 2014

    @bantu

    I just checked it. The test server uses mod_php, but it still needs mod_rewrite to authenticate the server-to-server share.

    That is very interesting. Maybe Apache thinks that no module should see any auth headers now.

  17. bantu commented on Jun 30, 2014

    @bantu
  18. karlitschek commented on Jun 30, 2014

    @karlitschek
    Contributor

    @bantu True. FastCGI is of course better.

  19. nikosamus commented on Sep 9, 2014

    @nikosamus

    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?

  20. mhterres commented on Dec 6, 2014

    @mhterres

    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.

  21. mhterres commented on Dec 6, 2014

    @mhterres

    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.

  22. locked as resolved and limited conversation to collaborators on Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions