{"id":"ed9d167145d7f7a6","repo":"docker/cli","slug":"no-matching-subnet-for-gateway-s","errorCode":null,"errorMessage":"no matching subnet for gateway %s","messagePattern":"no matching subnet for gateway (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/network/create.go","lineNumber":212,"sourceCode":"\tfor _, g := range options.gateways {\n\t\tmatch := false\n\t\tfor _, s := range options.subnets {\n\t\t\tok, err := subnetMatches(s, g.String())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif iData[s].Gateway.IsValid() {\n\t\t\t\treturn nil, fmt.Errorf(\"cannot configure multiple gateways (%s, %s) for the same subnet (%s)\", g, iData[s].Gateway, s)\n\t\t\t}\n\t\t\td := iData[s]\n\t\t\td.Gateway = toNetipAddr(g)\n\t\t\tmatch = true\n\t\t}\n\t\tif !match {\n\t\t\treturn nil, fmt.Errorf(\"no matching subnet for gateway %s\", g)\n\t\t}\n\t}\n\n\t// Validate and add aux-addresses\n\tfor name, aa := range options.auxAddresses.GetAll() {\n\t\tif aa == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tauxAddr, err := netip.ParseAddr(aa)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmatch := false\n\t\tfor _, s := range options.subnets {\n\t\t\tok, err := subnetMatches(s, auxAddr.String())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/network/create.go#L194-L230","documentation":"Error \"no matching subnet for gateway %s\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/network/create.go:212 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}