{"record":{"id":"351b3a4566692222","repo":"docker/compose","slug":"invalid-ipv4-address-w","errorCode":null,"errorMessage":"invalid IPv4 address: %w","messagePattern":"invalid IPv4 address: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/create.go","lineNumber":494,"sourceCode":"\nfunc createEndpointSettings(p *types.Project, service types.ServiceConfig, serviceIndex int, networkKey string, links []string, useNetworkAliases bool) (*network.EndpointSettings, error) {\n\tconst ifname = \"com.docker.network.endpoint.ifname\"\n\n\tconfig := service.Networks[networkKey]\n\tvar ipam *network.EndpointIPAMConfig\n\tvar (\n\t\tipv4Address netip.Addr\n\t\tipv6Address netip.Addr\n\t\tmacAddress  string\n\t\tdriverOpts  types.Options\n\t\tgwPriority  int\n\t)\n\tif config != nil {\n\t\tvar err error\n\t\tif config.Ipv4Address != \"\" {\n\t\t\tipv4Address, err = netip.ParseAddr(config.Ipv4Address)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid IPv4 address: %w\", err)\n\t\t\t}\n\t\t}\n\t\tif config.Ipv6Address != \"\" {\n\t\t\tipv6Address, err = netip.ParseAddr(config.Ipv6Address)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid IPv6 address: %w\", err)\n\t\t\t}\n\t\t}\n\t\tvar linkLocalIPs []netip.Addr\n\t\tfor _, link := range config.LinkLocalIPs {\n\t\t\tif link == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tllIP, err := netip.ParseAddr(link)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid link-local IP: %w\", err)\n\t\t\t}\n\t\t\tlinkLocalIPs = append(linkLocalIPs, llIP)","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/create.go#L476-L512","documentation":"Error \"invalid IPv4 address: %w\" thrown in docker/compose.","triggerScenarios":"A network attachment for a service specifies an ipv4_address that is not a valid IPv4 address.","commonSituations":"Malformed address (e.g. 300.1.2.3), an IPv6 address in the ipv4_address field, or an address outside the network's subnet.","solutions":["Fix the ipv4_address in the network configuration to a valid IPv4 address within the network's subnet.","Remove the ipv4_address entry to let Docker assign one automatically."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}