Webdav sync "Error while setting up location"

Previously had webdav sync working to a Mac Mini on the Ethernet network before upgrading to latest macOs Monterey and making a few changes. So it’s not competely unfamiliar. Just that I can’t get it to work this time and any input very welcome. It was really easy last time and just worked, so frustration is creeping in…

[1] Using a locally generated certificate, I am able to connect to the server using a https://computername.local:8080 secure connection with a web browser and view a test file index.html that I have located in the ~/Sites/webdavShares/ directory. So it doesn’t seem to be a SSL issue nor a network connection issue, and my chosen port 8080 is correctly set up. This index.html file shows on both Safari and Firefox so it is probably not a browser issue.

I realize that this is a massive security breach, but for testing I have set chmod 777 for my directory webdavShares and recursive directories, just in case this is a permissions issue. But that makes no difference.

And I have remembered to turn on webdav sharing with wfsctl which lists …/webdavShares as a share, and can be restarted without throwing an error message so that looks OK.

But when attempting to connect there is a consistent error “Creation of directory failed. Please check scheme (HTTP/HTTPS), path and port of the URL.”

As far as all these are concerned I don’t see an issue, but there must be something wrong. The Sync store name (directory name) I am using for sync is dt3 so I have tried manually setting up a directory dt3.dtCloud and making it a webdav share. That changes the error to “Error while setting up location “dt3.dtCloud” Cannot connect to host. (NSURLErrorDomain -1004)” Yet a browser can connect and read a different index.html file in the dt3.dtCloud directory.

Just in case it is an issue due to the databases, I created a new database with the name testDb but that makes no difference.

Attached is the image of the sync setup. I expect this issue is due to my limited knowledge of webdav, but I don’t recall that I have done anything different from last time, when it all worked first time, in the setup of apache and webdav. As I said at the start, all suggestions and input welcome. If you need further details and screenshots then please just ask.

Thanks !

Russell.

There’s no port number in the WebDAV URL. is the server really listening on 443 for https while it uses 8080 for http?

Thanks Chrillek, well spotted, but it is an error in the screen shot - copied wrong version into message. Correct screen shot below. I was trying both 8080 and 443 and attached the wrong screen shot. Makes no difference to the error - which is itself perhaps a useful diagnostic that the port setting or connection is the cause of the problem.

Cut and paste this URL directly from the screenshot shown to a browser and the index.html file shows as expected using https://

Thank you for your helpful and accurate reply, but it is unfortunately not the solution this time.

Russell.

Does the URL work in the Finder, see Go > Connect To Server…?

So there’s a physical connection via HTTPS on port 8080 to your NAS. But is the webdav server on the NAS also listening on that port? As @cgrunenberg asked: Can you mount the volume via HTTPS on this port in the Finder?

Thanks to both…
The port number is not important to me (or at least not important right now) so I have rolled through the various config files and removed references to 8080 and will test using default 443 for https until I get it working.

apachectl configtest gives a result of Syntax OK so there appear to be no conflicts on the Listen port (half way through changing it gave a warning of conflict on listen port when I had not yet changed all references).

The volume mounts fine in Finder as smb://
CMD-K in Finder prompts with “smb://minnie02._smb._tcp.local” when accessing using ethernet from the laptop, and when I hit then that connects in the Finder and I can access the ~/Sites/webdavShares folder where I want to put the webdav store, and see the index.html which I put there, and open it.

Russell

Good. But it is important for the underlying software. So if you do not specify a port, you’re implicitly using 443, and your WebDAV server has to listen on 443. And if you’re specifying 8080 for sync, your WebDAV server has to listen on 8080.

You’re not using SMB but WebDAV.

Before we continue this back and fro, it would really be helpful if you provided a lot more detail on your setup. Like what version of Apache, does it include the webDAV module, is that activated, what are its config parameters. And also if you can mount the directory in Finder via WebDAV - neither SMB nor NFS or AFS or any other networking file system is relevant here. Only WebDAV.

1 Like

You should use the same URL in the Finder’s dialog like in DEVONthink.

1 Like

Thanks again for your patience and good advice - sorry about the smb:// oversight. Momentary lapse, don’t know why.

