containrrr / watchtower

A process for automating Docker container base image updates.

Home Page:https://containrrr.dev/watchtower/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not restart auto-removing containers

xtexChooser opened this issue · comments

commented

Describe the bug

When updating a container marked as --rm, the container is not re-created after removal.

Steps to reproduce

  1. podman container run --name caddy --rm -d --pidfile=/var/run/containers/caddy.pid --replace --hostname=caddy codeberg.org/xvnet/x-caddy
  2. podman run --name watchtower --rm --volume /var/run/podman/podman.sock:/var/run/docker.sock docker.io/containrrr/watchtower:latest -R -d

Expected behavior

Restart the container

Screenshots

No response

Environment

Linux AMD64 podman 4.9.2

Your logs

`
time="2024-02-18T12:24:16Z" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."
time="2024-02-18T12:24:17Z" level=debug msg="Making sure everything is sane before starting"
time="2024-02-18T12:24:17Z" level=info msg="Watchtower 1.7.1"
time="2024-02-18T12:24:17Z" level=info msg="Using no notifications"
time="2024-02-18T12:24:17Z" level=info msg="Only checking containers not named one of \"bird\""
time="2024-02-18T12:24:17Z" level=info msg="Running a one time update."
time="2024-02-18T12:24:17Z" level=debug msg="Checking containers for updated images"
time="2024-02-18T12:24:17Z" level=debug msg="Retrieving running containers"
time="2024-02-18T12:24:17Z" level=debug msg="Trying to load authentication credentials." container=/caddy image="codeberg.org/xvnet/x-caddy:latest"
time="2024-02-18T12:24:17Z" level=debug msg="No credentials for codeberg.org found" config_file=/config.json
time="2024-02-18T12:24:17Z" level=debug msg="Got image name: codeberg.org/xvnet/x-caddy:latest"
time="2024-02-18T12:24:17Z" level=debug msg="Checking if pull is needed" container=/caddy image="codeberg.org/xvnet/x-caddy:latest"
time="2024-02-18T12:24:17Z" level=debug msg="Built challenge URL" URL="https://codeberg.org/v2/"
time="2024-02-18T12:24:17Z" level=debug msg="Got response to challenge request" header="Bearer realm=\"https://codeberg.org/v2/token\",service=\"container_registry\",scope=\"*\"" status="401 Unauthorized"
time="2024-02-18T12:24:17Z" level=debug msg="Checking challenge header content" realm="https://codeberg.org/v2/token" service=container_registry
time="2024-02-18T12:24:17Z" level=debug msg="Setting scope for auth token" image=codeberg.org/xvnet/x-caddy scope="repository:xvnet/x-caddy:pull"
time="2024-02-18T12:24:17Z" level=debug msg="No credentials found."
time="2024-02-18T12:24:17Z" level=debug msg="Parsing image ref" host=codeberg.org image=xvnet/x-caddy normalized=codeberg.org/xvnet/x-caddy tag=latest
time="2024-02-18T12:24:17Z" level=debug msg="Doing a HEAD request to fetch a digest" url="https://codeberg.org/v2/xvnet/x-caddy/manifests/latest"
time="2024-02-18T12:24:17Z" level=debug msg="Found a remote digest to compare with" remote="sha256:35bac3f4770fa92a1e19126c02bf3582bb3c9c7bc9d2397faeee3ee290ff0b3b"
time="2024-02-18T12:24:17Z" level=debug msg=Comparing local="sha256:593e1ee16ac17704242e6e0cbf344bec7e70faa0a9d55e7fac048144b67945af" remote="sha256:35bac3f4770fa92a1e19126c02bf3582bb3c9c7bc9d2397faeee3ee290ff0b3b"
time="2024-02-18T12:24:17Z" level=debug msg="Digests did not match, doing a pull."
time="2024-02-18T12:24:17Z" level=debug msg="Pulling image" container=/caddy image="codeberg.org/xvnet/x-caddy:latest"
time="2024-02-18T12:25:14Z" level=info msg="Found new codeberg.org/xvnet/x-caddy:latest image (7b75f83a4a42)"
time="2024-02-18T12:25:14Z" level=debug msg="Trying to load authentication credentials." container=/watchtower image="docker.io/containrrr/watchtower:latest"
time="2024-02-18T12:25:14Z" level=debug msg="No credentials for index.docker.io found" config_file=/config.json
time="2024-02-18T12:25:14Z" level=debug msg="Got image name: docker.io/containrrr/watchtower:latest"
time="2024-02-18T12:25:14Z" level=debug msg="Checking if pull is needed" container=/watchtower image="docker.io/containrrr/watchtower:latest"
time="2024-02-18T12:25:14Z" level=debug msg="Built challenge URL" URL="https://index.docker.io/v2/"
time="2024-02-18T12:25:14Z" level=debug msg="Got response to challenge request" header="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"" status="401 Unauthorized"
time="2024-02-18T12:25:14Z" level=debug msg="Checking challenge header content" realm="https://auth.docker.io/token" service=registry.docker.io
time="2024-02-18T12:25:14Z" level=debug msg="Setting scope for auth token" image=docker.io/containrrr/watchtower scope="repository:containrrr/watchtower:pull"
time="2024-02-18T12:25:14Z" level=debug msg="No credentials found."
time="2024-02-18T12:25:15Z" level=debug msg="Parsing image ref" host=index.docker.io image=containrrr/watchtower normalized=docker.io/containrrr/watchtower tag=latest
time="2024-02-18T12:25:15Z" level=debug msg="Doing a HEAD request to fetch a digest" url="https://index.docker.io/v2/containrrr/watchtower/manifests/latest"
time="2024-02-18T12:25:15Z" level=debug msg="Found a remote digest to compare with" remote="sha256:6dd50763bbd632a83cb154d5451700530d1e44200b268a4e9488fefdfcf2b038"
time="2024-02-18T12:25:15Z" level=debug msg=Comparing local="sha256:6dd50763bbd632a83cb154d5451700530d1e44200b268a4e9488fefdfcf2b038" remote="sha256:6dd50763bbd632a83cb154d5451700530d1e44200b268a4e9488fefdfcf2b038"
time="2024-02-18T12:25:15Z" level=debug msg="Found a match"
time="2024-02-18T12:25:15Z" level=debug msg="No pull needed. Skipping image."
time="2024-02-18T12:25:15Z" level=debug msg="No new images found for /watchtower"
time="2024-02-18T12:25:15Z" level=debug msg="Trying to load authentication credentials." container=/ntfy image="docker.io/binwiederhier/ntfy:latest"
time="2024-02-18T12:25:15Z" level=debug msg="No credentials for index.docker.io found" config_file=/config.json
time="2024-02-18T12:25:15Z" level=debug msg="Got image name: docker.io/binwiederhier/ntfy:latest"
time="2024-02-18T12:25:15Z" level=debug msg="Checking if pull is needed" container=/ntfy image="docker.io/binwiederhier/ntfy:latest"
time="2024-02-18T12:25:15Z" level=debug msg="Built challenge URL" URL="https://index.docker.io/v2/"
time="2024-02-18T12:25:15Z" level=debug msg="Got response to challenge request" header="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"" status="401 Unauthorized"
time="2024-02-18T12:25:15Z" level=debug msg="Checking challenge header content" realm="https://auth.docker.io/token" service=registry.docker.io
time="2024-02-18T12:25:15Z" level=debug msg="Setting scope for auth token" image=docker.io/binwiederhier/ntfy scope="repository:binwiederhier/ntfy:pull"
time="2024-02-18T12:25:15Z" level=debug msg="No credentials found."
time="2024-02-18T12:25:15Z" level=debug msg="Parsing image ref" host=index.docker.io image=binwiederhier/ntfy normalized=docker.io/binwiederhier/ntfy tag=latest
time="2024-02-18T12:25:15Z" level=debug msg="Doing a HEAD request to fetch a digest" url="https://index.docker.io/v2/binwiederhier/ntfy/manifests/latest"
time="2024-02-18T12:25:16Z" level=debug msg="Found a remote digest to compare with" remote="sha256:b8f8fb9ee044524d2baa303e5cfab4b3275378acf0b746bd9ace370a3b631a07"
time="2024-02-18T12:25:16Z" level=debug msg=Comparing local="sha256:b8f8fb9ee044524d2baa303e5cfab4b3275378acf0b746bd9ace370a3b631a07" remote="sha256:b8f8fb9ee044524d2baa303e5cfab4b3275378acf0b746bd9ace370a3b631a07"
time="2024-02-18T12:25:16Z" level=debug msg="Found a match"
time="2024-02-18T12:25:16Z" level=debug msg="No pull needed. Skipping image."
time="2024-02-18T12:25:16Z" level=debug msg="No new images found for /ntfy"
time="2024-02-18T12:25:16Z" level=debug msg="This is the watchtower container /watchtower"
time="2024-02-18T12:25:16Z" level=info msg="Stopping /caddy (84df6616f9bc) with SIGTERM"
time="2024-02-18T12:25:16Z" level=debug msg="AutoRemove container 84df6616f9bc, skipping ContainerRemove call."
time="2024-02-18T12:25:16Z" level=error msg="container /caddy (84df6616f9bc) could not be removed"
time="2024-02-18T12:25:16Z" level=info msg="Session done" Failed=1 Scanned=3 Updated=0 notify=no
time="2024-02-18T12:25:16Z" level=info msg="Waiting for the notification goroutine to finish" notify=no



### Additional context

_No response_

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