{"id":"1403cc817019b691","repo":"docker/cli","slug":"invalid-stack-name-q","errorCode":null,"errorMessage":"invalid stack name: %q","messagePattern":"invalid stack name: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/stack/common.go","lineNumber":20,"sourceCode":"\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/docker/cli/cli/compose/convert\"\n\t\"github.com/docker/cli/opts\"\n\t\"github.com/moby/moby/client\"\n)\n\n// validateStackName checks if the provided string is a valid stack name (namespace).\n// It currently only does a rudimentary check if the string is empty, or consists\n// of only whitespace and quoting characters.\nfunc validateStackName(namespace string) error {\n\tv := strings.TrimFunc(namespace, quotesOrWhitespace)\n\tif v == \"\" {\n\t\treturn fmt.Errorf(\"invalid stack name: %q\", namespace)\n\t}\n\treturn nil\n}\n\nfunc validateStackNames(namespaces []string) error {\n\tfor _, ns := range namespaces {\n\t\tif err := validateStackName(ns); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc quotesOrWhitespace(r rune) bool {\n\treturn unicode.IsSpace(r) || r == '\"' || r == '\\''\n}\n\nfunc getStackFilter(namespace string) client.Filters {","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/stack/common.go#L2-L38","documentation":"Error \"invalid stack name: %q\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/stack/common.go:20 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}