Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
michag86 opened this issue Jan 9, 2017 · 8 comments
Closed

Comments

@michag86
Copy link
Contributor

michag86 commented Jan 9, 2017

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.

@MorrisJobke
Copy link
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?

@rullzer
Copy link
Member

rullzer commented Jan 9, 2017

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

@michag86
Copy link
Contributor Author

michag86 commented Jan 9, 2017

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

@MorrisJobke
Copy link
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

@MorrisJobke
Copy link
Member

@michag86 Could you give 6f31b73 a try?

@JulienPalard
Copy link

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

@Flole998
Copy link
Contributor

Flole998 commented Feb 4, 2017

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.

@michag86
Copy link
Contributor Author

Fixed with #3370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants