/SBIN/Mount.davfs:安装失败;该服务器不支持WebDav

发布于 2025-02-13 12:33:51 字数 2119 浏览 1 评论 0 原文

我正在尝试安装一个远程WebDav:

sudo Mount -t davfs https://files.isric.org/soilgrids/latest/data/〜/webdav

,但我只会收到以下错误: /sbin/mount.davfs:安装失败;该服务器不支持WebDav

此服务器是 wsgidav 在kubernetes群集中运行。

Nautilus的同样问题,使用 gvfsd-dav 来调试问题,如所示在这里。我有以下服务器的HTTP请求/响应:

/usr/libexec/gvfsd-dav ssl=true user=anonymous host=files.isric.org  prefix=/soilgrids/latest/data/
dav: setting 'ssl' to 'true'
dav: setting 'user' to 'anonymous'
dav: setting 'host' to 'files.isric.org'
dav: setting 'prefix' to '/soilgrids/latest/data/'
dav: Added new job source 0x556590e0c1a0 (GVfsBackendDav)
dav: Queued new job 0x556590e0a380 (GVfsJobMount)
dav: + mount
> OPTIONS /soilgrids/latest/data HTTP/1.1
> Soup-Debug-Timestamp: 1657091152
> Soup-Debug: SoupSession 1 (0x556590e0c100), SoupMessage 1 (0x7fa1b40060e0), SoupSocket 1 (0x7fa1b43440e0)
> Host: files.isric.org
> Accept-Encoding: gzip, deflate
> User-Agent: gvfs/1.48.2
> Accept-Language: en-us, en;q=0.9
> Connection: Keep-Alive
  
< HTTP/1.1 204 No Content
< Soup-Debug-Timestamp: 1657091152
< Soup-Debug: SoupMessage 1 (0x7fa1b40060e0)
< Date: Wed, 06 Jul 2022 07:05:52 GMT
< Connection: keep-alive
< Strict-Transport-Security: max-age=15724800; includeSubDomains
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Methods: GET, OPTIONS, HEAD
< Access-Control-Allow-Headers: Content-Type, Accept-Ranges, Content-Range, Range, Content-Encoding, Content-Length, Access-Control-Allow-Origin
< Access-Control-Max-Age: 1728000
< Content-Length: 0
< 
  
dav: send_reply(0x556590e0a380), failed=1 (Not a WebDAV enabled share)
dav: Mount failed: Not a WebDAV enabled share

服务器HTTP响应是 http/1.1 204没有内容

I am trying to mount a remote webdav:

sudo mount -t davfs https://files.isric.org/soilgrids/latest/data/ ~/webdav

But I only get the following error: /sbin/mount.davfs: mounting failed; the server does not support WebDAV

This server is a wsgidav running in a kubernetes cluster.

Same problem with nautilus, using gvfsd-dav to debug the problem as indicated here. I've the following HTTP requests/responses from the server:

/usr/libexec/gvfsd-dav ssl=true user=anonymous host=files.isric.org  prefix=/soilgrids/latest/data/
dav: setting 'ssl' to 'true'
dav: setting 'user' to 'anonymous'
dav: setting 'host' to 'files.isric.org'
dav: setting 'prefix' to '/soilgrids/latest/data/'
dav: Added new job source 0x556590e0c1a0 (GVfsBackendDav)
dav: Queued new job 0x556590e0a380 (GVfsJobMount)
dav: + mount
> OPTIONS /soilgrids/latest/data HTTP/1.1
> Soup-Debug-Timestamp: 1657091152
> Soup-Debug: SoupSession 1 (0x556590e0c100), SoupMessage 1 (0x7fa1b40060e0), SoupSocket 1 (0x7fa1b43440e0)
> Host: files.isric.org
> Accept-Encoding: gzip, deflate
> User-Agent: gvfs/1.48.2
> Accept-Language: en-us, en;q=0.9
> Connection: Keep-Alive
  
