Settings disappeared - arch linux

New user here.

I’ve been using Duplicati for a few weeks without trouble, but today when I launched the web interface, there were no settings to be seen. My backup setting, schedule, everything was gone. :scream:

I ran a system update today sudo pacman -Syu and noticed that a new version of Duplicati was included in the update. [Edit: Mis-remembered … Duplicati comes from the AUR and not installed with pacman.] After the update, my settings had disappeared. Has this update wiped my settings?

Is this normal behavior? Can I get my backup settings back?

Thanks.

[Edit: TL;DR Because of the way I installed and configured Duplicati, I needed to manually change User=Duplicati to User=root in the `/usr/lib/systemd/system/duplicati.service’. On reboot, my original settings have returned.]

Hello and welcome!

What I hope happened is that you are connecting to Duplicati running in a different context. Many Linux users have it set up as a systemd service, so it runs as root and stores its config files in /root/.config/Duplicati. Others run it under their regular user context at logon, so the config files are in /home/<username>/.config/Duplicati.

So for now poke around your system in those various folders and see if you can find one with multiple sqlite files. Then we can work on getting Duplicati to run under the context you wish.

Arch Linux does their own package modification which starts Duplicati not as root, but as user duplicati.
If Arch changed your Duplicati user back, your old config may be in ~root and your new in ~duplicati.

Yep.

Thanks for your replies.

Duplicati runs as root, and yes, there is a /root/.config/Duplicati folder tree that looks like this:

/root/.config/Duplicati
├── control_dir_v2
│   └── lock_v2
├── Duplicati-server.sqlite
└── PBHDHKFWED.sqlite

The Duplicati service is enabled and running correctly, according to the output from sudo systemctl status duplicati.service:

● duplicati.service - Duplicati
     Loaded: loaded (/usr/lib/systemd/system/duplicati.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2021-03-08 22:11:58 UTC; 9min ago
   Main PID: 516 (mono)
      Tasks: 12 (limit: 18892)
     Memory: 231.2M
     CGroup: /system.slice/duplicati.service
             └─516 /usr/bin/mono /opt/duplicati-latest/Duplicati.Server.exe --webservice-port=8200

Mar 08 22:11:58 X270 systemd[1]: Started Duplicati.

I do not not know what I need to do next to get my settings back. The browser page at http://localhost:8200/ngax/index.html just shows “No scheduled tasks”.

Can you scan your entire system for any other Duplicati-server.sqlite files?

How did you confirm that? In GUI, About → System info shows UserName, or use ps -lp with its PID.
You must have edited /usr/lib/systemd/system/duplicati.service once to make it run as root.
I want to be sure your update didn’t restore settings as in Installing Duplicati on Linux (Arch / Manjaro).

You can see the path of the database Duplicati uses by taking the child pid and doing lsof -p <pid>

mono-sgen 31069 root    5u      REG                8,1    57344  531338 /root/.config/Duplicati/Duplicati-server.sqlite
mono-sgen 31069 root    6wW     REG                8,1        6  531562 /root/.config/Duplicati/control_dir_v2/lock_v2

is from my system. Duplicati runs as root, so it uses the config (and lock file) in root’s home directory.
The theory everyone is chasing is that your new Duplicati is somehow getting a new configuration file.
Searching for the file is good, but you can also look directly to see what file your “empty” Duplicati has.

How did you install Duplicati? My understanding is that for Arch it only exists in AUR repositories, so pacman -Syu should not update or even mention it.

You are correct. I misremembered the sequence and have updated my opening question to reflect this. Of course, Duplicati comes from the AUR. Thanks for the correction.

Thanks @tz678 for the tip about checking whether Duplicati was running as root. It wasn’t … so I traced back the steps I used to install it in the first place.

TL;DR Because of the way I installed and configured Duplicati, I needed to manually change User=Duplicati to User=root in the `/usr/lib/systemd/system/duplicati.service’. On reboot, my original settings have returned.

How I installed

    $ git clone https://aur.archlinux.org/duplicati-latest.git
    $ cd duplicati-latest
    $ makepkg -si PKGBUILD

    Y to install (with root password)

# Root user power

    $ cd /usr/lib/systemd/system
    $ sudo vim duplicati.service

replace `User=Duplicati` with `User=root`. Save and exit editor

# Reload daemon service

    $ sudo systemctl daemon-reload
    $ sudo systemctl start duplicati.service
    $ sudo systemctl enable duplicati.service

In browser, go to localhost:8200 … previous configuration is used correctly.

Regarding any future updates via the AUR, presumably I will need to repeat this process each time?

Thanks for everyone’s help. Great introduction to the Forum :smile:

1 Like