elmerfds / rebuild-dndc

Re-create containers that use another container's network stack (i.e. routing container traffic through a VPN container)
GNU General Public License v3.0
22 stars 9 forks source link

weird issue where containers are missing volume tags when restarted by rebuild-dndc #59

Closed johnny2678 closed 1 year ago

johnny2678 commented 1 year ago

Not sure when this started but I noticed some of my containers not working. Looking closer it was because they weren't started with the volume tags for config/data. Example:

radarr

----------------------------
  Removing: radarr
 ----------------------------

radarr

----------------------------
  Recreating: radarr
 ----------------------------

Name: radarr
Found Net:  --net="container:delugevpn"
Found TimeZone:  -e TZ="America/New_York"
Found Repo:  cr.hotio.dev/hotio/radarr
/usr/bin/docker run -d --name="radarr" --net="container:delugevpn" -e TZ="America/New_York" cr.hotio.dev/hotio/radarr
3e4542d315e8ce306efad315e7a4f3087e69065713a6bce874bca0d5d23cabeb

This container has volume tags configured in unraid: image

For some reason Rebuild-dndc isn't reading them from the docker template so the only way to get the container back up and running is to force an update from the Unraid GUI so it's recreated.

Here's my Rebuild-dndc config:

docker run
  -d
  --name='Rebuild-DNDC'
  --net='bridge'
  -e TZ="America/New_York"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="host"
  -e HOST_CONTAINERNAME="Rebuild-DNDC"
  -e 'mastercontname'='delugevpn'
  -e 'mastercontconcheck'='yes'
  -e 'ping_ip'='1.1.1.1'
  -e 'ping_ip_alt'='8.8.8.8'
  -e 'ping_count'='4'
  -e 'sleep_secs'='10'
  -e 'run_startup'='yes'
  -e 'discord_notifications'='no'
  -e 'discord_url'=''
  -e 'cron'='*/2 * * * *'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/selfhosters/unRAID-CA-templates/master/templates/img/rdndc.png'
  -v '/var/run/docker.sock':'/var/run/docker.sock':'rw'
  -v '/boot/config/plugins/dockerMan/templates-user':'/config/docker-templates':'ro'
  -v '/mnt/user/appdata/rebuild-dndc':'/config/rebuild-dndc':'rw' 'eafxx/rebuild-dndc:unraid-m'

Thanks for taking a look at this! Great utility!

Phil-Barker commented 1 year ago

Same issue here - I've had to stop Rebuild-DNDC on unraid as every time it rebuilds the containers they lose all volumes

Phil-Barker commented 1 year ago

It seems the issue here lies within ParseDockerTemplate.sh Which was sourced from https://forums.unraid.net/topic/40016-start-docker-template-via-command-line/

That script is several years old and it appears that the XML file definitions have changed since then I've re-written it to work correctly and tested on my 6.11.5 server

I'll create a PR

Phil-Barker commented 1 year ago

Pull request created https://github.com/elmerfdz/rebuild-dndc/pull/60

@elmerfdz hope it helps, I'm no expert bash programmer so if you need to edit it/clean it up feel free :)

elmerfds commented 1 year ago

Pull request created #60

@elmerfdz hope it helps, I'm no expert bash programmer so if you need to edit it/clean it up feel free :)

@johnny2678 I've merged Phil's pull request now, could you please update and let us know if this is working for you now?

Phil-Barker commented 1 year ago

Thanks Elmer

I've pulled the latest version and given it a test on my Unraid - works fine with prowlarr, sonarr, radarr, etc..

 ----------------------------
  Stopping: radarr
 ----------------------------

radarr

----------------------------
  Removing: radarr
 ----------------------------

radarr

----------------------------
  Recreating: radarr
 ----------------------------

Name: radarr
Found Net:  --net="container:binhex-qbittorrentvpn"
Found Environment:  -e PUID="99"
Found Environment:  -e PGID="100"
Found Environment:  -e UMASK="022"
Found TimeZone:  -e TZ="Europe/London"
Found volume:  -v "/mnt/user/Movies/":"/movies":rw
Found volume:  -v "/mnt/short_cache/Downloads/Torrents/":"/downloads":rw
Found volume:  -v "/mnt/cache/appdata/radarr":"/config":rw
Found Repo:  lscr.io/linuxserver/radarr
/usr/bin/docker run -d --name="radarr" --net="container:binhex-qbittorrentvpn" -e PUID="99" -e PGID="100" -e UMASK="022" -e TZ="Europe/London" -v "/mnt/user/Movies/":"/movies":rw -v "/mnt/short_cache/Downloads/Torrents/":"/downloads":rw -v "/mnt/cache/appdata/radarr":"/config":rw lscr.io/linuxserver/radarr
4c2b63c9dafade672d5e1d08a548d096a728acd8f7490973bd4213cc6690d6d0

F. REBUILD: STATUS
  - Completed: sonarr binhex-prowlarr binhex-readarr radarr

I did think about people on old versions and was going to try to look through the Unraid changelog to find out when the XML format was updated, but work got in the way :(

johnny2678 commented 1 year ago

@johnny2678 I've merged Phil's pull request now, could you please update and let us know if this is working for you now?

Just rebuilt the image base on the latest commit and it looks good to me! thanks @Phil-Barker and @elmerfdz !