WebDAV: Add fallback for servers that only allow PROPFIND requests with a Depth of 1 #1823

Open
opened 2026-02-20 01:00:43 -05:00 by deekerman · 7 comments
Owner

Originally created by @leruaa on GitHub (Jul 11, 2023).

1. What is not working as documented?

I'm trying to connect to my pCloud account via WebDAV, and I get the following error: "Could not connect, please try again". In the logs, I only see:

time="2023-07-11T06:20:18Z" level=error msg="could not connect"

2. How can we reproduce it?

Unfortunately, WebDAV is only avaliable to pCloud paid customer, but I'm able to connect with Windows 10 using the following address: https://ewebdav.pcloud.com, my pCloud login and password.

Steps to reproduce the behavior:

  1. Go to 'Settings > Services'
  2. Click on 'Connect'
  3. Enter the url https://ewebdav.pcloud.com, a pCloud login and password.
  4. See error

3. What behavior do you expect?

I should be able to connect to my pCloud account

4. What could be the cause of your problem?

N/A

5. Can you provide us with example files for testing, error logs, or screenshots?

N/A

6. Which software versions do you use?

(a) PhotoPrism Architecture & Build Number: Build [230625-17242fb07]

(b) Database Type & Version: SQLite,

(c) Operating System Types & Versions: Linux

(d) Browser Types & Versions: Firefox

7. On what kind of device is PhotoPrism installed?

N/A

8. Do you use a Reverse Proxy, Firewall, VPN, or CDN?

N/A

Originally created by @leruaa on GitHub (Jul 11, 2023). #### 1. What is not working as documented? I'm trying to connect to my pCloud account via WebDAV, and I get the following error: "Could not connect, please try again". In the logs, I only see: ``` time="2023-07-11T06:20:18Z" level=error msg="could not connect" ``` #### 2. How can we reproduce it? Unfortunately, WebDAV is only avaliable to pCloud paid customer, but I'm able to connect with Windows 10 using the following address: `https://ewebdav.pcloud.com`, my pCloud login and password. Steps to reproduce the behavior: 1. Go to 'Settings > Services' 2. Click on 'Connect' 3. Enter the url `https://ewebdav.pcloud.com`, a pCloud login and password. 4. See error #### 3. What behavior do you expect? I should be able to connect to my pCloud account #### 4. What could be the cause of your problem? N/A #### 5. Can you provide us with example files for testing, error logs, or screenshots? N/A #### 6. Which software versions do you use? (a) PhotoPrism Architecture & Build Number: Build [230625-17242fb07] (b) Database Type & Version: SQLite, (c) Operating System Types & Versions: Linux (d) Browser Types & Versions: Firefox #### 7. On what kind of device is PhotoPrism installed? N/A #### 8. Do you use a Reverse Proxy, Firewall, VPN, or CDN? N/A
Author
Owner

@graciousgrey commented on GitHub (Jul 13, 2023):

WebDAV in general works, so the problem is probably pCloud specific.

Are there other pCloud users who can reproduce this problem?

@graciousgrey commented on GitHub (Jul 13, 2023): WebDAV in general works, so the problem is probably pCloud specific. Are there other pCloud users who can reproduce this problem?
Author
Owner

@Snijder commented on GitHub (Jan 9, 2024):

I have the same issue, unfortunately photoprism does not log anything about why the connection fails.
The only thing I've noticed is that the username for pcloud webdav is an email and the pcloud webdav is not very fast.

When accessing via the browser a very simple index shows up:
afbeelding

Executing propfind via curl with a depth of 1 works fine however, any other depth returns a bad request.

I was planning to work around this by creating a webdav proxy, but it would be nice if it works out of the box.

@Snijder commented on GitHub (Jan 9, 2024): I have the same issue, unfortunately photoprism does not log anything about why the connection fails. The only thing I've noticed is that the username for pcloud webdav is an email and the pcloud webdav is not very fast. When accessing via the browser a very simple index shows up: ![afbeelding](https://github.com/photoprism/photoprism/assets/10807997/5513b95f-83c0-44ac-8cc8-8e6ee8dfb271) Executing propfind via curl with a depth of 1 works fine however, any other depth returns a bad request. I was planning to work around this by creating a webdav proxy, but it would be nice if it works out of the box.
Author
Owner

@lastzero commented on GitHub (Jan 9, 2024):

@Snijder Even with debug or trace mode enabled, you don't see anything related to webdav in the logs? See https://docs.photoprism.app/getting-started/troubleshooting/docker/#viewing-logs.

