{"id":"d63ac274fa55cde3","repo":"docker/cli","slug":"invalid-empty-volume-spec","errorCode":null,"errorMessage":"invalid empty volume spec","messagePattern":"invalid empty volume spec","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/volumespec/volumespec.go","lineNumber":25,"sourceCode":"\t\"errors\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github.com/moby/moby/api/types/mount\"\n)\n\nconst endOfSpec = rune(0)\n\n// Parse parses a volume spec without any knowledge of the target platform\nfunc Parse(spec string) (VolumeConfig, error) {\n\tvolume := VolumeConfig{}\n\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:","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/internal/volumespec/volumespec.go#L7-L43","documentation":"Error \"invalid empty volume spec\" thrown in docker/cli.","triggerScenarios":"Thrown at internal/volumespec/volumespec.go:25 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}