photoprism / photoprism

AI-Powered Photos App for the Decentralized Web 🌈💎✨
https://www.photoprism.app
Other
35.27k stars 1.95k forks source link

WebDAV: Adding TrueNAS as a service for syncing files does not work #4074

Open Pursch opened 8 months ago

Pursch commented 8 months ago

Hi!

1. What is not working as documented? Sync Access via WebDAV running on a Truenas server seems to be broken. No matter if I choose up- or download, I get the same error messages.

Error with activated WebDAV Basic Auth: sync: 401 Unauthorized: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>401 Unauthorized</title> </head><body> <h1>Unauthorized</h1> <p>This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.</p> </body></html>

There is no error, if I use the same settings from the command line within the app:

root@231128:/photoprism$ curl -X PROPFIND -H "Depth: 1" -u user:password http://192.168.0.2:30034/share/
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response xmlns:lp2="http://apache.org/dav/props/" xmlns:lp1="DAV:">
<D:href>/bilder/</D:href>
<D:propstat>
<D:prop>
<lp1:resourcetype><D:collection/></lp1:resourcetype>
<lp1:creationdate>2024-02-22T16:35:07Z</lp1:creationdate>
<lp1:getlastmodified>Thu, 22 Feb 2024 16:35:07 GMT</lp1:getlastmodified>
<lp1:getetag>"27-611fb06b4072d"</lp1:getetag>
<D:supportedlock>
<D:lockentry>
<D:lockscope><D:exclusive/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
<D:lockentry>
<D:lockscope><D:shared/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>

Accessing the URL by webbrowser works fine too.

Error without WebDAV Auth:

sync: HTTP multi-status request failed: 200 OK
service-folder: HTTP multi-status request failed: 200 OK

2. How can we reproduce it? Got to Settings -> Services -> Connect+ Add a Webdav server running as Truenas App -> Save Configure Sync, no folder selection is possible -> Save -> A triangle is shown on the sync symbol. Lookup error messages.

I configured a second service to connect to a Nextcloud server without problems.

3. What behavior do you expect? Connect to the WebDAV server running on Truenas

4. What could be the cause of your problem? No idea.

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

PhotoPrism service image

Error message image

6. Which software versions do you use?

PhotoPrism: Build [231128-f48ff16ef] running as Truenas app, Chart Version: 2.0.3 WebDAV: App Version: 2.4.58, Chart Version: 1.0.20 runing as Truenas app Truenas version: TrueNAS-23.10.1.3 (WebDAV is an App since 23.0)

7. On what kind of device is PhotoPrism installed? AMD Ryzen 3900X, 128GB RAM, 2 x NVMe SSD, 1 GbE

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

Thank you for your care!

Pursch

lastzero commented 8 months ago

Since we don't have a local test setup for this: Can you please check what kind of WebDAV authentication the TrueNAS app expects/supports? Basic Auth? Bearer Token? Also, make sure that you have not omitted any parts of the URL, e.g. a trailing slash, and that the host is reachable from the container/environment where PhotoPrism is running. Thank you very much!

Pursch commented 8 months ago

Hi lastezero, thank you for your hints! Authentication mechanisms supported and tested are No Auth and Basic Auth, both tested and both not working. WebDAV URL and access from the PhotoPrism container to the WebDAV container checked with wget, I receive an index.html page so basically access is possible.

Pursch commented 6 months ago

Seems to be dupe of #3541