{"record":{"id":"9b099cd10dbf5d0a","repo":"portainer/portainer","slug":"invalid-stack-file-content-9b099c","errorCode":null,"errorMessage":"Invalid stack file content","messagePattern":"Invalid stack file content","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"api/http/handler/stacks/create_kubernetes_stack.go","lineNumber":104,"sourceCode":"\ntype kubernetesManifestURLDeploymentPayload struct {\n\tStackName     string\n\tNamespace     string\n\tComposeFormat bool\n\tManifestURL   string\n}\n\nfunc createStackPayloadFromK8sUrlPayload(name, namespace, manifestUrl string, composeFormat bool) stackbuilders.StackPayload {\n\treturn stackbuilders.StackPayload{\n\t\tStackName:   name,\n\t\tNamespace:   namespace,\n\t\tManifestURL: manifestUrl,\n\t}\n}\n\nfunc (payload *kubernetesStringDeploymentPayload) Validate(r *http.Request) error {\n\tif len(payload.StackFileContent) == 0 {\n\t\treturn errors.New(\"Invalid stack file content\")\n\t}\n\n\treturn nil\n}\n\nfunc (payload *kubernetesGitDeploymentPayload) Validate(r *http.Request) error {\n\tif payload.SourceID == 0 {\n\t\tif len(payload.RepositoryURL) == 0 || !validate.IsURL(payload.RepositoryURL) {\n\t\t\treturn errors.New(\"Invalid repository URL. Must correspond to a valid URL format\")\n\t\t}\n\t\tif payload.RepositoryAuthentication && len(payload.RepositoryPassword) == 0 {\n\t\t\treturn errors.New(\"Invalid repository credentials. Password must be specified when authentication is enabled\")\n\t\t}\n\t}\n\n\tif len(payload.ManifestFile) == 0 {\n\t\treturn errors.New(\"Invalid manifest file in repository\")\n\t}","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/http/handler/stacks/create_kubernetes_stack.go#L86-L122","documentation":"Error \"Invalid stack file content\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/http/handler/stacks/create_kubernetes_stack.go:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}