Deja Dup thinks current computer name is bar but it should be foo

Fedora 17 x86_64 - running the "Backup" utility aka Deja Dup.

Set it up previously and ran at least one backup.

Now a regularly scheduled backup starts and get an error message along the lines of

"Computer Name Changed"
"The existing backup is of a computer named foo but the current computer's name is bar. If this is unexpected you should backup to a different location".

In my case the actual (incorrect) name of the "current computer" was something like which made absolutely no sense at all.  (I made up the numbers which represent an ip address but the is what it really said).

So what gives?

  1. "Backup" is really "Deja-Dup".
  2. "Deja-Dup is really a GUI front end for "Duplicity".
  3. "Duplicity" is apparently written in Python.

When Python decides to figure out the current computer's name, it calls


So I went ahead and executed

                        python -c  'import socket; print socket.getfqdn()'

and it printed out exactly the "name" that I had seen in the Deja Dup error message.

How Python got this name - I have no idea.

What I do know is that is's caused by a missing name in your /etc/hosts file.

When I was getting this error /etc/hosts has just
    localhost.localdomain localhost
(and some other stuff for IPV6).

When I added the computer name to say
  foo.localdomain foo  localhost.localdomain localhost

the Python call returned the right value and the Deja Dup errors went away.

Unanswered questions:

  1.  Why did this not go wrong the first time I did the backup but only the second? On the Amazon S3 site it knew the correct name (foo) but the python code returned the wrong current computer name.
  2. How in the world does Python come up with the "name" that it came up with? 


H. said…
I have the same problem, but editing /etc/hosts does not help. Found anything else?
This is after an upgrade from openSUSE 12.2 to 12.3
Cheers, H.
John Glotzer said…
In Fedora there is not only /etc/hosts but also /etc/hostname. Maybe try playing
with both of these (if they both exist in SUSE)? In any case, they key seems to
be to get the python line to spit out the right result. What does your /etc/hosts
have currently?

python -c 'import socket; print socket.getfqdn()'
John Glotzer said…
So if you go here

You see this:

Return a fully qualified domain name for name. If name is omitted or empty, it is interpreted as the local host. To find the fully qualified name, the hostname returned by gethostbyaddr() is checked, followed by aliases for the host, if available. The first name which includes a period is selected. In case no fully qualified domain name is available, the hostname as returned by gethostname() is returned.

New in version 2.0.

So what this python call must be doing is a gethostbyaddr() system call with an empty name so
it is looking to resolve localhost. Which more or less fits with what I have written above.

Popular posts from this blog

Hit failing alternator with a hammer to confirm diagnosis of failing alternator due to bad brushes

alternatives --install gets stuck: failed to read link: No such file or directory

Thunderbird Stuck in Table Editing Mode