< HTTP/1.1 204 No Content
< Soup-Debug-Timestamp: 1657091152
< Soup-Debug: SoupMessage 1 (0x7fa1b40060e0)
< Date: Wed, 06 Jul 2022 07:05:52 GMT
< Connection: keep-alive
< Strict-Transport-Security: max-age=15724800; includeSubDomains
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Methods: GET, OPTIONS, HEAD
< Access-Control-Allow-Headers: Content-Type, Accept-Ranges, Content-Range, Range, Content-Encoding, Content-Length, Access-Control-Allow-Origin
< Access-Control-Max-Age: 1728000
< Content-Length: 0
< 
  
dav: send_reply(0x556590e0a380), failed=1 (Not a WebDAV enabled share)
dav: Mount failed: Not a WebDAV enabled share

The server HTTP response is HTTP/1.1 204 No Content

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

软的没边 2025-02-20 12:33:51

问题在于具有:

apiVersion: networking.k8s.io/v1 
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/cors-allow-methods: "GET, OPTIONS, HEAD"
    nginx.ingress.kubernetes.io/cors-allow-headers: "Content-Type, Accept-Ranges, Content-Range, Range, Content-Encoding, Content-Length, Access-Control-Allow-Origin"

http/1.1 204没有内容响应的K8S入口是正确的前飞行员响应,由提供入口,这是不是预期的WebDav Reponse ,第一个请求甚至没有达到运行WSGIDAV的POD。

解决方案:禁用入口上的CORS支持。然后还可以:

/usr/libexec/gvfsd-dav ssl=true user=anonymous host=files.isric.org  prefix=/soilgrids/latest/data/
> OPTIONS /soilgrids/latest/data HTTP/1.1
> Soup-Debug-Timestamp: 1657095042
> Soup-Debug: SoupSession 1 (0x55758f924100), SoupMessage 1 (0x7f01180060d0), SoupSocket 1 (0x7f0118342110)
> Host: dev-files.isric.org
> Accept-Encoding: gzip, deflate
> User-Agent: gvfs/1.48.2
> Accept-Language: en-us, en;q=0.9
> Connection: Keep-Alive
  
< HTTP/1.1 200 OK
< Soup-Debug-Timestamp: 1657095042
< Soup-Debug: SoupMessage 1 (0x7f01180060d0)
< Date: Wed, 06 Jul 2022 08:10:42 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< DAV: 1
< Allow: OPTIONS, HEAD, GET, PROPFIND
< MS-Author-Via: DAV
< Strict-Transport-Security: max-age=15724800; includeSubDomains
< 

The problem lies on the k8s ingress that has:

apiVersion: networking.k8s.io/v1 
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/cors-allow-methods: "GET, OPTIONS, HEAD"
    nginx.ingress.kubernetes.io/cors-allow-headers: "Content-Type, Accept-Ranges, Content-Range, Range, Content-Encoding, Content-Length, Access-Control-Allow-Origin"

The HTTP/1.1 204 No Content response is the correct pre-flight CORS response that is provided by the ingress, this is not the expected WebDAV reponse, and the first request was not even reaching the pod running wsgidav.

Solution: Disable CORS support on ingress. and then things are OK:

/usr/libexec/gvfsd-dav ssl=true user=anonymous host=files.isric.org  prefix=/soilgrids/latest/data/
> OPTIONS /soilgrids/latest/data HTTP/1.1
> Soup-Debug-Timestamp: 1657095042
> Soup-Debug: SoupSession 1 (0x55758f924100), SoupMessage 1 (0x7f01180060d0), SoupSocket 1 (0x7f0118342110)
> Host: dev-files.isric.org
> Accept-Encoding: gzip, deflate
> User-Agent: gvfs/1.48.2
> Accept-Language: en-us, en;q=0.9
> Connection: Keep-Alive
  
< HTTP/1.1 200 OK
< Soup-Debug-Timestamp: 1657095042
< Soup-Debug: SoupMessage 1 (0x7f01180060d0)
< Date: Wed, 06 Jul 2022 08:10:42 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< DAV: 1
< Allow: OPTIONS, HEAD, GET, PROPFIND
< MS-Author-Via: DAV
< Strict-Transport-Security: max-age=15724800; includeSubDomains
< 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文