Skip to content

HTTPS-WebDAV mount on Windows failes if NC is installed to webserver-root #2979

Closed

Description

@michag86

Steps to reproduce

  1. Install Nextcloud to the webroot on the webserver
  2. Try to mount a webdav folder from nextcloud

Expected behaviour

The webdav folder should be mounted.

Actual behaviour

Error 0x80070043 “The network name cannot be found.” occurs

Server configuration

Operating system: CentOS 7
Web server: Apache 2.4
Database: MySQL
PHP version: 5.4
Nextcloud version: 10.0.1
Updated from an older Nextcloud/ownCloud or fresh install: OC8.2 -> NC 9.0 -> NC 10.0.1
Where did you install Nextcloud from: tar from website
Signing status: No errors have been found.

Client configuration

Operating system:
Windows 8.1 / Windows 10

Additional Informations

For ownCloud the problem is discussed here:
owncloud/core#26350
And here are the workarounds documented:
https://doc.owncloud.org/server/latest/admin_manual/issues/general_troubleshooting.html#troubleshooting-webdav
https://doc.owncloud.org/server/latest/user_manual/files/access_webdav.html?highlight=webdav#known-problems

Maybe Windows is not the only client that works this way:
https://www.ibm.com/support/knowledgecenter/SSHRKX_8.0.0/admin/webdav_http_options.html

The Windows Webdav Client Sends an OPTIONS to the root of the URL.
NC redirects to the login form (/index.php/login). The client sends an OPTIONS to this URL und gets 405 Method not allowed because there is no defined route in core/routes.php.

Possible Solution

If we add a route for / with method OPTIONS that redirects to /remote.php/webdav everything should work fine.

Activity

  1. MorrisJobke commented on Jan 9, 2017

    @MorrisJobke
    Member

    If we add a route for / with method OPTIONS that redirects to /remote.php/webdav everything should work fine.

    This solutions looks more sensible than to document this and let people run into this.

    @rullzer @LukasReschke @icewind1991 Opinions on this?

  2. rullzer commented on Jan 9, 2017

    @rullzer
    Member

    Mmmm I'm not sure. The issue I have with this is that it might lead to people not entering the full url and then running into other issues.

    I guess the bigger question is why do they not respect the url provided.

    Maybe adding the redirect is the easiest solution...

  3. michag86 commented on Jan 9, 2017

    @michag86
    ContributorAuthor

    @rullzer OPTIONS on / (or NC root) redirects to remote.php/webdav ?
    That would help 😄

  4. MorrisJobke commented on Jan 9, 2017

    @MorrisJobke
    Member

    server/lib/base.php

    Lines 1020 to 1028 in 54f96e5

    // Handle WebDAV
    if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
    // not allowed any more to prevent people
    // mounting this root directly.
    // Users need to mount remote.php/webdav instead.
    header('HTTP/1.1 405 Method Not Allowed');
    header('Status: 405 Method Not Allowed');
    return;
    }
    <- the PROPFIND is handled directly in the lib/base.php

  5. MorrisJobke commented on Jan 9, 2017

    @MorrisJobke
    Member

    @michag86 Could you give 6f31b73 a try?

  6. JulienPalard commented on Jan 24, 2017

    @JulienPalard

    NC 11.01 here, with or without 6f31b73, still got the Error 0x80070043 “The network name cannot be found.” on a Windows 8.1 (But works on Debian and MacOS).

  7. Flole998 commented on Feb 4, 2017

    @Flole998
    Contributor

    Sometimes Windows is a little broken and requests / even though the correct path is specified. When DavClnt is the user agent as it is when using net use to mount a share, it should redirect to the appropriate directory as in my pull request #3370. You still have to specify the correct path including remote.php/webdav to connect. This PR just fixes the weird windows behavior.

  8. michag86 commented on Mar 14, 2017

    @michag86
    ContributorAuthor

    Fixed with #3370

  9. added this to the Nextcloud 12.0 milestone on Mar 14, 2017
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