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

Fails to start rootless container with bypass4netns after reboot: failed to allocate for range 0: 10.4.1.3 has been allocated to default-XXXXXXX, duplicate allocation is not allowed #2933

Open
merrkry opened this issue Apr 12, 2024 · 1 comment
Labels
area/bypass4netns area/rootless Rootless mode bug Something isn't working

Comments

@merrkry
Copy link

merrkry commented Apr 12, 2024

Description

I have rootless container installed with bypass4netns.

When I reboot the machine, the container fails to restart.

The only way to get it working is, nerdctl compose down && nerdctl compose up -d.

Steps to reproduce the issue

  1. paru -S nerdctl buildkit cni-plugins rootlesskit slirp4netns bypass4netns
  2. containerd-rootless-setuptool.sh install
  3. containerd-rootless-setuptool.sh install-bypass4netnsd
  4. nerctl compose up -d
  5. restart containerd user service / reboot

The container isn't started as expected.

runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: time="" level=fatal msg="failed to call cni.Setup: plugin type=\"bridge\" failed (add): failed to allocate for range 0: 10.4.1.3 has been allocated to default-XXXXXXX, duplicate allocation is not allowed"
Failed to write to log, write /home/merrkry/.local/share/nerdctl/1935db59/containers/default/XXXXXXX/oci-hook.createRuntime.log: file already closed

In the output of nerdctl ps -a, the status is Created. All restart policies make no difference here, simply fails or repeating the same error.

here's the compose file:

services:
    ddns-go:
        container_name: ddns-go
        restart: unless-stopped
        ports: [ "9876:9876" ]
        volumes:
            - ./data:/root
        image: jeessy/ddns-go
        # annotations: [ "nerdctl/bypass4netns=true" ]
        labels: [ "nerdctl/bypass4netns=true" ]

Describe the results you received and expected

The container should start normally, just like without bypass4netns.

What version of nerdctl are you using?

v1.7.5.
v2.0.0.beta.4.r6.33f6ae2b (edit compose file accordingly)

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

Client:
 Namespace:     default
 Debug Mode:    false

Server:
 Server Version: v1.7.15
 Storage Driver: overlayfs
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Log: fluentd journald json-file syslog
  Storage: btrfs native overlayfs
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
  rootless
 Kernel Version: 6.6.25-2-cachyos-lts-lto
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 
 Total Memory:
 Name: 
 ID: 
WARNING: No cpuset support
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
@merrkry merrkry added the kind/unconfirmed-bug-claim Unconfirmed bug claim label Apr 12, 2024
@AkihiroSuda AkihiroSuda changed the title Fails to start rootless container with bypass4netns after reboot Fails to start rootless container with bypass4netns after reboot: failed to allocate for range 0: 10.4.1.3 has been allocated to default-XXXXXXX, duplicate allocation is not allowed Apr 13, 2024
@AkihiroSuda AkihiroSuda added bug Something isn't working area/rootless Rootless mode area/bypass4netns and removed kind/unconfirmed-bug-claim Unconfirmed bug claim labels Apr 13, 2024
@AkihiroSuda
Copy link
Member

Workaround: rm -f ~/.local/share/cni/networks/NETWORK/IP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bypass4netns area/rootless Rootless mode bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants