{"id":"f99c141668dbcf9e","repo":"docker/cli","slug":"undefined-network-q","errorCode":null,"errorMessage":"undefined network %q","messagePattern":"undefined network %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/service.go","lineNumber":213,"sourceCode":"}\n\nfunc convertServiceNetworks(\n\tnetworks map[string]*composetypes.ServiceNetworkConfig,\n\tnetworkConfigs networkMap,\n\tnamespace Namespace,\n\tname string,\n) ([]swarm.NetworkAttachmentConfig, error) {\n\tif len(networks) == 0 {\n\t\tnetworks = map[string]*composetypes.ServiceNetworkConfig{\n\t\t\tdefaultNetwork: {},\n\t\t}\n\t}\n\n\tnets := make([]swarm.NetworkAttachmentConfig, 0, len(networks))\n\tfor networkName, nw := range networks {\n\t\tnetworkConfig, ok := networkConfigs[networkName]\n\t\tif !ok && networkName != defaultNetwork {\n\t\t\treturn nil, fmt.Errorf(\"undefined network %q\", networkName)\n\t\t}\n\t\tvar aliases []string\n\t\tvar driverOpts map[string]string\n\t\tif nw != nil {\n\t\t\taliases = nw.Aliases\n\t\t\tdriverOpts = nw.DriverOpts\n\t\t}\n\t\ttarget := namespace.Scope(networkName)\n\t\tif networkConfig.Name != \"\" {\n\t\t\ttarget = networkConfig.Name\n\t\t}\n\t\tnetAttachConfig := swarm.NetworkAttachmentConfig{\n\t\t\tTarget:     target,\n\t\t\tAliases:    aliases,\n\t\t\tDriverOpts: driverOpts,\n\t\t}\n\t\t// Only add default aliases to user defined networks. Other networks do\n\t\t// not support aliases.","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/compose/convert/service.go#L195-L231","documentation":"Error \"undefined network %q\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/compose/convert/service.go:213 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}