{"id":"3ce5bee9fc4b810e","repo":"docker/cli","slug":"invalid-subnet-w","errorCode":null,"errorMessage":"invalid subnet: %w","messagePattern":"invalid subnet: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/network/create.go","lineNumber":259,"sourceCode":"\n\tidl := make([]network.IPAMConfig, 0, len(iData))\n\tfor _, v := range iData {\n\t\tidl = append(idl, *v)\n\t}\n\n\treturn &network.IPAM{\n\t\tDriver:  options.driver,\n\t\tConfig:  idl,\n\t\tOptions: options.driverOpts.GetAll(),\n\t}, nil\n}\n\nfunc subnetMatches(subnet, data string) (bool, error) {\n\tvar ip net.IP\n\n\t_, s, err := net.ParseCIDR(subnet)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"invalid subnet: %w\", err)\n\t}\n\n\tif strings.Contains(data, \"/\") {\n\t\tip, _, err = net.ParseCIDR(data)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t} else {\n\t\tip = net.ParseIP(data)\n\t}\n\n\treturn s.Contains(ip), nil\n}\n","sourceCodeStart":241,"sourceCodeEnd":273,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/network/create.go#L241-L273","documentation":"Error \"invalid subnet: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/network/create.go:259 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}