Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

After Updating docker container no longer starts. it starts and immadiatley fails. #307

Closed
1 of 3 tasks
awptechnologies opened this issue Jan 19, 2024 · 8 comments · Fixed by #313
Closed
1 of 3 tasks
Labels

Comments

@awptechnologies
Copy link

Support guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

crazymax swarmcron not running after update

Expected behaviour

container to run.

Actual behaviour

container will not start and stay running.

Steps to reproduce

update to latest docker version

swarm-cronjob version

latest

Docker info

cant post this as it contains ips and usernames for registries.

Docker Compose config

No response

Logs

no logs container wont let run long enough all i get is an exit code

Additional info

No response

@mcarim
Copy link

mcarim commented Jan 19, 2024

I'm also facing the same issue. After upgrading docker in Ubuntu 22.04 LTS, swarm-cronjob is failing:

$ docker service logs traefik_swarm-cronjob
traefik_swarm-cronjob.1.7wyv6xf91a6q@ip-172-31-10-224 | Fri, 19 Jan 2024 18:06:57 -03 INF Starting swarm-cronjob v1.12.0
traefik_swarm-cronjob.1.7wyv6xf91a6q@ip-172-31-10-224 | Fri, 19 Jan 2024 18:06:57 -03 FTL Cannot initialize swarm-cronjob error="Error response from daemon: client version 1.12 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version"

$ docker version
Client: Docker Engine - Community
Version: 25.0.0
API version: 1.44
Go version: go1.21.6
Git commit: e758fe5
Built: Thu Jan 18 17:09:49 2024
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 25.0.0
API version: 1.44 (minimum version 1.24)
Go version: go1.21.6
Git commit: 615dfdf
Built: Thu Jan 18 17:09:49 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.27
GitCommit: a1496014c916f9e62104b33d1bb5bd03b0858e59
runc:
Version: 1.1.11
GitCommit: v1.1.11-0-g4bccb38
docker-init:
Version: 0.19.0
GitCommit: de40ad0

@awptechnologies
Copy link
Author

i will parse all my personal info out and post docker info to see if its the same....

Client: Docker Engine - Community
Version: 25.0.0
API version: 1.44
Go version: go1.21.6
Git commit: e758fe5
Built: Thu Jan 18 17:09:59 2024
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 25.0.0
API version: 1.44 (minimum version 1.24)
Go version: go1.21.6
Git commit: 615dfdf
Built: Thu Jan 18 17:09:59 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.27
GitCommit: a1496014c916f9e62104b33d1bb5bd03b0858e59
nvidia:
Version: 1.1.11
GitCommit: v1.1.11-0-g4bccb38
docker-init:
Version: 0.19.0
GitCommit: de40ad0

@bolet
Copy link

bolet commented Jan 20, 2024

I replaced all image versions in Dockerfile with their "latest" versions, hoping a simple rebuild would solve the issue. It didn't.
Next step: dive into go sources / dependencies.

@bolet
Copy link

bolet commented Jan 20, 2024

This fixes the issue, but I'm not an expert in go, so I won't make a PR.
Meanwhile if my "hack" helps anyone, here it is:

diff --git a/internal/docker/client.go b/internal/docker/client.go
index 226a85a..e25418f 100644
--- a/internal/docker/client.go
+++ b/internal/docker/client.go
@@ -34,7 +34,7 @@ type DockerClient struct {
 
 // NewEnvClient initializes a new Docker API client based on environment variables
 func NewEnvClient() (*DockerClient, error) {
-       dockerAPICli, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion("1.12"))
+       dockerAPICli, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion("1.24"))
        if err != nil {
                return nil, errors.Wrap(err, "failed to initialize Docker API client")
        }

@awptechnologies
Copy link
Author

Any idea when this will be added to the image for people that don't know how to do that?

@bolet
Copy link

bolet commented Jan 21, 2024

Any idea when this will be added to the image for people that don't know how to do that?

I expect the official fix to come very soon, but if you can't wait it's easy to apply my fix yourself.
You don't need any tools other than docker. In short:

  1. download the sources of this repo (through git clone or as a zip)
  2. make the change (in file internal/docker/client.go, line 37, replace 1.12 with 1.24)
  3. from the root of the source directory, where you find Dockerfile, run docker build -t yourownimage .
  4. use yourownimage instead of crazymax/swarm-cronjob

@tomdaley92
Copy link

I'm also facing the same issue. After upgrading docker in Ubuntu 22.04 LTS, swarm-cronjob is failing:

$ docker service logs traefik_swarm-cronjob traefik_swarm-cronjob.1.7wyv6xf91a6q@ip-172-31-10-224 | Fri, 19 Jan 2024 18:06:57 -03 INF Starting swarm-cronjob v1.12.0 traefik_swarm-cronjob.1.7wyv6xf91a6q@ip-172-31-10-224 | Fri, 19 Jan 2024 18:06:57 -03 FTL Cannot initialize swarm-cronjob error="Error response from daemon: client version 1.12 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version"

$ docker version Client: Docker Engine - Community Version: 25.0.0 API version: 1.44 Go version: go1.21.6 Git commit: e758fe5 Built: Thu Jan 18 17:09:49 2024 OS/Arch: linux/amd64 Context: default

Server: Docker Engine - Community Engine: Version: 25.0.0 API version: 1.44 (minimum version 1.24) Go version: go1.21.6 Git commit: 615dfdf Built: Thu Jan 18 17:09:49 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.27 GitCommit: a1496014c916f9e62104b33d1bb5bd03b0858e59 runc: Version: 1.1.11 GitCommit: v1.1.11-0-g4bccb38 docker-init: Version: 0.19.0 GitCommit: de40ad0

Same here.

@crazy-max
Copy link
Owner

#313 should fix this issue

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
5 participants