"not in baseUrl" and "relativeBaseUrl" errors when sync

I have successfully set up synchronizing my files among PC (windows), Android and iOS phone together seamlessly using WebDAV protocol. Now I have problems with getting another laptop (LINUX) get in sync. As I get faily syncs my Joplin folder gets populated with trashy files which DON’T get deleted (actually I don’t know which are the ones I don’t need).

2019-05-02 23:46:41: “Starting scheduled sync”
2019-05-02 23:46:48: “SearchEngine: Updating FTS table…”
2019-05-02 23:46:48: “SearchEngine: Updated FTS table in 2ms”
2019-05-02 23:47:08: “ResourceService::indexNoteResources: Start”
2019-05-02 23:47:08: “ResourceService::indexNoteResources: Completed”
2019-05-02 23:47:08: “ResourceService::deleteOrphanResources:”, “[]”
2019-05-02 23:50:46: “Error: href /webdav/Joplin/ not in baseUrl http://webdav.pcloud.com/Joplin nor relativeBaseUrl /Joplin
Error: href /webdav/Joplin/ not in baseUrl http://webdav.pcloud.com/Joplin nor relativeBaseUrl /Joplin
at FileApiDriverWebDav.hrefToRelativePath_ (/tmp/.mount_JoplinO3mOnu/resources/app/lib/file-api-driver-webdav.js:101:10)
at FileApiDriverWebDav.statsFromResources_ (/tmp/.mount_JoplinO3mOnu/resources/app/lib/file-api-driver-webdav.js:114:22)
at FileApiDriverWebDav.list (/tmp/.mount_JoplinO3mOnu/resources/app/lib/file-api-driver-webdav.js:279:22)
at process._tickCallback (internal/process/next_tick.js:68:7)”

That is the error I got when my URL was having lots of % symbols in it, i moved Joplin to the root of the cloud storage and it worked perfectly fine on Android, iOS and Windows. Stil can’t get it work on Linux tho

The problem is that your service is referencing a resource with a URL “/webdav/Joplin/” but your service is at “http://webdav.pcloud.com/Joplin” so it seems this URL is invalid.

Which WebDAV service is it? It’s sometimes possible to fix it by changing the WebDAV URL to a canonical one. For example does it work if you use “http://webdav.pcloud.com/webdav/Joplin”?

Well I tried to export the native database from Windows PC as the Joplin’s file and imported it into my Linux machine, now as I purged Joplin’s cloud directory completely I’m re-syncing it now from Linux for it to be like a fresh sync and install without trash .tmp files. By the way these files were being created prior to getting this error message, they contained something like “tags”, “attachments” and other service headers with no content at all, so I am suspecting that it seemed this URL as “ok” but for some reason didn’t want to sync it FROM the cloud and started to spam the cloud folder with its service .md and .tmp files while the needed files were already there

UPD: Now there was another error
2019-05-03 00:40:17: "Error: PUT 9c672be0816b450abe58febf539894d5.md: Unknown error 2 (500):

500 Internal Server Error ... The rest of the error is the html contents of cloud service html file, but I guess that has no relation to the topic. It's just observations, re-syncing made it completely sync everything

Internal Server Error

i’ve changed its URL to a “canonical” one. Got the same error

Error: href /webdav/webdav/Joplin/ not in baseUrl http://webdav.pcloud.com/webdav/Joplin nor relativeBaseUrl /webdav/Joplin

Your service is buggy it seems. What is “/webdav/webdav/Joplin/”? What service is it and can you use a different one like Nextcloud or Seafile?

the service is called pCloud, and it worked perfectly on anything else than Linux.

“/webdav/webdav/Joplin/” is the URL it notes in the error, i have added a parent folder like you said to make it look like [serviceURL]:/webdav/Joplin

all it did is added another /webdav/ thing in the path

To clarify, Joplin tries to list the files on the WebDAV server. Your server responds that the resource is at “/webdav/webdav/Joplin/” so its absolute URL would be “http://webdav.pcloud.com/webdav/webdav/Joplin”, which I doubt it is. I assume that if you change the WebDAV URL to “http://webdav.pcloud.com/webdav/webdav/Joplin”, it will now tell you that the file is at “/webdav/webdav/webdav/Joplin”…

This is why there’s this sanity check to confirm that the path is valid, which in your case it is not. If it’s a service hosted by a third party, you might want to bring that up with them as they’ll know the bugs and quirks of the service and might be able to provide a fix.

All applications use the same code for WebDAV, so are you sure that the URL you've entered is exactly as on your other devices?

I know this is an old thread, but I had the same problem and found a solution thx to @laurent explaination.

I am using OX Drive from Open Xchange and ran into the same problem. The solutuin was changing the path.
The original path did contain my e-mail adress (e.g. .../Webdav/user@exmaple.com/Joplin/ ). This worked well in Windows Explorer or WinSCP but failed in Joplin.

The solution was to replace the @ sign with %40 and everything works fine.