Skip to content

Server2server - adding shared files/folder to your owncloud doesn't work #9786

Closed

Description

@kalletabur

I have issue with server2server files/folders sharing + adding
I know that there is reported similar issues before, like #9125, but I couln't find solution for me and I have log entries that I haven't find elsewhere

Steps to reproduce

  1. Install owncloud 7.0 RC3 + nginx + php5-fpm + mysql (I have 2 identical servers)
  2. Login web interface + add New folder or File (first server)
  3. Share folder or file with link
  4. Open link in new browser + click button "Add to your ownCloud" + give URL to my ownCloud (second server)
  5. Answer "Add remote share" to confirmation

Expected behaviour

Shared file/folder gets added to my ownCloud

Actual behaviour

Browser just gives error message
"Couldn't add remote share"

ownCloud log (data/owncloud.log)

Server (my owncloud, second server) has one log entry
{"reqId":"53cf6c3538127","app":"PHP","message":"Undefined offset: 1 at \/var\/www\/owncloud\/apps\/files_sharing\/lib\/external\/storage.php#52","level":3,"time":"2014-07-23T08:03:01+00:00","method":"POST","url":"\/index.php\/apps\/files_sharing\/external"}

This log entry is same for adding file and folder.

Server configuration

Both servers: Debian 7.5 + nginx + php5-fpm (5.4.4-14+deb7u12) + MySQL + ownCloud 7.0 RC 3

I have fresh owncloud install (both servers), so nothing has been added through apps.
To config.php I added only
'loglevel' => '0',

I have tested in 2 modes: no encryption and encryption enabled mode - both cases, same message.

Activity

  1. icewind1991 commented on Jul 23, 2014

    @icewind1991
    Contributor

    Is ownCloud installed directly at the server root? ('example.com' ipv 'example.com/owncloud')

    If so, can you test #9789

  2. kalletabur commented on Jul 23, 2014

    @kalletabur
    Author

    The ownCloud is installed directly at root, but 9789.patch didn't help - browser error "Couldn't add remote share" remains but now owncloud.log doesn't log any messages. Tested both file and folders. Should I install and test with 7.0.0?
    Update: I tested it with 7.0.0 and still doesn't work (used the same patch)

  3. kalletabur commented on Aug 5, 2014

    @kalletabur
    Author

    I tested it with latest, 7.0.1-0 version (both servers) and still get browser feedback
    "Couldn't add remote share"
    Only log entry I get is webserer log entry (after I have inserted the password and clicked button "Add remote share")

    IPADDR - - [05/Aug/2014:10:04:42 +0000] "POST /index.php/apps/files_sharing/external HTTP/1.1" 200 76 "https://HOSTNAME/index.php/apps/files" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
    
  4. kalletabur commented on Aug 6, 2014

    @kalletabur
    Author

    I tested it with Apache and got same message "Couldn't add remote share" when mod_rewrite wasn't enabled.

    PS. I didn't mention that my data directory isn't inside /var/www/owncloud but in /var/ocdata

  5. karlitschek commented on Aug 6, 2014

    @karlitschek
    Contributor

    @icewind1991 @schiesbn Can you have a look please?

  6. schiessle commented on Aug 12, 2014

    @schiessle
    Contributor

    I tested it with Apache and got same message "Couldn't add remote share" when mod_rewrite wasn't enabled.

    mod_rewrite needs to be enabled in order to work correctly.

  7. simsasaile commented on Aug 12, 2014

    @simsasaile

    Hi Björn,

    as far as I know mod_rewrite effects only apache, but what then we use nginx? The config provided here: http://doc.owncloud.org/server/7.0/admin_manual/installation/installation_source.html#nginx-configuration includes some rewrite rules, but maybe not enough?

    Because server2server-sync is not working although I installed it following the onwcloud 7 admin manual.

  8. icewind1991 commented on Aug 12, 2014

    @icewind1991
    Contributor

    mod_rewrite is required in certain apache configurations (non mod_php iirc) to make the authentication headers working.

    Besides that rewrites are not required.

    Can you test if the server (that the share is added to) can talk to remote server (where the files are stores) in general trough the provided (i.e. wget remote-server.com/owncloud)

  9. schiessle commented on Aug 12, 2014

    @schiessle
    Contributor

    @simsasaile sorry, I just re-read you message. I think it was a misunderstanding from my side. I thought that you use apache without mod_rewrite. Now I realized that you use nginx and just pointed out that you got the same error with apache and without mod_rewrite.

  10. simsasaile commented on Aug 12, 2014

    @simsasaile

    Thanks for the reply,

    the server can talk to the remote server, but when I do wget remote-server.com
    (of course I replaced remote-server.com with the actual server name)
    I get a certificate warning (it's a self signed certificate)
    could that be the problem?

    GnuTLS: A TLS warning alert has been received.
    GnuTLS: received alert [112]: The server name sent was not recognized
    ERROR: The certificate of ‘remote-server.com’ is not trusted.
    ERROR: The certificate of ‘remote-server.com’ hasn't got a known issuer.
    
  11. icewind1991 commented on Aug 13, 2014

    @icewind1991
    Contributor

    Yes, that's probably the issue, self-signed certificates are currently not supported for server-server sharing

  12. simsasaile commented on Aug 13, 2014

    @simsasaile

    Oh that's a bad news, I think many, maybe even most people deploy owncloud with self signed certificates. Will it be supported in the future?

  13. icewind1991 commented on Aug 13, 2014

    @icewind1991
    Contributor

    It's planned

  14. schiessle commented on Aug 14, 2014

    @schiessle
    Contributor

    @icewind1991 you can already import the root certificate you want to trust in the personal settings for the external storage app. For external storage mounts this already works for webdav, so maybe we just need to move the setting out of the external storage app now that the webdav client was moved to core? If the root certificate is uploaded it should also work for the server-to-server share.

  15. added this to the milestone on Aug 14, 2014
  16. modified the milestones: , on Sep 2, 2014
  17. PVince81 commented on Sep 5, 2014

    @PVince81
    Contributor

    Fixed by #10420

  18. kalletabur commented on Sep 17, 2014

    @kalletabur
    Author

    My feedback to this issue is .. this still isn't working.
    Maybe this is because I use nginx or because I don't correctly use certificates (I imported our Sub CA certificate).
    I checked the documentation and there is nothing said about how to use self-signed certificates and nothing new added about nginx.
    I updated owncloud version and also patched oC with 10420.

  19. pmalek commented on Nov 19, 2014

    @pmalek

    I use ownCloud 7.0.3 on Ubuntu with nginx and after adding self signed certificate of another server I was able to successfully add a share from that remote server.

  20. kalletabur commented on Nov 21, 2014

    @kalletabur
    Author

    Thanks for letting know, I'll test the 7.0.3

  21. mjmunger commented on Jan 14, 2015

    @mjmunger

    If you're deploying this with self-signed certs, you need to also run your own CA and distribute the CA certificates within your organization. Tutorial here: http://learnlinuxonline.com/servers/openssl-generate-certificates-csrs-self-signed-ca-certificates

  22. atroxix commented on Feb 2, 2015

    @atroxix

    It also worked with accessing shared files and remote folders (external storage) on OwnCloud 8.0beta2 from OwnCloud 7.0.2.
    Ie. request going something like "OC-7.0.2 -> OC-8.0beta2/sharedfolder" and "OC-7.0.2 -> OC-8.0beta2/folder". If you know what I mean :)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions