watchtower: DOCKER_API_VERSION question/bug

Describe the bug

Hello,

I recently started using the repo you are updating. Thank you for the work put in ! There is an interesting issue. If you don’t set the environment variable DOCKER_API_VERSION to anything then you get this warning: “The DOCKER_API_VERSION environment variable is set to a version lower than 1.44. This may cause unexpected behavior while recreating docker containers.”

If you set it up to 1.44, then the entire image doesn’t go up with this error: “Error respond from daemon: client version 1.44 is too new. Maximum supported API version is 1.41”

Is the warning relevant? I’ve noticed that the images that get update don’t get built afterwards, thinking maybe this is the issue?

Please let me know if there are any more details that i can provide to help in this regarding.

Steps to reproduce

  1. Stop container
  2. DOCKER_API_VERSION to 1.44
  3. Start container

Expected behavior

No warning displayed

Screenshots

No response

Environment

  • Platform: Synology
  • Architecture: not sure
  • Docker Version: using Container Manager

Your logs

With version 1.44 as variable:
watchtower
date	stream	content
2025/02/04 09:37:14	stderr	time="2025-02-04T09:37:14+02:00" level=info msg="Waiting for the notification goroutine to finish" notify=no
2025/02/04 09:37:14	stderr	time="2025-02-04T09:37:14+02:00" level=error msg="Error response from daemon: client version 1.44 is too new. Maximum supported API version is 1.41"
2025/02/04 09:37:14	stderr	time="2025-02-04T09:37:14+02:00" level=debug msg="Retrieving running, stopped and exited containers"
2025/02/04 09:37:14	stderr	time="2025-02-04T09:37:14+02:00" level=debug msg="Making sure everything is sane before starting"
2025/02/04 09:37:13	stderr	time="2025-02-04T09:37:13+02:00" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."
2025/02/04 09:37:10	stderr	time="2025-02-04T09:37:10+02:00" level=info msg="Waiting for the notification goroutine to finish" notify=no
2025/02/04 09:37:10	stderr	time="2025-02-04T09:37:10+02:00" level=error msg="Error response from daemon: client version 1.44 is too new. Maximum supported API version is 1.41"
2025/02/04 09:37:10	stderr	time="2025-02-04T09:37:10+02:00" level=debug msg="Retrieving running, stopped and exited containers"
2025/02/04 09:37:10	stderr	time="2025-02-04T09:37:10+02:00" level=debug msg="Making sure everything is sane before starting"
2025/02/04 09:37:09	stderr	time="2025-02-04T09:37:09+02:00" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."
2025/02/04 09:37:07	stderr	time="2025-02-04T09:37:07+02:00" level=info msg="Waiting for the notification goroutine to finish" notify=no
2025/02/04 09:37:07	stderr	time="2025-02-04T09:37:07+02:00" level=error msg="Error response from daemon: client version 1.44 is too new. Maximum supported API version is 1.41"
2025/02/04 09:37:07	stderr	time="2025-02-04T09:37:07+02:00" level=debug msg="Retrieving running, stopped and exited containers"
2025/02/04 09:37:07	stderr	time="2025-02-04T09:37:07+02:00" level=debug msg="Making sure everything is sane before starting"
2025/02/04 09:37:06	stderr	time="2025-02-04T09:37:06+02:00" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."
2025/02/04 09:37:04	stderr	time="2025-02-04T09:37:04+02:00" level=info msg="Waiting for the notification goroutine to finish" notify=no
2025/02/04 09:37:04	stderr	time="2025-02-04T09:37:04+02:00" level=error msg="Error response from daemon: client version 1.44 is too new. Maximum supported API version is 1.41"
2025/02/04 09:37:04	stderr	time="2025-02-04T09:37:04+02:00" level=debug msg="Retrieving running, stopped and exited containers"
2025/02/04 09:37:04	stderr	time="2025-02-04T09:37:04+02:00" level=debug msg="Making sure everything is sane before starting"
2025/02/04 09:37:03	stderr	time="2025-02-04T09:37:03+02:00" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."
2025/02/04 09:37:00	stderr	time="2025-02-04T09:37:00+02:00" level=info msg="Waiting for the notification goroutine to finish" notify=no
2025/02/04 09:37:00	stderr	time="2025-02-04T09:37:00+02:00" level=error msg="Error response from daemon: client version 1.44 is too new. Maximum supported API version is 1.41"
2025/02/04 09:37:00	stderr	time="2025-02-04T09:37:00+02:00" level=debug msg="Retrieving running, stopped and exited containers"
2025/02/04 09:37:00	stderr	time="2025-02-04T09:37:00+02:00" level=debug msg="Making sure everything is sane before starting"
2025/02/04 09:36:59	stderr	time="2025-02-04T09:36:59+02:00" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."

