Open opcod3 opened 8 months ago
Hey @opcod3,
Thanks for the report, I have created NODE-1215
as the dev ticket to get this fixed.
n8n v1.31.2 has the same issue. my usernames are url encoded so they look like
https://example.com/cloud/remote.php/dav/files/test%40example.com/
We expect the Webdav URL to be:
https://nextcloud.tld/remote.php/webdav
When configured like this if you list a folder like /Documents
you get the output in the image below which looks to be correct to me.
In my example my URL is https://nc.home.mydomain.com/remote.php/webdav
What happens if you try the URL that is like the example we provide in the credential instead of adding to that path?
Still doesn't work.
Nextcloud 26.0.13 n8n 1.64.3
I guess the documentation is wrong here: https://docs.n8n.io/integrations/builtin/credentials/nextcloud/
It says https://nextcloud.tld/remote.php/dav
(which fails to even login on creating the credentials)
Configuring it for https://nextcloud.tld/remote.php/webdav
it authenticates now. (It didn't do that before)
And it is able to retrieve directories. But they don't look like yours...
I can can get this directory list of the root (but it doesn't look like yours)
Adding in /ebdav/Backups/
or /Backups
gives
Bug Description
When using the nextcloud 'List Folders' integration the path for the returned items is incorrect.
The issue occurs when nextcloud is hosted at the root of a domain (the recommended configuration), instead of at domain.com/nextcloud
The issue likely occurs because of this statement: https://github.com/n8n-io/n8n/blob/11a5331e038fc383e454230dd9996015d7ce9b16/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts#L1255
This works fine if nextcloud is hosted at
[domain]/nextcloud
but breaks it it's hosted at[domain]
.Ideally the user should also be stripped from the returned path if it's present in the WebDAV url, this would allow piping the path directly into a delete file/folder node without having to manually strip the user first.
To Reproduce
https://[redacted-domain]/remote.php/dav/files/MyUser
/
es/MyUser
Expected behavior
If:
https://[redacted-domain]/remote.php/dav/files/MyUser
/
es/MyUser/TestFolder
/TestFolder
If (Assumed behavior but not actually tested):
https://[redacted-domain]/remote.php/dav/files
/MyUser/
es/MyUser/TestFolder
/MyUser/TestFolder
Operating System
Docker
n8n Version
1.29.1
Node.js Version
irrelevant
Database
PostgreSQL
Execution mode
main (default)