BassT23/Proxmox

[BUG] Docker compose Containers not updated

wes1993 opened this issue · 41 comments

Hello again @BassT23,
I have seen that now the script works well but not update the containers...
Here some logs, all seems ok but the images are old... For example I have paperless and as you can see the script pulled new images but the service still use old image...

--- Searching for extra updates ---

*** Updating Docker-Compose ***
latest: Pulling from paperless-ngx/paperless-ngx
1f7ce2fa46ab: Already exists
f66cb2ec4ca8: Already exists
9e3072bcfe9d: Already exists
4a2b4836be3f: Already exists
312d1214a5ea: Already exists
79715e311297: Already exists
67baad8b72a8: Already exists
769c6e221a63: Already exists
7b83400665e7: Already exists
a558890626c8: Already exists
23e89aad1c66: Already exists
4f4fb700ef54: Already exists
7d875ef74be4: Pulling fs layer
a1f59aa9efa1: Pulling fs layer
46e66ba4a6dc: Pulling fs layer
821ad45eade2: Pulling fs layer
09791ebe7ab6: Pulling fs layer
821ad45eade2: Waiting
09791ebe7ab6: Waiting
46e66ba4a6dc: Download complete
7d875ef74be4: Download complete
7d875ef74be4: Pull complete
09791ebe7ab6: Verifying Checksum
09791ebe7ab6: Download complete
821ad45eade2: Verifying Checksum
821ad45eade2: Download complete
a1f59aa9efa1: Verifying Checksum
a1f59aa9efa1: Download complete
a1f59aa9efa1: Pull complete
46e66ba4a6dc: Pull complete
821ad45eade2: Pull complete
09791ebe7ab6: Pull complete
Digest: sha256:01c190595a547c2f39c99806348ba1d1091c218dc3741fb207598f767e2dea3f
Status: Downloaded newer image for ghcr.io/paperless-ngx/paperless-ngx:latest
ghcr.io/paperless-ngx/paperless-ngx:latest
Updating 646ba55af5cb image ghcr.io/paperless-ngx/paperless-ngx:latest
no configuration file provided: not found
7.8: Pulling from gotenberg/gotenberg
Digest: sha256:78477be56f7f20d0819880c3815b56a73228b9700afcdb9958abc858f96d8280
Status: Image is up to date for gotenberg/gotenberg:7.8
docker.io/gotenberg/gotenberg:7.8
7: Pulling from library/redis
af107e978371: Pulling fs layer
b031def5f2c4: Pulling fs layer
bf7f0c8796d3: Pulling fs layer
e3b2691a4104: Pulling fs layer
190b4d7a237a: Pulling fs layer
797591c7970a: Pulling fs layer
4f4fb700ef54: Pulling fs layer
45ce3854ac9a: Pulling fs layer
e3b2691a4104: Waiting
190b4d7a237a: Waiting
797591c7970a: Waiting
4f4fb700ef54: Waiting
45ce3854ac9a: Waiting
bf7f0c8796d3: Verifying Checksum
bf7f0c8796d3: Download complete
b031def5f2c4: Verifying Checksum
b031def5f2c4: Download complete
e3b2691a4104: Verifying Checksum
e3b2691a4104: Download complete
af107e978371: Verifying Checksum
af107e978371: Download complete
797591c7970a: Verifying Checksum
797591c7970a: Download complete
190b4d7a237a: Verifying Checksum
190b4d7a237a: Download complete
4f4fb700ef54: Verifying Checksum
4f4fb700ef54: Download complete
45ce3854ac9a: Download complete
af107e978371: Pull complete
b031def5f2c4: Pull complete
bf7f0c8796d3: Pull complete
e3b2691a4104: Pull complete
190b4d7a237a: Pull complete
797591c7970a: Pull complete
4f4fb700ef54: Pull complete
45ce3854ac9a: Pull complete
Digest: sha256:3c318e18f14a5c216e7923cdf32efcc677ef88dd083bc87878861ea63e2888ce
Status: Downloaded newer image for redis:7
docker.io/library/redis:7
Updating 2783f68ab935 image docker.io/library/redis:7
no configuration file provided: not found
latest: Pulling from paperless-ngx/tika
Digest: sha256:e85662605324bd157731480928fd7cffae041320f64198a62b0afbeac62fe90d
Status: Image is up to date for ghcr.io/paperless-ngx/tika:latest
ghcr.io/paperless-ngx/tika:latest