===> No, it doesn’t connect as webdav using Finder. Neither http:// nor https://
So, that is an underlying issue. Thank you for pointing me to that. Need to get webdav working, and then it seems likely that dt3 will connect without issues.
Happy to supply all the information that is relevant to diagnosis, didn’t want to start out with a load of irrelevant details.
macOs current 12.3.1 2018 Intel MacMini with 32 GB memory.
apache 2.4.53
php 7.4
apache, php installed using Homebrew following the method of macOS 12.0 Monterey Apache Setup: Multiple PHP Versions | Grav CMS but with only php 7.4 and not multiple php versions.

I am beginning to wonder if the issue is a config problem due to using Homebrew for apache/php and there is a reference to config for macos apache.

Happy to share config files if you let me know which are useful - perhaps all of them - and will strip out comment lines to keep them small/readable. But right now I have a meeting that I can’t avoid, so this will not be until later or tomorrow.

Again, thanks for the pointer about mounting webdav. Obvious once it is suggested.

Russell.

I guess (!) that WebDAV is not configured in Apache or not configured correctly.

https://httpd.apache.org/docs/2.4/mod/mod_dav.html

you should be able to find the relevant part in the config file(s) with this information. Note: mod_dav has to be loaded and turned on.

Thank you for the ref to docs. Will look at them as soon as I get a minute.

I’m curious why you’re going for a raw WebDAV Apache install instead of opting for something pre-built, like the WebDAV services on an NAS.

Have you ever tried WebDAVNav Server?

The Mac Mini is my NAS, with an OWC four-disk RAID. Previously (a couple of years ago) I was able to set it up as an Apache/PHP webdav server quickly and easily, and it worked first time. So I thought it would be the same again… But of course that is very much wishful thinking, it’s never the same again once software and OS are updated. PHP is not now part of macOs Monterey so Homebrew is involved.

Thanks for the comment “Have you ever tried WebDAVNav Server?” No, not yet, indeed I had never ehard of it. But at a quick glance it looks like a better solution, if I had known about it, or done some research on the App store, I could have saved myself a few hours of stress and hard work. It’s good to practice my limited Unix skills now and then, but even better not to have to spend the time and effort.

R.

You’re welcome.
I haven’t tried in out in a few years but it worked well enough in some testing I did.

Let me know how it works for you as it may be worth suggesting to our larger audience as well.

PS: Sometimes doing things the hard way is more rewarding in the end as the pre-built options don’t allow us to learn much. :slight_smile:

While it’s possible to run Apache on a Mac system (with PHP, Perl, whatever, too) it is a PITA. Been there, done that. Every update of macOS replaces the config files with some BS from Apple or they simply remove the software you rely on (like PHP). On top of that, they introduce funny little features (read “bug”) that make setting up your environment again a real challenge.

If the machine is headless anyway, you might think about installing Linux on it. That at least works relatively smooth with Apache and all the other Unix stuff. OTOH, one needs Unix skills. There’s still no free lunch, unfortunately.

1 Like

Hadn’t thought of Linux/Apache. The Mac Mini already has Parallels and Linux for some advanced Building Energy Management Software related to my work. You are so totally right that Apple will make changes without warning that can overnight trash a system which has worked for a long time. So I’ll maybe take a look at running on Ubuntu provided I can get the OWC RAID to work with that.

Never a dull moment.

Thanks. R.

Here’s some feedback after a couple of months using WebDAVNav App which I had never heard about until you mentioned it in your reply in April to my question about webDAV.

  • it has worked reliably without any problems at all.
  • so very much quicker and easier to install and set up than any other solution I know of.
  • it solved the issue so I used the “send a tip” function to send the developer some money. The app is free of charge but, for me, well worth the modest amount requested.
  • just one warning ==>> When installed it does NOT open a window, which is different behaviour from most apps. I deleted and reinstalled a couple of times before I realized that this appears to be intentional behaviour and not a problem. The icon appears in the menu bar, and clicking the icon opens the set-up window. From there it is pretty self-explanatory set-up.

Hope that this feedback might help anyone else looking for an easy way to add webDAV to a Mac.

Russell.

3 Likes

Excellent and thanks for the thorough feedback!

WebDAV is usually not for the faint of heart to set up, even with good instructions, so it’s good to know there’s a simple option for those without an NAS or the gumption to set up a local WebDAV server. :slight_smile: