GoogleContainerTools/skaffold · error

creating skaffold network %s: %w

Error message

creating skaffold network %s: %w

What it means

The Docker deployer creates a dedicated Docker network for containers it manages and records the deployment with sync.Once. If `NetworkCreate` fails on the first call, the error is wrapped as `creating skaffold network %s` and every subsequent deploy reuses the cached error.

Source

Thrown at pkg/skaffold/deploy/docker/deploy.go:140

	d.logger.RegisterArtifacts(builds)
}

// TrackContainerFromBuild adds an artifact and its newly-associated container
// to the container tracker.
func (d *Deployer) TrackContainerFromBuild(artifact graph.Artifact, container tracker.Container) {
	d.tracker.Add(artifact, container)
}

// Deploy deploys built artifacts by creating containers in the local docker daemon
// from each artifact's image.
func (d *Deployer) Deploy(ctx context.Context, out io.Writer, builds []graph.Artifact, _ manifest.ManifestListByConfig) error {
	var err error
	d.once.Do(func() {
		err = d.client.NetworkCreate(ctx, d.network, d.labeller.Labels())
		d.networkDeployed = true
	})
	if err != nil {
		return fmt.Errorf("creating skaffold network %s: %w", d.network, err)
	}

	// TODO(nkubala)[07/20/21]: parallelize with sync.Errgroup
	for _, b := range builds {
		if err := d.deploy(ctx, out, b); err != nil {
			return err
		}
	}
	d.TrackBuildArtifacts(builds, nil)

	return nil
}

func (d *Deployer) ConfigName() string {
	return d.configName
}

// deploy creates a container in the local docker daemon from a build artifact's image.

View on GitHub (pinned to a1189de023)

Solutions

  1. Verify Docker daemon is running (`docker info`) and the user has permission to create networks
  2. Remove conflicting/leftover networks: `docker network ls`, `docker network rm <skaffold-network>`
  3. If address pools are exhausted, prune unused networks (`docker network prune`) or configure additional default-address-pools in daemon.json
  4. Restart the deploy; note the network-creation failure is cached via sync.Once, so a fresh skaffold run is required after fixing the daemon
Defensive patterns

Strategy: try-catch

Validate before calling

if err := exec.Command("docker", "info").Run(); err != nil {
    return fmt.Errorf("docker daemon unavailable: %w", err)
}
// check for conflicting network name
if _, err := exec.Command("docker", "network", "inspect", networkName).Output(); err == nil {
    exec.Command("docker", "network", "rm", networkName).Run()
}

Try / catch

if err := skaffoldDeploy(); err != nil {
    if strings.Contains(err.Error(), "creating skaffold network") {
        // inspect docker daemon health and prune networks, then retry once
        exec.Command("docker", "network", "prune", "-f").Run()
    }
}

Prevention

When it happens

Trigger: Docker daemon rejects network creation: network name conflicts with an existing network, Docker daemon is down, network pool exhaustion ("all predefined address pools have been fully subnetted"), or insufficient daemon permissions.

Common situations: Docker Desktop/daemon not running; leftover skaffold network from a crashed run with conflicting labels; many networks exhausting the default address pool; running without Docker permissions.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/191bcff75539e1b3. Report an issue: GitHub.