*** Cleaning ***
Total reclaimed space: 0B
Deleted Images:
untagged: ghcr.io/paperless-ngx/paperless-ngx:latest
untagged: ghcr.io/paperless-ngx/paperless-ngx@sha256:01c190595a547c2f39c99806348ba1d1091c218dc3741fb207598f767e2dea3f
deleted: sha256:48f34763455cca989aaf984d4609a69f06a05c296dae3312d813a6d7a4a94149
deleted: sha256:47b7c3e0cfc4b65c2e97b09a2b30e408084b533efd1af513ebdc5343fd747b64
deleted: sha256:94ac5abc3b870a799e0d922b0ba41a4b35180c5778a0a85145b4ebd4847a7925
deleted: sha256:878ced911e5d9573994e2cc6320bdfbfd4546dffa1bc1c960411960b6bf321f1
deleted: sha256:7b4baa2b099fe6234a3707b5e95b3746de85041ba35c55ec10d9c156b697e97d
deleted: sha256:3b93bb0395898fdac894c98e50ba9083f2ea1b80b4b807388ce9fe1f3e35858e
untagged: redis:7
untagged: redis@sha256:3c318e18f14a5c216e7923cdf32efcc677ef88dd083bc87878861ea63e2888ce
deleted: sha256:e40e2763392d8dea3270841365bf740c7157fb6076a09b43e669aa4159fc5de3
deleted: sha256:601600e022854fda420430a894bdf407b0ecefdfbace410241759094a3cc80b3
deleted: sha256:0858ab9681ede2d167da04298927262404a708f007a268b45a933c42b6d63889
deleted: sha256:a789e624d45b658776635215f2d9697a47a36270b099a95e07d517dc8011bd07
deleted: sha256:6c19e7bdd6d878f555383d87ed3588b60a56ee09e9a2ea33f475054284e28a2d
deleted: sha256:7596aab5c469fa9ea44eb62f2d19df276332f199db3e49cd801d5eb4f0540fc7
deleted: sha256:d5289e11061a7b3826bfeca2a529c991951dbb147ad2ad8090bd45f9a271273d
deleted: sha256:445b8e10d444e352cc20cd7ca3dff1718c1f9ac9aa07af5c2981f84b124bb037
deleted: sha256:7292cf786aa89399bca4e3edd105d3b2ee0683a46ef1f5ff436c0f9d1d49e765

Total reclaimed space: 944.8MB
Total reclaimed space: 0B
Total reclaimed space: 0B

Probably because won't stop and start the container before the cleaning clean the new images pulled?

Best Regards
Stefano

Sorry for long time waiting ;)
I'm now back, and hope to fix it this week (with release v4.1)

No problem, i have time :-D

Thanks for your help

I have now build in an "stop" before the rebuild.
I had no time for now to test, but would be cool if you can - if you had an oldstable build.

update beta -up

after the update you first need a restart of the node, because I now move the updater in /etc/

hopefully I can test it on weekend.

Don't know if it's related but I'm getting "unknown shorthand flag: 'd' in -d" in LXCs with Docker

Don't know if it's related but I'm getting "unknown shorthand flag: 'd' in -d" in LXCs with Docker

Interesting, in docker doku -d is listed as:

--detach -d Detached mode: Run containers in the background

But in docker compose --help the -d is not listed.
I'm on docker compose v2.21.0

What does docker compose version show for you?

For me, I tested with latest beta branch (updater) and all look ok.

