I’m running Duplicati withing a docker container (Linuxserver image) and i want to trigger/start a backup job via server util so i can manage all my backups with XyOps. (Task scheduler)
Because my Duplicati DB is encrypted i need to create a persistent token first. This works;
“docker exec duplicati /app/duplicati/duplicati-server-util login --password=‘*********’ --hosturl=http://localhost:8200
Logging in to the server
Connecting to http://localhost:8200/…
Logged in, persistent token saved”
But when i try to run a server util command afterwards i’m getting;
“docker exec duplicati /app/duplicati/duplicati-server-util run 3 --hosturl=h-ttp://localhost:8200
Connecting to h-ttp://localhost:8200/…
Failed to use refresh token: Server error (401): Failed to refresh token
Failed to obtain a signin token: Server error (401): Failed to sign in
Enter server password: Failed to connect to server: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.”
Am i doing something wrong? Or is there another way to trigger a backup job remotely?
Typo gets problem on Windows. Duplicati isn’t on 8200, but it may not matter:
Duplicati.CommandLine.ServerUtil status --hosturl=h-ttp://localhost:8200
Connecting to h-ttp://localhost:8200/...
Failed to obtain a signin token: Encryption key is missing.
Enter server password: ^C
You should probably look at what that does with stdin, stdout, stderr. Manually:
Duplicati.CommandLine.ServerUtil status --hosturl=h-ttp://localhost:8200 < NUL
Connecting to h-ttp://localhost:8200/...
Failed to obtain a signin token: Encryption key is missing.
Enter server password: Failed to connect to server: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.
If fixing typo doesn’t do it, I suppose you could see if giving --password does.
Apologies, I should have mentioned i altered the url because a new account is limited to only post 2 URL’s withing a post. So it’s not a typo.
I’m running the commands from within a terminal on my Unraid system. So it’s not on Windows. (altough i’m accessing the terminal from Windows ) this is just to test.
XyOps runs on my Unraid aswell in it’s own container. It has a satelliet agent running on the Unraid Host, it runs as root and could perform shell commands. So this should work.
The problem is once i run:
*docker exec duplicati /app/duplicati/duplicati-server-util login --password=‘*********’ --hosturl=http://localhost:8200
*
It logs in, saves my token, but apparently with the next server util command it fails to use the token? Any idea’s on how to fix that?
This is exactly how the documentation states how to use ServerUtil; ServerUtil | Duplicati
When i run the command with -it, so it gives me a password promt, it also fails;
root@unraid:~# docker exec -it duplicati /app/duplicati/duplicati-server-util run 3 --hosturl=h.ttp://localhost:8200
Connecting to h.ttp://localhost:8200/…
Failed to use refresh token: Server error (401): Failed to refresh token
Failed to obtain a signin token: Server error (401): Failed to sign in
Enter server password: ********
Failed to connect to server: Server error (401): Failed to log in
(again i altered the url to stay below the 3 urls)
I did some further testing and found out the issue is withing the linuxserver image when te container is running as another user then root. In my case (Unraid environment) it was running as Nobody.
As test i deployed the official duplicati image, running as user nobody and then ServerUtil works like intended.
I will convert my primairy duplicatie environment to the official image.
You can probably make the forum not see it as a URL by adding backticks,
e.g. one before and after, or (good for multi-line) three on above and below.
This also keeps characters as you type, instead of trying to “improve” them.
I was about to suggest docker exec options, but new -it sounds good.
I don’t use Docker though. If need be, I can try a Linux VM on Windows.
I suppose you could check. I think it’s settings.json in database folder. Storing data in different places suggests that’s in ~/.config/Duplicati
Does your time-last-accessed work? If you find it, you can check ls -lu
I think the modification time would be changed by doing login and logout.
I was going to point out the user-sensitivity of ~, but you got there first…
I’m not sure exactly how LSIO managed to not work, but maybe the hints
above will let you debug if you care to. Or just switch images as you plan.