{"record":{"id":"e9d50193f9e902db","repo":"argoproj/argo-workflows","slug":"invalid-mode","errorCode":null,"errorMessage":"invalid mode","messagePattern":"invalid mode","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/auth/mode.go","lineNumber":28,"sourceCode":"type Modes map[Mode]bool\n\ntype Mode string\n\nconst (\n\tClient Mode = \"client\"\n\tServer Mode = \"server\"\n\tSSO    Mode = \"sso\"\n)\n\nfunc (m Modes) Add(value string) error {\n\tswitch value {\n\tcase \"client\", \"server\", \"sso\":\n\t\tm[Mode(value)] = true\n\tcase \"hybrid\":\n\t\tm[Client] = true\n\t\tm[Server] = true\n\tdefault:\n\t\treturn errors.New(\"invalid mode\")\n\t}\n\treturn nil\n}\n\nfunc (m Modes) GetMode(authorisation string) (Mode, bool) {\n\tif m[SSO] && strings.HasPrefix(authorisation, sso.Prefix) {\n\t\treturn SSO, true\n\t}\n\tif m[Client] && (strings.HasPrefix(authorisation, \"Bearer \") || strings.HasPrefix(authorisation, \"Basic \")) {\n\t\treturn Client, true\n\t}\n\tif m[Server] {\n\t\treturn Server, true\n\t}\n\treturn \"\", false\n}\n","sourceCodeStart":10,"sourceCodeEnd":45,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/server/auth/mode.go#L10-L45","documentation":"Modes.Add rejects a --auth-mode value that is not one of client, server, sso, or hybrid. It is a validation guard on the argo-server startup configuration; the offending string is whatever was passed to --auth-mode.","triggerScenarios":"Thrown at server/auth/mode.go:28 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set --auth-mode to one of client, server, sso, or hybrid","For hybrid SSO+client setups use --auth-mode sso --auth-mode client"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}