Hello @BassT23
My docker works with docker compose up -d

I have this errors with the beta:

image

Best Regards
Stefano

Hello @BassT23 My docker works with docker compose up -d

I have this errors with the beta:

image

Best Regards Stefano

ok, there is an mistake in file transfer because of name/directory changing.
Eseast way for now is, to edit the /etc/ultinate-updater/update-extras.sh

Line 9/10:

# Variables
CONFIG_FILE="/etc/ultimate-updater/update.conf"

but stop, I think you dont change the update-extras.sh during update to beta.
So you better should change the whole file with:

> /etc/ultimate-updater/update-extras.sh
nano /etc/ultimate-updater/update-extras.sh

And paste this in:

#!/bin/bash

#################
# Update-Extras #
#################

VERSION="1.8.4"

# Variables
CONFIG_FILE="/etc/ultimate-updater/update.conf"
PIHOLE=$(awk -F'"' '/^PIHOLE=/ {print $2}' $CONFIG_FILE)
IOBROKER=$(awk -F'"' '/^IOBROKER=/ {print $2}' $CONFIG_FILE)
PTERODACTYL=$(awk -F'"' '/^PTERODACTYL=/ {print $2}' $CONFIG_FILE)
OCTOPRINT=$(awk -F'"' '/^OCTOPRINT=/ {print $2}' $CONFIG_FILE)
DOCKER_COMPOSE=$(awk -F'"' '/^DOCKER_COMPOSE=/ {print $2}' $CONFIG_FILE)

# PiHole
if [[ -f "/usr/local/bin/pihole" && $PIHOLE == true ]]; then
  echo -e "\n*** Updating PiHole ***\n"
  /usr/local/bin/pihole -up
fi

# ioBroker
if [[ -d "/opt/iobroker" && $IOBROKER == true ]]; then
  echo -e "\n*** Updating ioBroker ***\n"
  echo "*** Stop ioBroker ***" && iob stop && echo
  echo "*** Update/Upgrade ioBroker ***" && iob update && iob upgrade -y && iob upgrade self -y && echo
  echo "*** Start ioBroker ***" && iob start && echo
  if [[ -d "/opt/iobroker/iobroker-data/radar2.admin" ]]; then
    setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which arp-scan)')"
    setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which node)')"
    setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which arp)')"
    setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which hcitool)')"
    setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which hciconfig)')"
    setcap cap_net_admin,cap_net_raw,cap_net_bind_service=+eip "$(eval readlink -f '$(which l2ping)')"
  fi
fi

