Docker: How to setup server with previous installation?

Hi,
I’m using uroni’s Docker container on Openmediavault 5 (amd64). From the previous installation of urbackup as plugin in OMV4 I have existing backups and the database on a btrfs filesystem, which I like to use in the container. I’ve bound the backups folder to /backups and the database folder to /var/backup with write access (I think). When starting the container, I get

Raising nice-ceiling to 35 failed. (errno=1)
2020-07-07 22:25:11: Starting HTTP-Server on port 55414
2020-07-07 22:25:11: HTTP: Server started up successfully!
2020-07-07 22:25:11: Generating Server identity…
2020-07-07 22:25:11: Generating Server private/public ECDSA key…
2020-07-07 22:25:11: Calculating public key…
2020-07-07 22:25:11: ERROR: Main thread exit with unhandled std::exception FileSink: error opening file for writing: urbackup/server_ident_ecdsa409k1.priv
terminate called after throwing an instance of ‘CryptoPP::FileSink::OpenErr’
what(): FileSink: error opening file for writing: urbackup/server_ident_ecdsa409k1.priv

Does anyone have an idea, what’s going wrong? I’m using portainer to administrate containers, so hints on how to correct in the portainer UI would be highly appreciated.

Thanks
Christian

My guess is that you are confusing paths inside and outside the container.
Also maybe try to create /usr/local/var/urbackup/

If using a new/different path, you want to put your server_ident* keys in place of the ones it creates as to authorise the clients to connect more transparently.

It is /var/urbackup. Also make sure the UID + GID of urbackup in the container settings equals the previous UID+GID.

Sorry, my bad. It’s already /var/urbackup

The folder /srv/…/bak on the host contains subfolders for all machines, /srv/…/bak/urbackup contains the server_ident* and some *.db files.

Can I somehow see, what the container finds under /var/urbackup?

Hi:

I’m something of a Docker noob - but on the Synology Docker application, it’s possible to open a new Terminal session running in the container - which you can then use to explore the filesystem.
Is that possible in Portainer?

@Moisie I’m also a Docker noob, but due to the container not starting up, I cannot open a terminal. This only seems possible if the container is up and running.

@uroni UID + GID are probably the right track. This are the access settings on the host:

me@omv:/srv/…/bak$ ls -l
drwxrws—+ 1 systemd-network input 1126 Jul 8 00:25 urbackup

me@omv:/srv/…/bak/urbackup$ ls -l
-rwxrwx—+ 1 urbackup users 335 Jun 30 01:02 server_ident.priv

I guess the user running the container is not the owner, nor part of the group. How do I have to set these correctly? Or can I force the container to run under the (old) urbackup user on the host?

From the host, something like : docker exec -it /bin/bash

$ sudo docker exec -it Urbackup-Server /bin/bash
Error response from daemon: Container … is not running

“docker ps” will give you the container id, use the id instead
“docker ps -a” also shows stopped containers

@orogor Replacing the container name with the id does not help. It still says that the container is not running - which makes sense to me.

I need some help here: How do I ensure this?

Got it running. Steps I had to do:

  • translate settings in docker-compose.yml from https://github.com/uroni/urbackup-server-docker to portainer. Most of the entries can be found easily in portainer’s “Add container” dialogue. In advanced container settings
    – “Command & logging”: leave everything on default (do not set user)
    – “Volumes”: /backups and /var/urbackup bind to paths with existing folders on host
    – “Network”: set network to host
    – “Env”: set PUID and PGID to UID and GID from host (see /etc/passwd), set TZ to timezone, e.g. Europe/Berlin
    – “Restart Policy”: Unless stopped
    – “Capabilities”: switch on SYS_ADMIN
  • Click “Deploy the container” and wait, as the old settings will be imported and reindexing takes time. Check Log under Containers Quick actions
  • Open urbackup frontend on …:55414, switch to settings and change Backup storage path to /backups
    These steps did it in my case.

Hey @christian I’m facing the same issue but was not able to solve it as per your suggestion. Any insight you can share?

No, not really… With the steps I described in my post from July 2020 I got it working. And it’s still working…