Backup stops because of claim 'Computer name changed', which is it not true

Solution 1:

Using Ubuntu 19.10, deja-dup 40.1, duplicity 0.8.04.

The questions arise: how comes that deja-dup/duplicity is making up this name?

According to bug reports (ranging as far back as 2010), it's a bug in duplicity affecting deja-dup. Duplicity prefers the fully-qualified domain name (FQDN) for the backup's computer name.

  • The way the FQDN lookup is performed is affected by both your computer's network configuration, and the way the network the computer is connected to behaves.
  • In particular, external network changes can therefore break backups.1 This includes moving the computer from one network to another.

See

  • https://bugs.launchpad.net/deja-dup/+bug/1268182
  • https://bugs.launchpad.net/duplicity/+bug/667885

how to fix this?

The bug reports hints at editing /etc/hosts in various ways. Here's what I changed, with mycomputer being my chosen name. Note that order seems to matter.

/etc/hosts (ipv6 addresses omitted)

Original:

127.0.0.1   localhost
127.0.1.1   mycomputer

Modified:

127.0.0.1   mycomputer localhost
127.0.1.1   mycomputer

As soon as I saved the file, an automatic backup started. It worked as expected.2,3

See

  • https://bugs.launchpad.net/deja-dup/+bug/1086068
  • Deja Dup resolves host name incorrectly, adds ISP hostname
  • What is the use of /etc/hosts?

1 My backups broke around the time when my ISP upgraded their infrastructure in my area to ipv6. Started seeing "hostnamed changed" with hostnames such as dynamic-xxxx-yyyy-zzzz.area-123.example.com.

2 Tried to verify by reverting the file and rebooting, but backup still works so unsure if it actually fixes the problem, or just triggers deja-dup/duplicity "the right way". Might be related to DHCP timeouts (7 days) in the ISP-owned router, or some other setting I changed. Am posting the answer anyways, but might have to revise if it stops working in a week.3

3 It has now been more than one week since writing this answer.2 Both starting a backup and verifying backups succeeded. Also rebooted and started another backup, which also succeeded. It seems the suggested fix works so far, at least for myself on my machine and in my network environment.