# Pterodactyl
if [[ -d "/var/www/pterodactyl" && $PTERODACTYL == true ]]; then
  echo -e "\n*** Updating Pterodactyl ***\n"
  cd /var/www/pterodactyl || exit
  php artisan down
  curl -L https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz | tar -xzv
  chmod -R 755 storage/* bootstrap/cache
  composer install --no-dev --optimize-autoloader
  php artisan view:clear
  php artisan config:clear
  php artisan migrate --seed --force
  os=$(hostnamectl | grep System)
  if [[ $os =~ CentOS ]]; then
    # If using NGINX on CentOS:
    if id -u "nginx" >/dev/null 2>&1; then
      chown -R nginx:nginx /var/www/pterodactyl/*
    # If using Apache on CentOS
    elif id -u "apache" >/dev/null 2>&1; then
      chown -R apache:apache /var/www/pterodactyl/*
    fi
  else
    # If using NGINX or Apache (not on CentOS):
    chown -R www-data:www-data /var/www/pterodactyl/*
  fi
  php artisan queue:restart
  php artisan up
  #Upgrading Wings
  systemctl stop wings
  curl -L -o /usr/local/bin/wings "https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")"
  chmod u+x /usr/local/bin/wings
  systemctl restart wings
fi

# Octoprint
if [[ -d "/root/OctoPrint" && $OCTOPRINT == true ]]; then
  echo -e "\n*** Updating Octoprint ***\n"
  # find octoprint
  OPRINT=$(find /home -name "oprint")
  "$OPRINT"/bin/pip install -U --ignore-installed octoprint
  sudo service octoprint restart
fi

# Docker-Compose
if [[ -d "/etc/docker" && $DOCKER_COMPOSE == true ]]; then
  if COMPOSE=$(find /home -name "docker-compose.yaml" >/dev/null 2>&1 | rev | cut -c 20- | rev | tail -n 1); then
    :
  elif COMPOSE=$(find /home -name "docker-compose.yml" >/dev/null 2>&1 | rev | cut -c 20- | rev | tail -n 1); then
    :
  fi
  cd "$COMPOSE" || exit
  echo -e "\n*** Updating Docker-Compose ***"
  # Get the containers from first argument, else get all containers
  CONTAINER_LIST="${1:-$(docker ps -q)}"
  for CONTAINER in ${CONTAINER_LIST}; do
    # Get requirements
    CONTAINER_IMAGE=$(docker inspect --format "{{.Config.Image}}" --type container "${CONTAINER}")
    RUNNING_IMAGE=$(docker inspect --format "{{.Image}}" --type container "${CONTAINER}")
    NAME=$(docker inspect --format "{{.Name}}" --type container "${CONTAINER}" | cut -c 2-)
    # Pull in latest version of the container and get the hash
    docker pull "${CONTAINER_IMAGE}" 2> /dev/null
    LATEST_IMAGE=$(docker inspect --format "{{.Id}}" --type image "${CONTAINER_IMAGE}")
    # Restart the container if the image is different by name
    if [[ ${RUNNING_IMAGE} != "${LATEST_IMAGE}" ]]; then
      echo "Updating ${CONTAINER} image ${CONTAINER_IMAGE}"
      docker compose stop "$NAME"
      docker compose up -d --no-deps --build "$NAME"
    fi
  done
  # Cleaning
  echo -e "\n*** Cleaning ***"
  docker container prune -f
  docker system prune -a -f
  docker image prune -f
  docker system prune --volumes -f
fi

save (STRG+S) and exit (Strg+X)

@BassT23,
Yes my bad, i'm testimng but unfortunately none of my containers have available updates..

One question:
If I set to false only running container here, the stopped containers/VMs are also skipped from the update checker?:

################################################
#               Host / LXC / VM                #
################################################

WITH_HOST="true"
WITH_LXC="true"
WITH_VM="true"

STOPPED_CONTAINER="true"
RUNNING_CONTAINER="true"

Thanks a lot for your work

Stefano

No, the "Update-Checker" only respect line 69/70.

But I can implement in furure ;)
Best would be, you make a feature request for this ;)

Sorry for wrong answer;
Checker, also use RUNNING and STOPPED variable.
I now rebuild config file, so you can set the variables better then.

@BassT23,
Perfect thanks a lot.

done, please test develop branch, if you want.

update develop -up

Perfect, I'll do now

Could you please tell me when release the stable version so I'll change branch.

Thanks a lot
Stefano

@brouna
is it possible for you to update docker compose to >v2.0?

With new 4.0.1 docker -compose v1 don't work anymore.
If you don't can, I must look, if I could make both version possible.

@wes1993
If you "watch" this git repo, you should become an email, if I release the new master branch :)

Hopefully this weekend :)

@brouna
The best would be, you clone the docker machine and try to convert to docker compose v2.
So you can roll back at anytime to the productive machine.

From docs.docker:

Warning

The final Compose V1 release, version 1.29.2, was May 10, 2021. These packages haven't received any security updates since then. Use at your own risk.

Thats sad,
so I will try to implement a docker compose v1 and v2 update ;)

So, Docker Compose v1 and v2 now should work.
Please test latest develop version and give feedback.

update beta -up

Beta appears to work for docker v1 - shows images being pulled, cleanup being done, no error messages. But it seems to run the same updates every time, and always have something to clean up on back-to-back runs, so changes are not actually being made? eg:

`*** Cleaning ***
Total reclaimed space: 0B
Deleted Images:
untagged: jc21/nginx-proxy-manager@sha256:e63000388eae7a76ddfcd6a97b58521e52ce332ae7c16fa3bf2e62544dabc838
deleted: sha256:27b3e4961f08bd120631f89e3516c5315e0a939c0486b4e8442a79df2d5f2bd7
deleted: sha256:e339f7261cf46179c72ea3b5782144985eeb699da629fc55c55e990ede376f13
deleted: sha256:22f654878f9efecba50249c04072f71ebc7deb1f075ef94c34e906b143a19f1f
deleted: sha256:26971b38f3f0d2219bd5ae607139a05cac1635b5ae24b81f32131fe4a1d15cb0
deleted: sha256:8b917c34217104689ec2feee13a367c8db590e2102f88dbbcaa8607e3cd19f78
deleted: sha256:a50fba90a75b56bbc6d753b6a772ed051294a9b71698917e8a7aeee9e31a1232
deleted: sha256:d5f69633862f26ffc9f3663b92a1bff47d323b21d3b2eed554cf7e5e4bcff1d6
deleted: sha256:9d456cc31ea8953714ca719a9d9f0737af15401214168e921062f3da0029a820
deleted: sha256:b8d02549f567169040dcbb3cb60a7fa98b4492d869c4eefcaeadf45b82a8fc99
deleted: sha256:7b510d89da9a7896cf326a41bf740c7387800360dbbf4c4e28aa32be6aeaf22e
deleted: sha256:16b9586c393efb8d7a1b67d79be1379695c8bb403be7289a4cb8d2b2ca9d0695
deleted: sha256:bfff287a3d23ef6b985c8af621aa4696cf886f14d2e2b57c2a1e6c6c39dc23f6
deleted: sha256:07fcadcb44984031a0d9e1b55fc6f890a24f610066ceda58fc61522aa98d18b6
deleted: sha256:efdc887b2dfe83292d24a8becc16609b342f55a8f8cb24d4fd205e3815064ba2
deleted: sha256:9a06bc3ede6f135eb2f1ea47e43cb92d5018555d8497dd89bd8473ff92a4393d
deleted: sha256:49bcd20488d6459266582146eb0701fd5fa6840ab8817df853ea3b95fa089607
deleted: sha256:4df8da53ad2dbd2488a3b45822bcc381cad061d5d7d5ec832379624a12fbb57e
deleted: sha256:20e5b80a6bc30d85eb155de14b776272322362f672bdf763c606c4cd93531109
deleted: sha256:3931bbdf088cb4975027bfdd30837bd2652753173d0a24195af543f7da65d22c
deleted: sha256:648ff49e87197cf299b3efe74244d3b06477ae6475693b451953cb49cd5b9b3d
deleted: sha256:2faefc4df21a6f603020aa7c426b38b1352f060c0100fb6c46f2c738ecacd2ca
deleted: sha256:c7f0c3e1dce8f2b8f764c5fcf9ad7711c08baac473bf8cee0bdbd40437e27855
deleted: sha256:1612c14f19894b8de4529d85f96a5f0368d457b12d0ef16f8e4593c0a0aaf29f
deleted: sha256:665cb688e5eb7bfbdb7c0fe219c750f0685730f34af458e425ea37ed86432c6a
deleted: sha256:43767af882f3bec285489ec2eab5456fbba9d2f3f390ec60f3b4d5f089fea941
deleted: sha256:13b3fce375364cbadfd13050e9871af1e1eef6cdc88160474f71addf7721cb23
deleted: sha256:f4b4d52f482a37f33619b594ce25af7f38194176f446fe215cc93175efc8cac4
deleted: sha256:2094083eec5a3114dc646b04cd2e56fab602d329130b588cec4b63b2176ec0a2
deleted: sha256:bbdb4a4343f59965d154c2fb1dfc8e3d8cf3a1afc35b66077ca3854cd9d6ae71
deleted: sha256:3ca18dc9b819785c1d42eaa380a52f070b9c77dc72d92f7e662533f199742d40
deleted: sha256:ea795ae35fe0e6ccda5b69f3abc3db620f6c2daece3130e482d319381b9422f8
deleted: sha256:10d13e9f3b26f19c6d8953e62eb1a0aae928167917bf245375daf93e11ea9834
deleted: sha256:58508f832d83cadc3c6a78fb36505381d8201b72be66e38c962f51f1d4511b67
deleted: sha256:d2897ab29b0ec0aa813838250f2a2d47cbb5529d09573b5a296144cf75117eb7

Total reclaimed space: 843.4MB
Total reclaimed space: 0B`

I have the same problem.. seems that after the start the docker containers not updated

Thanks for testing, will have a look on it.

ok, now it work :)

update beta -up

fixed :)

@BassT23,
I have updated to the latest beta but the problem still present...
I have found three errors:

  1. After i run the update command and everything finish i still have this:
    image
  2. The updater seems that not handle the Docker containers in LXC machine:
    image
  3. Seems that won't find the docker compose file now for one of my Docker containe (Paperless)
    image

If manually run ./check-updates.sh the status update correctly.

Best Regards
Stefano

@brouna, you are right.
I tested also with nginx-proxy-manager. The container seems not to start. To fix this I build in an "restart" after all.
Seems to work now :)

@wes, where is the compose yaml/yml located for paperless?
I only search in /home - could this be the problem?
The welcome screen update is strange. But first try to fix docker-compose ;)

Hello @BassT23,
image

Best Regards
Stefano

Hi @ll, could you please test the latest develop version with update develop -up and give feedback :)

Hi @ll, could you please test the latest develop version with update develop -up and give feedback :)

Doesnt seem to attempt to update docker at all now.

Any output, can you explain more in detail what's happening ?

Runs apt-update as normal on each LXC, that’s all. No messages that it’s even trying to update docker:

--- Searching for extra updates --- --- Finished extra updates --- Unless that means there genuinely are no updates...
On May 10, 2024, at 18:31, Gauvino @.***> wrote: Any output, can you explain more in detail what's happening ? — Reply to this email directly, view it on GitHub <#102 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUTL62WPNUOSI62TMYTFPDZBVDERAVCNFSM6AAAAABA4QO7NKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGM2DKNRUG4. You are receiving this because you were mentioned.

you have correctly updated to develop and select in the config file where your docker compose are stored ?
also have you set to true in the config file of the script to update docker compose

Yes to both (update path is /root)

On May 10, 2024, at 18:39, Gauvino @.> wrote: Runs apt-update as normal on each LXC, that’s all. No messages that it’s even trying to update docker: … x-msg://34/# --- Searching for extra updates --- --- Finished extra updates --- Unless that means there genuinely are no updates... On May 10, 2024, at 18:31, Gauvino @.> wrote: Any output, can you explain more in detail what's happening ? — Reply to this email directly, view it on GitHub <#102 (comment) <#102 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUTL62WPNUOSI62TMYTFPDZBVDERAVCNFSM6AAAAABA4QO7NKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGM2DKNRUG4. You are receiving this because you were mentioned. you have correctly updated to develop and select in the config file where your docker compose are stored ? also have you set to true in the config file of the script to update docker compose — Reply to this email directly, view it on GitHub <#102 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUTL66TBAZ4WJFZZDJB53TZBVEDZAVCNFSM6AAAAABA4QO7NKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBVGM2TAOBTG4. You are receiving this because you were mentioned.

Hello a guy did have the same problem i did a bit of re-search could you please make this command and after this change the update.conf file and tell me !

Command: rm -rf /etc/ultimate-updater && bash <(curl -s https://raw.githubusercontent.com/BassT23/Proxmox/master/install.sh) install && update develop -up