With version 1.41 as variable:
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=info msg="Note that the first check will be performed in 20 hours, 21 minutes, 43 seconds"
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=info msg="Scheduling first run: 2025-02-05 06:00:00 +0200 EET"
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=info msg="Checking all containers (except explicitly disabled with label)"
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=info msg="Using notifications: smtp"
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=info msg="Watchtower 2.1.2"
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=debug msg="Watchtower HTTP API skipped."
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=debug msg="There are no additional watchtower containers"
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=debug msg="Retrieving running, stopped and exited containers"
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=debug msg="Retrieving running, stopped and exited containers"
2025/02/04 09:38:16	stderr	time="2025-02-04T09:38:16+02:00" level=debug msg="Making sure everything is sane before starting"
2025/02/04 09:38:15	stderr	time="2025-02-04T09:38:15+02:00" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."
2025/02/04 09:38:15	stderr	time="2025-02-04T09:38:15+02:00" level=warning msg="The DOCKER_API_VERSION environment variable is set to a version lower than 1.44. This may cause unexpected behavior while recreating docker containers."



Docker compose file:
version: "3"
services:
  watchtower:
    container_name: watchtower
    restart: unless-stopped
    image: beatkind/watchtower:latest
    environment:
      WATCHTOWER_NOTIFICATIONS: "email"
      WATCHTOWER_NOTIFICATION_EMAIL_FROM: 
      WATCHTOWER_NOTIFICATION_EMAIL_TO: 
      WATCHTOWER_NOTIFICATION_EMAIL_SERVER:
      WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT: 
      WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER: 
      WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD: 
      # every day at 6 am
      WATCHTOWER_SCHEDULE: 0 0 6 * * *
      # testing
      #WATCHTOWER_SCHEDULE: "*/6 * * * *"
      TZ: 'Europe/Bucharest'
      WATCHTOWER_CLEANUP: "true" 
      DOCKER_API_VERSION: "1.41"
      WATCHTOWER_ROLLING_RESTART: "true"
      WATCHTOWER_INCLUDE_STOPPED: "true"
      WATCHTOWER_DEBUG: "true"
     # DOCKER_HOST: "true"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 31 (14 by maintainers)

Most upvoted comments

Give me 15 min, i’ll test out the beta version. It’s the least i can do.

Hey - Just tagging along here as began using the Fork,

Synology user here as well using the same Docker version as the OP - 24.0.2 (API 1.43) I noticed on my run last night I am OK from a general checking and pulling of the Images however, it fails to then create them

time="2025-03-19T02:37:38Z" level=error msg="\"specify mac-address per network\" requires API version 1.44, but the Docker daemon API version is 1.43"

time="2025-03-19T02:37:38Z" level=info msg="Creating /homepage"

These are all containers created via docker compose, some are on the same user defined bridge while others are completely independent.

services:
  watchtower:
    image: beatkind/watchtower
    container_name: watchtower
    environment:
      - TZ=Europe/London
      - WATCHTOWER_CLEANUP=true
      - WATCHTOWER_INCLUDE_STOPPED=true
      - WATCHTOWER_REVIVE_STOPPED=false
      - WATCHTOWER_SCHEDULE=0 0 2 * * *
      - DOCKER_API_VERSION=1.43
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: unless-stopped

Happy to provide whatever other information would be useful.

v2.2.0 is released

@SteffoSpieler:

With latest-dev I’m getting:

Error response from daemon: client version 1.44 is too new. Maximum supported API version is 1.43

(Synology NAS with Beta Docker)

This solution for that lies in DOCKER_API_VERSION.

Argument: --api-version, -a
Environment Variable: DOCKER_API_VERSION
Type: String
Default: "1.24"

If you set that to 1.43 it should work. In latest-dev the minimum version for docker api is set to 1.44 by default.

Hello, first of all, thanks for keeping this fork up to date!

As @bogdans92 , I have also started using this repo recently and had the exact same problem: images get pulled, but the containers do not get recreated afterwards. In my notifications, I also get the DOCKER_API_VERSION message.

In my case, I am running docker on nixOS. This is the output for docker version:

Client:
 Version:           27.3.1
 API version:       1.47
 Go version:        go1.23.5
 Git commit:        v27.3.1
 Built:             Thu Jan  1 00:00:00 1970
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          27.3.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.23.5
  Git commit:       v27.3.1
  Built:            Tue Jan  1 00:00:00 1980
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.23
  GitCommit:        v1.7.23
 runc:
  Version:          1.1.14
  GitCommit:
 docker-init:
  Version:          0.19.0
  GitCommit:

And this is the output from beatkind/watchtower’s container startup:

time="2025-02-14T11:18:30+01:00" level=info msg="Watchtower 2.1.2" notify=no
time="2025-02-14T11:18:43+01:00" level=info msg="Waiting for running update to be finished..."
time="2025-02-14T11:18:43+01:00" level=warning msg="The DOCKER_API_VERSION environment variable is set to a version lower than 1.44. This may cause unexpected behavior while recreating docker containers."
time="2025-02-14T11:18:44+01:00" level=info msg="Watchtower 2.1.2" notify=no
time="2025-02-14T11:18:44+01:00" level=info msg="Using notifications: telegram" notify=no
time="2025-02-14T11:18:44+01:00" level=info msg="Only checking containers using enable label" notify=no
time="2025-02-14T11:18:44+01:00" level=info msg="Scheduling first run: 2025-02-15 11:18:44 +0100 CET" notify=no
time="2025-02-14T11:18:44+01:00" level=info msg="Note that the first check will be performed in 23 hours, 59 minutes, 59 seconds" notify=no

I believe I have an updated version of docker, so I wouldn’t know what is wrong here. Let me know if I can help with any other additional details. Thanks again!