{"id":"f061a3972f2d919a","repo":"docker/cli","slug":"invalid-spec-s-w","errorCode":null,"errorMessage":"invalid spec: %s: %w","messagePattern":"invalid spec: (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/volumespec/volumespec.go","lineNumber":40,"sourceCode":"\n\tswitch len(spec) {\n\tcase 0:\n\t\treturn volume, errors.New(\"invalid empty volume spec\")\n\tcase 1, 2:\n\t\tvolume.Target = spec\n\t\tvolume.Type = string(mount.TypeVolume)\n\t\treturn volume, nil\n\t}\n\n\tbuffer := make([]rune, 0, len(spec))\n\tfor _, char := range spec + string(endOfSpec) {\n\t\tswitch {\n\t\tcase isWindowsDrive(buffer, char):\n\t\t\tbuffer = append(buffer, char)\n\t\tcase char == ':' || char == endOfSpec:\n\t\t\tif err := populateFieldFromBuffer(char, buffer, &volume); err != nil {\n\t\t\t\tpopulateType(&volume)\n\t\t\t\treturn volume, fmt.Errorf(\"invalid spec: %s: %w\", spec, err)\n\t\t\t}\n\t\t\tbuffer = buffer[:0] // reset, but reuse capacity\n\t\tdefault:\n\t\t\tbuffer = append(buffer, char)\n\t\t}\n\t}\n\n\tpopulateType(&volume)\n\treturn volume, nil\n}\n\nfunc isWindowsDrive(buffer []rune, char rune) bool {\n\treturn char == ':' && len(buffer) == 1 && unicode.IsLetter(buffer[0])\n}\n\nfunc populateFieldFromBuffer(char rune, buffer []rune, volume *VolumeConfig) error {\n\tstrBuffer := string(buffer)\n\tswitch {","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/internal/volumespec/volumespec.go#L22-L58","documentation":"Error \"invalid spec: %s: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at internal/volumespec/volumespec.go:40 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}