{"id":"6e54ccf5021d9f9c","repo":"docker/cli","slug":"failed-to-create-network-s-w","errorCode":null,"errorMessage":"failed to create network %s: %w","messagePattern":"failed to create network (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/stack/deploy_composefile.go","lineNumber":196,"sourceCode":"\t}\n\n\texistingNetworkMap := make(map[string]network.Summary)\n\tfor _, nw := range existingNetworks.Items {\n\t\texistingNetworkMap[nw.Name] = nw\n\t}\n\n\tfor name, createOpts := range networks {\n\t\tif _, exists := existingNetworkMap[name]; exists {\n\t\t\tcontinue\n\t\t}\n\n\t\tif createOpts.Driver == \"\" {\n\t\t\tcreateOpts.Driver = defaultNetworkDriver\n\t\t}\n\n\t\t_, _ = fmt.Fprintln(dockerCLI.Out(), \"Creating network\", name)\n\t\tif _, err := apiClient.NetworkCreate(ctx, name, createOpts); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create network %s: %w\", name, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc deployServices(ctx context.Context, dockerCLI command.Cli, services map[string]swarm.ServiceSpec, namespace convert.Namespace, sendAuth bool, resolveImage string) ([]string, error) {\n\tapiClient := dockerCLI.Client()\n\tout := dockerCLI.Out()\n\n\texistingServices, err := getStackServices(ctx, apiClient, namespace.Name())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\texistingServiceMap := make(map[string]swarm.Service)\n\tfor _, svc := range existingServices.Items {\n\t\texistingServiceMap[svc.Spec.Name] = svc\n\t}","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/stack/deploy_composefile.go#L178-L214","documentation":"Error \"failed to create network %s: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/stack/deploy_composefile.go:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}