@lastzero commented on GitHub (Jan 9, 2024): @Snijder Even with debug or trace mode enabled, you don't see anything related to webdav in the logs? See https://docs.photoprism.app/getting-started/troubleshooting/docker/#viewing-logs.
Author
Owner

@Snijder commented on GitHub (Jan 9, 2024):

I had tried in debug, but not with trace. However trace yielded no additional logging during the connection attempt. (edit; I tried connecting twice without doing anything else to check I got the correct piece of logging.)

time="2024-01-09T15:13:21Z" level=debug msg="server: GET /api/v1/services?count=2000 (200) [644.741µs]"
time="2024-01-09T15:14:23Z" level=error msg="could not connect"
time="2024-01-09T15:14:23Z" level=debug msg="api-v1: abort /api/v1/services with code 400 (could not connect, please try again)"
time="2024-01-09T15:14:23Z" level=debug msg="server: POST /api/v1/services (400) [11.55034085s]"
time="2024-01-09T15:15:37Z" level=error msg="could not connect"
time="2024-01-09T15:15:37Z" level=debug msg="api-v1: abort /api/v1/services with code 400 (could not connect, please try again)"
time="2024-01-09T15:15:37Z" level=debug msg="server: POST /api/v1/services (400) [21.959622378s]"

I set the log_level to trace:

time="2024-01-09T15:13:01Z" level=trace msg="migrate: links migrated"
time="2024-01-09T15:13:01Z" level=debug msg="migrate: completed in 62.912654ms"
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)
@Snijder commented on GitHub (Jan 9, 2024): I had tried in debug, but not with trace. However trace yielded no additional logging during the connection attempt. (edit; I tried connecting twice without doing anything else to check I got the correct piece of logging.) ``` time="2024-01-09T15:13:21Z" level=debug msg="server: GET /api/v1/services?count=2000 (200) [644.741µs]" time="2024-01-09T15:14:23Z" level=error msg="could not connect" time="2024-01-09T15:14:23Z" level=debug msg="api-v1: abort /api/v1/services with code 400 (could not connect, please try again)" time="2024-01-09T15:14:23Z" level=debug msg="server: POST /api/v1/services (400) [11.55034085s]" time="2024-01-09T15:15:37Z" level=error msg="could not connect" time="2024-01-09T15:15:37Z" level=debug msg="api-v1: abort /api/v1/services with code 400 (could not connect, please try again)" time="2024-01-09T15:15:37Z" level=debug msg="server: POST /api/v1/services (400) [21.959622378s]" ``` I set the log_level to trace: ``` time="2024-01-09T15:13:01Z" level=trace msg="migrate: links migrated" time="2024-01-09T15:13:01Z" level=debug msg="migrate: completed in 62.912654ms" [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. - using env: export GIN_MODE=release - using code: gin.SetMode(gin.ReleaseMode) ```
Author
Owner

@Snijder commented on GitHub (Feb 14, 2024):

For now I work around this issue by using rclone to serve pcloud as webdav and connect photoprism to the rclone webdav endpoint.

@Snijder commented on GitHub (Feb 14, 2024): For now I work around this issue by using rclone to serve pcloud as webdav and connect photoprism to the rclone webdav endpoint.
Author
Owner

@Pursch commented on GitHub (Apr 12, 2024):

Same issue with WebDAV app on truenas. See https://github.com/photoprism/photoprism/issues/4074

@Pursch commented on GitHub (Apr 12, 2024): Same issue with WebDAV app on truenas. See https://github.com/photoprism/photoprism/issues/4074
Author
Owner

@lastzero commented on GitHub (Mar 27, 2025):

As mentioned in https://github.com/photoprism/photoprism/pull/4608#issuecomment-2756316772, this issue could be solved by implementing a fallback that makes multiple requests to get the contents of the remote folders for synchronization; for example, you could implement the Directories() function differently and use it when certain errors are detected in line 148 (see the source code of earlier releases for inspiration):
github.com/photoprism/photoprism@c096382dbd/internal/service/webdav/client.go (L142-L165)

@lastzero commented on GitHub (Mar 27, 2025): As mentioned in https://github.com/photoprism/photoprism/pull/4608#issuecomment-2756316772, this issue could be solved by implementing a fallback that makes multiple requests to get the contents of the remote folders for synchronization; for example, you could implement the `Directories()` function differently and use it when certain errors are detected in line 148 (see the source code of earlier releases for inspiration): https://github.com/photoprism/photoprism/blob/c096382dbd6e891c2408466bce7642f39d2fd14c/internal/service/webdav/client.go#L142-L165
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#1823
No description provided.