{"record":{"id":"191bcff75539e1b3","repo":"GoogleContainerTools/skaffold","slug":"creating-skaffold-network-s-w-191bcf","errorCode":null,"errorMessage":"creating skaffold network %s: %w","messagePattern":"creating skaffold network (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/docker/deploy.go","lineNumber":140,"sourceCode":"\td.logger.RegisterArtifacts(builds)\n}\n\n// TrackContainerFromBuild adds an artifact and its newly-associated container\n// to the container tracker.\nfunc (d *Deployer) TrackContainerFromBuild(artifact graph.Artifact, container tracker.Container) {\n\td.tracker.Add(artifact, container)\n}\n\n// Deploy deploys built artifacts by creating containers in the local docker daemon\n// from each artifact's image.\nfunc (d *Deployer) Deploy(ctx context.Context, out io.Writer, builds []graph.Artifact, _ manifest.ManifestListByConfig) error {\n\tvar err error\n\td.once.Do(func() {\n\t\terr = d.client.NetworkCreate(ctx, d.network, d.labeller.Labels())\n\t\td.networkDeployed = true\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating skaffold network %s: %w\", d.network, err)\n\t}\n\n\t// TODO(nkubala)[07/20/21]: parallelize with sync.Errgroup\n\tfor _, b := range builds {\n\t\tif err := d.deploy(ctx, out, b); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\td.TrackBuildArtifacts(builds, nil)\n\n\treturn nil\n}\n\nfunc (d *Deployer) ConfigName() string {\n\treturn d.configName\n}\n\n// deploy creates a container in the local docker daemon from a build artifact's image.","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/docker/deploy.go#L122-L158","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify Docker daemon is running (`docker info`) and the user has permission to create networks","Remove conflicting/leftover networks: `docker network ls`, `docker network rm <skaffold-network>`","If address pools are exhausted, prune unused networks (`docker network prune`) or configure additional default-address-pools in daemon.json","Restart the deploy; note the network-creation failure is cached via sync.Once, so a fresh skaffold run is required after fixing the daemon"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if err := exec.Command(\"docker\", \"info\").Run(); err != nil {\n    return fmt.Errorf(\"docker daemon unavailable: %w\", err)\n}\n// check for conflicting network name\nif _, err := exec.Command(\"docker\", \"network\", \"inspect\", networkName).Output(); err == nil {\n    exec.Command(\"docker\", \"network\", \"rm\", networkName).Run()\n}\n","typeGuard":null,"tryCatchPattern":"if err := skaffoldDeploy(); err != nil {\n    if strings.Contains(err.Error(), \"creating skaffold network\") {\n        // inspect docker daemon health and prune networks, then retry once\n        exec.Command(\"docker\", \"network\", \"prune\", \"-f\").Run()\n    }\n}\n","preventionTips":["Ensure the Docker daemon is running before deploys","Periodically prune unused Docker networks to avoid address-pool exhaustion","Clean up leftover skaffold networks after crashed runs","Configure extra default-address-pools in daemon.json for heavy network use"],"tags":["docker","network","deploy"],"backgroundTag":"docker-network-create-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}