Duplicacy fails to establish connection that works manually

How can I make sense of this: my duplicacy backup keeps failing like this:

Running backup command from /Users/christoph/.duplicacy-web/repositories/localhost/2 to back up /Users/christoph
Options: [-log -v backup -storage pcloud_sftp -threads 1 -stats]
2025-04-21 11:21:21.634 INFO REPOSITORY_SET Repository set to /Users/christoph
2025-04-21 11:21:21.635 INFO STORAGE_SET Storage set to sftp://christoph@rclone.local:2022/Duplicacy
2025-04-21 11:21:26.644 ERROR STORAGE_CREATE Failed to load the SFTP storage at sftp://christoph@rclone.local:2022/Duplicacy: dial tcp 192.168.1.216:2022: connect: no route to host
Failed to load the SFTP storage at sftp://christoph@rclone.local:2022/Duplicacy: dial tcp 192.168.1.216:2022: connect: no route to host

Yet, I have no problem establishing the same connection manually:


[11:53:22] christoph@mac-mini /Users/christoph [0|SIGKILL]
> sftp -P 2022 christoph@rclone.local                                    (base)
christoph@rclone.local's password:
Connected to rclone.local.
sftp>

I have no idea how this is possible…

Does it always fail when launched by webui and always succeeds manually?

This sounds like intermittent issue to me, I would check logs (using console.app or with log show) for any network related events around the time connection failed

“Always” is quite a big category… What I can say is that it has been failing in the webui every hour for days and possibly for weeks (haven’t been using my Mac mini for a while). Then I have tried the manual login a couple of times today and it “always” succeeded. So it doesn’t feel so intermittent.

Will check the logs in the console.app when I’m back home.

Otherwise, if this makes any difference (I don’t see how, but you never know): rclone.local is a jail running on my truenas server.

And if you run backup manually in webui, does it work?

Shall not matter indeed.

As a test, try using ip address instead of rclone.local. I’m not sure how but maybe theirs is something with mDNS but the printed error may be misleading.

Do you mean running the backup job in the “Backup” tab rather than via the scheuler? Yes, it also fails when I run it that way.

The Duplicacy web-ui doesn’t allow me to modify the parameters for an existing backup job (in this case: the storage host name) and neither does it allow me to duplicate the existing job to make such a modification. And I can’t really be bothered to create a new backup job from scratch for this.

tbh, I think this might well be the last nail in duplicacy’s coffin for me. I have basically switched to Arq which just runs in the background and does its job and doesn’t bug me every now and so often with some weird issue that needs troubleshooting.

I have checked the logs in concole.app and can’t find anything. I’m not sure where and what I’m looking for but I searched for both duplicacy and rclone in pretty much every report category and it found nothing.

You can edit the url in duplicacy.json

Excellent. So it’s repeatable. Does duplicacy web run as root or a normal user?

Scroll to around the time duplicacy failed to connect and see what happened nearby.

Or run the backup, let if fail, and immediately in terminal run log show —last 20s to show logs from the last 20 seconds. Will be easier to find if there is anything there.

But I still suspect some mDNS scheninigans.

When did this behavior began, did anything change in the environment?

Everything is possible if you remember whether those files are stored… :wink:

Not even Find Any File finds a file by that name…

According to activity monitor, it runs as user christoph, which, I guess, means it’s running as a normal user.

The only logs related to duplicacy that I can find are these:

default	19:35:55.126553+0200	mDNSResponder	[R3378] DNSServiceCreateConnection START PID[9251](duplicacy_osx_a)
default	19:35:55.126681+0200	mDNSResponder	[R3379] DNSServiceQueryRecord START -- qname: <mask.hash: 'F2zIQrnViOPSVQkQdpZI4Q=='>, qtype: A, flags: 0x15000, interface index: 0, client pid: 9251 (duplicacy_osx_a), name hash: 88687cc4
default	19:35:55.128324+0200	mDNSResponder	[R3380] DNSServiceQueryRecord START -- qname: <mask.hash: 'F2zIQrnViOPSVQkQdpZI4Q=='>, qtype: AAAA, flags: 0x15000, interface index: 0, client pid: 9251 (duplicacy_osx_a), name hash: 88687cc4
default	19:35:57.428735+0200	duplicacy_osx_arm64_3.2.3	networkd_settings_read_from_file initialized networkd settings by reading plist directly
default	19:35:57.429810+0200	duplicacy_osx_arm64_3.2.3	networkd_settings_read_from_file initialized networkd settings by reading plist directly
default	19:35:57.432771+0200	UserEventAgent	LocalNetwork: found bundle id com.duplicacy.web by PID
default	19:35:57.433304+0200	UserEventAgent	LocalNetwork: found bundle id com.duplicacy.web by UUID 8EE262E3-9CC1-3092-A880-8A3DDBCD6541
default	19:35:57.433468+0200	UserEventAgent	LocalNetwork: found bundle id com.duplicacy.web by PID
default	19:35:57.433655+0200	UserEventAgent	LocalNetwork: found bundle id com.duplicacy.web by UUID 8EE262E3-9CC1-3092-A880-8A3DDBCD6541
default	19:35:57.434678+0200	mDNSResponder	[R3378] DNSServiceCreateConnection STOP PID[9251](duplicacy_osx_a)

It doesn’t look like there is any error there.

I don’t know. A long time ago. I haven’t been using that machine for weeks and months. I just logged in every now and then to update the OS or some apps.

It’s in the hidden folder called .duplicacy_web. That folder is located where the variable HOME was pointing to when duplciacy_web starts. If you run it as yourself – it will be in ~/.duplicacy_web.

You can press Commadn+Shift+. to see hidden files in Finder.

In that snippet indeed nothing unusual

As another data point – Turn off application firewall on macOS. Do you have any other non-standard security software installed?

LOL, I realize I was searching on My MacBook instead of my Mac mini. There are few disadvantages of Universal Control in macOS, but this might be one of them :upside_down_face:

So, I replaced the hostname with the IP and tried again but it fails just the same.

2025-04-21 20:25:47.589 ERROR STORAGE_CREATE Failed to load the SFTP storage at sftp://christoph@192.168.1.216:2022/Duplicacy: dial tcp 192.168.1.216:2022: connect: no route to host
Failed to load the SFTP storage at sftp://christoph@192.168.1.216:2022/Duplicacy: dial tcp 192.168.1.216:2022: connect: no route to host

I have never fiddled with the macOS firewall. I guess it is off:

System Settings-2025-04-21 at 20.27.39

I have an app called “Pareto”, but when I turn it off, the problem persists.

Very interesting.

Can you try running duplicacy CLI manually? This would rule out webui related issue from duplicacys.

But the error messsge is very baffling, I’ll assume it’s incorrect

I’ll leave it at that for now. It’s been years since I last used the duplicacy CLI. I was curious to understand what is going on here, but if even you are puzzled, we don’t need to pursue this further.

The issue is with macOS Privacy & Security settings. Check the entries in the following sections:

Files & Folders
Full Disk Access
Local Network (most likely one)

Most likely your terminal is listed in one or more of these, which is why it runs successfully manually. When run via cron, however, it is not permitted, etc. I run my daily stuff via cron and seems like I had to ensure that crond, flock (used for ensuring one duplicacy prune at a time), and duplicacy binaries all had to be present.

Hope that helps.

1 Like