Skip to content

network appears to not be immediately available after a call to network create #3092

@apostasie

Description

@apostasie

Description

There seems to be latency between network create return, and availability of the network - or between the container creation return and the operation attaching it to the network.

Specifically:

  • create a network
  • run a container
  • destroy the container
  • destroy the network

^ will fail occasionally.

Steps to reproduce the issue

Repeatedly create a network and immediately run a container attached to it, then destroy both in short succession.

Describe the results you received and expected

Errors out complaining about the network not existing.

This is being run as part of our test suites (see network remove tests).

	//    network_remove_linux_test.go:80: assertion failed: res.ExitCode is not exitCode: time="2024-06-16T00:53:11Z" 
	//   level=fatal msg="failed to create shim task: OCI runtime create failed: 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=\"2024-06-16T00:53:11Z\" level=fatal msg=\"no such network: \\\"nerdctl-testnetworkremovewithstoppedcontainer\\\"\"\n
	//  Failed to write to log, write /var/lib/nerdctl/1935db59/containers/nerdctl-test/ce14cea63aab995e164f80901fbcb4bf7eedfa0a2b2da66a1c3923a90f52c474/oci-hook.startContainer.log: file already closed: unknown"

What version of nerdctl are you using?

1.7.6

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

None

Host information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions