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

9.1.1 - Windows webclient (WebDAV) service not starting when connecting over HTTPS #26350

Closed
AndrinS opened this issue Oct 12, 2016 · 30 comments
Closed

Comments

@AndrinS
Copy link

AndrinS commented Oct 12, 2016

Steps to reproduce

  1. Install an SSL Certificate and enable it in your apache2 configuration
  2. Try to connect with Windows after a fresh reboot with no other active network shares (or stop the webclient service manually) with HTTPS

Optional:
Use the official ownCloud virtual machine image (e.g http://download.owncloud.org/community/production/vm/Ubuntu_14.04-owncloud-9.1.1-1.1-201609201317.qcow2.zip)

Expected behaviour

The WebClient service should start as usual (9.0.5 and below) and it should promt for the credentials.

Actual behaviour

The WebClient service won't start and the connection fails. (0x80070043 The Network Name Cannot Be Found)

Server configuration

Operating system: Ubuntu 14.04.5 LTS 64bit
Web server: Apache/2.4.7
Database: MySQL Ver 14.14 Distrib 5.5.52
PHP version: PHP 5.5.9-1ubuntu4.20
ownCloud version: 9.1.1.3
Updated from an older ownCloud or fresh install: fresh install
Where did you install ownCloud from: http://download.owncloud.org/community/production/vm/Ubuntu_14.04-owncloud-9.1.1-1.1-201609201317.qcow2.zip
Signing status (ownCloud 9.0 and above): ?

https://domain.com/owncloud/index.php/settings/integrity/failed: No errors have been found.

List of activated apps:

  • activity: 2.3.2
  • comments: 0.3.0
  • dav: 0.2.6
  • federatedfilesharing: 0.3.0
  • federation: 0.1.0
  • files: 1.5.1
  • files_pdfviewer: 0.8.1
  • files_sharing: 0.10.0
  • files_texteditor: 2.1
  • files_trashbin: 0.9.0
  • files_versions: 1.3.0
  • files_videoplayer: 0.9.8
  • firstrunwizard: 1.1
  • gallery: 15.0.0
  • notifications: 0.3.0
  • provisioning_api: 0.5.0
  • systemtags: 0.3.0
  • templateeditor: 0.1
  • updatenotification: 0.2.1

The content of config/config.php:

{
    "system": {
        "updatechecker": false,
        "instanceid": "oc5w5e2e3e0i",
        "trusted_domains": [
            "localhost"
        ],
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "\/var\/www\/owncloud\/data",
        "overwrite.cli.url": "http:\/\/localhost\/owncloud",
        "dbtype": "mysql",
        "version": "9.1.1.3",
        "dbname": "oc",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "maintenance": false
    }
}

The content of config/config.php: Its basically the by default generated config from the installer

    <VirtualHost *:443>
    ServerName ***REMOVED SENSITIVE VALUE***
    Header add Strict-Transport-Security: "max-age=15768000;includeSubdomains" 
    SSLEngine on

    ### SETTINGS ###    

    DocumentRoot /var/www/owncloud
    <Directory /var/www/owncloud>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>

    ### LOCATION OF CERT FILES ### 

    SSLCertificateFile ***REMOVED SENSITIVE VALUE***.crt
    SSLCertificateKeyFile ***REMOVED SENSITIVE VALUE***.key

    ErrorLog /var/log/oc/error.log
    CustomLog /var/log/oc/access.log combined

    </VirtualHost>

Are you using external storage: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Used default Windows (File) Explorer (not IE) to add a new network share

Operating system:
Windows 7 64 bit SP1

Logs

Web server error log

**access.log:**
192.168.166.162 - - [12/Oct/2016:09:30:00 +0200] "OPTIONS / HTTP/1.1" 302 3043 "-" "DavClnt"
192.168.166.162 - - [12/Oct/2016:09:30:00 +0200] "OPTIONS /index.php/login HTTP/1.1" 405 869 "-" "DavClnt"
192.168.166.162 - - [12/Oct/2016:09:30:00 +0200] "OPTIONS / HTTP/1.1" 302 1173 "-" "DavClnt"
192.168.166.162 - - [12/Oct/2016:09:30:00 +0200] "OPTIONS /index.php/login HTTP/1.1" 405 869 "-" "DavClnt"

ownCloud log (data/owncloud.log)

No information

Browser log

No information

Workarround

When the WebClient Service is started manually everything works fine. Other WebDAV clients also seem to work fine as well.

Connecting without HTTPS also works and starts the WebClient service automatically.

@PVince81
Copy link
Contributor

No idea, is this an ownCloud bug ? Is OC returning something that the WebClient service doesn't like when starting automatically ?

@PVince81
Copy link
Contributor

did it work with previous OC versions ? (just to be sure it's not a regression)

@AndrinS
Copy link
Author

AndrinS commented Oct 12, 2016

Yes it did work with previous versions (both HTTP and HTTPS).

@PVince81 PVince81 added this to the 9.1.2 milestone Oct 12, 2016
@ghost
Copy link

ghost commented Oct 12, 2016

There was a PR for the nginx documentation recently also reporting this " (0x80070043 The Network Name Cannot Be Found)": owncloud-archive/documentation#2668

The PR also contains additional info

@AndrinS
Copy link
Author

AndrinS commented Oct 12, 2016

This seems to fix the issue.

Added this to the site configuration.

    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^(/)$ [NC]
    RewriteCond %{REQUEST_METHOD} ^(OPTIONS)$
    RewriteRule .* https://%{SERVER_NAME}/owncloud/remote.php/webdav/ [R=301,L]

@adduxa
Copy link

adduxa commented Oct 12, 2016

Yes it did work with previous versions (both HTTP and HTTPS).

I'm using ownCloud scince version 8.0.2 (March 2015) in HTTPS-only mode and all this time I had this problem.

@fossxplorer
Copy link

fossxplorer commented Oct 12, 2016

Hmm same here too using oC 8.2!
Gonna test your fix @AndrinS

@AndrinS
Copy link
Author

AndrinS commented Oct 13, 2016

Made a clean install of oC 9.0.5 and it works without the fix

10.1.28.12 - - [13/Oct/2016:11:17:06 +0200] "OPTIONS / HTTP/1.1" 200 13575 "-" "DavClnt"
10.1.28.12 - - [13/Oct/2016:11:17:09 +0200] "OPTIONS /owncloud/remote.php/webdav HTTP/1.1" 401 3416 "-" "Microsoft-WebDAV-MiniRedir/6.1.7601"
///--> Prompts for credetials
/// After login:
10.1.28.12 - - [13/Oct/2016:11:17:20 +0200] "OPTIONS /owncloud/remote.php/webdav HTTP/1.1" 401 3416 "-" "Microsoft-WebDAV-MiniRedir/6.1.7601"
10.1.28.12 - admin [13/Oct/2016:11:17:21 +0200] "OPTIONS /owncloud/remote.php/webdav HTTP/1.1" 200 1109 "-" "Microsoft-WebDAV-MiniRedir/6.1.7601"

Goin to test this with 9.0 and 8.2

@ghost
Copy link

ghost commented Oct 13, 2016

Made a clean install of oC 9.0.5 and it works without the fix

Ahhh, that might be a good starting point. In newer oC Versions the "index.php-less" URLs are not enabled by default. Could be the difference here.

@chriseqipe
Copy link
Contributor

chriseqipe commented Oct 13, 2016

I just tested a modified .htaccess and it works with Windows 7.

<IfModule mod_rewrite.c>
  # owncloud is under / and https!
  RewriteCond %{REQUEST_URI} ^/$ [NC]
  RewriteCond %{REQUEST_METHOD} ^OPTIONS$
  # If using ipv6 HTTP_HOST should be the better choice
  RewriteRule .* https://%{HTTP_HOST}/remote.php/webdav/ [R=301,L]
</IfModule>

@wioxjk
Copy link

wioxjk commented Oct 18, 2016

What kind of certificate are you using?

@chriseqipe
Copy link
Contributor

Wildcard from https://www.ssls.com/

@PVince81 PVince81 modified the milestones: 9.1.3, 9.1.2 Oct 20, 2016
@fuco809
Copy link

fuco809 commented Nov 2, 2016

same behaviour here, but i found a temp solution in windows7: try to connect your webdav url by IP address instead of the servername. this fails too (with another error) but before it asks your credentials. after this the webdav can be mounted with the name and it works until the next reboot. maybe helpful for somebody.

UPDATE - the IP based mount just starts the "WebClient" in windows.
as i tested with an old owncloud 8.2 this problem does not appear, but with newer version 9+. how to solve it on server-side? the conditional rewrite rule doesnt work for me.

UPDATE2 [solved]: we have a reverse proxy in front of the owncloud apache. this proxy server answers on the first windows-explorer-webdav request ( / OPTIONS) with a 302 redirect instead of the expected 200. now i rewrite on the reverse proxy this and the problem dissappears. if answer is a 200, then Webclient on windows will start.

RewriteEngine On
RewriteCond %{REQUEST_URI} ^(/)$ [NC]
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]

@jaslocum
Copy link

My clients are running windows 10. I started experiencing this behavior when I upgraded to ownCloud 9.1.1. From the advice above, I checked my WebClient service settings. I changed my startup type from "Manual" to "Automatic" and I can now connect after a fresh reboot without the "The Network Name Cannot Be Found" failure. I tried the rewrite rule's detailed in the previous posts, but I removed them after I changed my WebClient service startup setting.

@techatdd
Copy link

I had the same problem since updating to 9.1 (and 9.1.1 and 9.1.2)
AndrinS fix for adding
RewriteCond %{REQUEST_URI} ^(/)$ [NC]
RewriteCond %{REQUEST_METHOD} ^(OPTIONS)$
RewriteRule .* https://%{SERVER_NAME}/owncloud/remote.php/webdav/ [R=301,L]

after my "RewriteEngine On" entrys worked perfectly well.

can somebody pull that fix to upstream?

@ghost
Copy link

ghost commented Nov 29, 2016

@techatdd I don't think there is a need to push this to everyone out there by default. This would risk breaking other stuff and clients for people don't need that workaround for buggy 3rdparty clients.

The known workaround was already found by you in owncloud-archive/documentation#2717 so that documentation there should be more then enough.

Ref. to the documentation containing the fix: https://doc.owncloud.org/server/9.2/user_manual/files/access_webdav.html#known-problems

@techatdd
Copy link

the fix in the documentation needs a administratior configuration change for every client using windows buid-in webdav (tested in win7/8/10). this is not a fix, because most of ouer oc users have systems not mainteined be me. the simple fix in .htaccess from AndrinS changed thinks back to work for all users at a time.

Since AndrinS tested it with a fresh image, i think most (or all) oc users have this regression. sure it have to be testetd that it dont break other thinks, but a manual client configuration change is not solution...

@ghost
Copy link

ghost commented Nov 29, 2016

@techatdd So if you need that change then just deploy it to your .htaccess file (might be redone during an update) or to your global webserver config (will survive updates).

but a manual client configuration change is not solution...

Pushing a fragile workaround like this to all users is also no solution... It also won't work if it is added to oCs .htaccess and oC is installed in a subdir.

The best thing what should be done here is to also document the .htaccess / webserver config to the documentation / documentation wiki.

@techatdd
Copy link

I already did and you are right, i dont overview what it could break.
But it look like at least many installation are affected (i also use a often used vmware image from techandme) so somebody should test, what could break with this change. i did not found anything, but do not use a app for example.

At leat the documentation should mention this fix. because the solution with change the service start type in windows is at least a workaround for small installations.
I dont see the point why we shoud argue. Thanks to AndrinS for a solution that helped me.

@AndrinS
Copy link
Author

AndrinS commented Nov 29, 2016

@techatdd I'm happy this workarround works for you.

@RealRancor keep in mind that you need administrative rights to modify the Windows services. This could be difficult in some cases.

And also as mentioned: It worked in 9.0.x without any workarrounds!

@gassan
Copy link

gassan commented Mar 21, 2017

why not mach simpler?

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^(DavClnt)$
RewriteCond %{REQUEST_METHOD} ^(OPTIONS)$
RewriteRule .* "-" [R=401,L]

@ghost
Copy link

ghost commented Mar 21, 2017

If this is possible to fix via rewrite rules maybe some one can just create a pull request to the .htaccess of ownCloud to workaround this from ownCloud side?

@adduxa
Copy link

adduxa commented Mar 21, 2017

Already did: owncloud-archive/documentation#2668
TL;DR: It will not work for subdir installations + affects small ammount of Windows users
I provided fix in documentation: owncloud-archive/documentation#2717

@ghost
Copy link

ghost commented Mar 21, 2017

@adduxa But if it can be included directly into https://github.com/owncloud/core/blob/v9.1.4/.htaccess#L51-L62 its IMHO the better way as far less people will read the documentation.

@adduxa
Copy link

adduxa commented Mar 21, 2017

@kdslkdsaldsal I agree, but PR was closed

@ghost
Copy link

ghost commented Mar 21, 2017

@adduxa Yes, but from what i can see owncloud-archive/documentation#2668 was about nginx and you closed it on your own. A .htaccess file is also not used at all by nginx, this is something apache specific.

@gassan
Copy link

gassan commented Mar 21, 2017

3 lines are enough too

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^(DavClnt)$
RewriteRule .* "-" [R=401,L]

But user have to type password two times.

It would be good to find right response code, which would kick off Windows "DavClnt"

P.S. It must work with subdir installations too

@adduxa
Copy link

adduxa commented Mar 21, 2017

@kdslkdsaldsal Hmm, oh that's right... Because it turned out that this is more Windows bug, then ownCloud.
Yes, I know about .htaccess, I just use nginx and provided a fix for what I know better.

@gassan
Copy link

gassan commented Mar 21, 2017

One more interesting thing. After reboot wenn Windows beginns negotioaion with Apache's own WebDav Server (permanently mounted network drive), it begins with "right" "Microsoft-WebDav-MiniRedir" Client. How Windows know that Apache WebDav Server will not accept "DavClnt"?

@ghost ghost mentioned this issue Nov 11, 2017
9 tasks
mmattel added a commit to owncloud-archive/documentation that referenced this issue Mar 7, 2018
See original issue comment: owncloud/core#26350 (comment)
Just a "typo" but needs to be fixed.
settermjd pushed a commit to owncloud-archive/documentation that referenced this issue Mar 9, 2018
See original issue comment: owncloud/core#26350 (comment)
Just a "typo" but needs to be fixed.
@lock
Copy link

lock bot commented Jul 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests