Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

New error with latest Docker. #42

Open
crkinard opened this issue Jan 29, 2024 · 9 comments · May be fixed by #43
Open

New error with latest Docker. #42

crkinard opened this issue Jan 29, 2024 · 9 comments · May be fixed by #43

Comments

@crkinard
Copy link

crkinard commented Jan 29, 2024

Error response from daemon: NetworkDriver.CreateNetwork: failed to retrieve list of networks from Docker: Error response from daemon: client version 1.13.1 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version

crkinard@thing1: /srv :$ docker version
Client: Docker Engine - Community
 Version:           25.0.1
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        29cf629
 Built:             Tue Jan 23 23:09:23 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          25.0.1
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       71fa3ab
  Built:            Tue Jan 23 23:09:23 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
networks:
  lan_dhcp:
    name: lan_dhcp
    driver: docker-net-dhcp:latest
    driver_opts:
      bridge: br0
    ipam:
      driver: "null"
@relet
Copy link

relet commented Jan 30, 2024

I just got the same. The issue might be with the release version, and rebuilding the plugin container might help.

@relet
Copy link

relet commented Jan 30, 2024

The issue is resolved by enabling API version negotiation in the client.

	//client, err := docker.NewClient("unix:///run/docker.sock", "v1.13.1", nil, nil)
	client, err := docker.NewClientWithOpts(client.WithAPIVersionNegotiation(), docker.FromEnv)

@relet relet linked a pull request Jan 30, 2024 that will close this issue
@crkinard
Copy link
Author

I have a better chance of getting macvlan working then figuring out how to fix this heh,

@tjandras
Copy link

@relet Is it possible that I clone your branch and build the fixed version myself? If yes, can you explain how? Thanks!

@relet
Copy link

relet commented Feb 13, 2024

Yes, there are several branches that have the fix by now.
In principle you can docker build locally to get the plugin, or push the result to a registry (eg github) and pull from there.

@NonaSuomy
Copy link

NonaSuomy commented Feb 27, 2024

Can you verbosely explain how to do this on the CLI command by command?
"In principle, you can docker build locally to get the plugin"
For people like me that have never built anything for docker...

@NonaSuomy
Copy link

NonaSuomy commented Feb 27, 2024

git clone https://github.com/devplayer0/docker-net-dhcp.git
cd docker-net-dhcp
git fetch origin pull/43/head:celerway
git checkout celerway
Switched to branch 'celerway'

git branch -a
* celerway
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/dependabot/go_modules/github.com/containerd/containerd-1.5.18
  remotes/origin/dependabot/go_modules/github.com/docker/docker-20.10.24incompatible
  remotes/origin/dependabot/go_modules/golang.org/x/net-0.7.0
  remotes/origin/dependabot/go_modules/golang.org/x/sys-0.1.0
  remotes/origin/master

make create

docker plugin ls
ID             NAME                                        DESCRIPTION                          ENABLED
############   ghcr.io/devplayer0/docker-net-dhcp:golang   Docker host bridge DHCP networking   false

sudo docker plugin enable ghcr.io/devplayer0/docker-net-dhcp:golang
docker plugin ls
ID             NAME                                        DESCRIPTION                          ENABLED
############   ghcr.io/devplayer0/docker-net-dhcp:golang   Docker host bridge DHCP networking   true

sudo docker network ls
NETWORK ID     NAME               DRIVER                                                   SCOPE
############   bridge             bridge                                                   local
############   config_default     bridge                                                   local
############   dbrv100            ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64   local
############   dbrv200            ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64   local
############   dbrv300            ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64   local
############   dbrv350            ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64   local
############   dbrv400            ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64   local

Shows all your old docker-net-dhcp additions, we need to remove them :(

I first tried:
sudo docker network rm dbrv100
Error response from daemon: error while removing network: failed deleting Network: plugin "ghcr.io/devplayer0/docker-net-dhcp:release-linux-amd64" not found

So then I nuked them with
sudo docker network prune
WARNING! This will remove all custom networks not used by at least one container.
Are you sure you want to continue? [y/N] y
sudo docker network ls
NETWORK ID     NAME      DRIVER    SCOPE
############   bridge    bridge    local
############   host      host      local
############   none      null      local

Then added them all back with the new compiled driver

sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv100 dbrv100
sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv200 dbrv200
sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv300 dbrv300
sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv350 dbrv350
sudo docker network create -d ghcr.io/devplayer0/docker-net-dhcp:golang --ipam-driver null -o bridge=brv400 dbrv400

sudo docker network ls
NETWORK ID     NAME      DRIVER                                      SCOPE
############   bridge    bridge                                      local
############   dbrv100   ghcr.io/devplayer0/docker-net-dhcp:golang   local
############   dbrv200   ghcr.io/devplayer0/docker-net-dhcp:golang   local
############   dbrv300   ghcr.io/devplayer0/docker-net-dhcp:golang   local
############   dbrv350   ghcr.io/devplayer0/docker-net-dhcp:golang   local
############   dbrv400   ghcr.io/devplayer0/docker-net-dhcp:golang   local
############   host      host                                        local
############   none      null                                        local

Now they are all back in action but all the containers still point to the old bridges 😭 

docker container inspect genericcontainer001

you will see all the old ID's for the old networks...
I tried doing 
sudo docker network disconnect dbrv100 genericcontainer001
sudo docker network connect dbrv100 genericcontainer001

This changed the network so I thought win!

Yet NetworkMode was still stuck with the old network and would fail on startup.
sudo docker container start genericcontainer001
Error response from daemon: could not find a network matching network mode ####...: network ####... not found
Error: failed to start containers: genericcontainer001
So then I ran compose

docker-compose.yml
version: '3.9'

services:
  genericcontainer001:
    container_name: genericcontainer001
    hostname: genericcontainer001
    mac_address: de:ad:be:ef:00:01
    networks:
      - dhcp
networks:
  dhcp:
    #mac_address: de:ad:be:ef:00:01 #(for docker engine verison 25)
    name: dbrv100
    external: true

docker compose up -d

It came back up with the right network without an issue yay!

Thanks to encbladexp in docker discord for helping me figure out the compile technique!
Thanks to manjax in docker discord for telling me to use compose to bring up the system to fix the straggling networkmode issue.

@fallenleavesgocrunch
Copy link

Could someone publish a tagged version of this so I can install the plugin without needing to compile. My server environment does not contain the compiler tool chain.

@guzmelek
Copy link

guzmelek commented Jan 12, 2025

It came back up with the right network without an issue yay!

Thanks to encbladexp in docker discord for helping me figure out the compile technique! Thanks to manjax in docker discord for telling me to use compose to bring up the system to fix the straggling networkmode issue.

I followed above guide and plugin enabled succesfully. Unfortunately, I am getting below error (both with docker compose and just by running dummy container):

docker run -it --rm --net macvlan-1 busybox sh docker: Error response from daemon: failed to create endpoint nice_northcutt on network macvlan-1: NetworkDriver.CreateEndpoint: failed to get initial IP address via DHCP: context deadline exceeded.

my environment:

NETWORK ID     NAME                          DRIVER                                      SCOPE
f9e2b1ea6768   bridge                        bridge                                      local
b25bfcdafc6c   host                          host                                        local
e5da1aded7cf   ix-plex_default               bridge                                      local
22d2e27d680d   ix-unifi-controller_default   bridge                                      local
226a53696048   macvlan-1                     ghcr.io/devplayer0/docker-net-dhcp:golang   local
9dca236a9112   none                          null                                        local

docker plugin ls
ID             NAME                                        DESCRIPTION                          ENABLED
ece0496e57cd   ghcr.io/devplayer0/docker-net-dhcp:golang   Docker host bridge DHCP networking   true

Can someone please help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants