{"record":{"id":"da1e10366cdda80d","repo":"Netflix/chaosmonkey","slug":"alternateaccountid-called-with-forbidden-arg-s","errorCode":null,"errorMessage":"alternateAccountID called with forbidden arg: %s","messagePattern":"alternateAccountID called with forbidden arg: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spinnaker/spinnaker.go","lineNumber":224,"sourceCode":"\t}\n\n\t// Some backends may not have associated account ids\n\tif info.AccountID == \"\" {\n\t\treturn s.alternateAccountID(name)\n\t}\n\n\treturn info.AccountID, nil\n\n}\n\n// alternateAccountID returns an account ID for accounts that don't have their\n// own ids.\nfunc (s Spinnaker) alternateAccountID(name string) (string, error) {\n\n\t// Sanity check: this should never be called with \"prod\" or \"test\" as an\n\t// argument, since this would result in infinite recursion\n\tif name == \"prod\" || name == \"test\" {\n\t\treturn \"\", fmt.Errorf(\"alternateAccountID called with forbidden arg: %s\", name)\n\t}\n\n\t// Heuristic: if account name has \"test\" in the name, we return the \"test\"\n\t// account id, otherwise with  we use the \"prod\" account id\n\tif strings.Contains(name, \"test\") {\n\t\treturn s.AccountID(\"test\")\n\t}\n\n\treturn s.AccountID(\"prod\")\n}\n\n// Apps implements deploy.Deployment.Apps\nfunc (s Spinnaker) Apps(c chan<- *D.App, appNames []string) {\n\t// Close the channel we're done\n\tdefer close(c)\n\n\tfor _, appName := range appNames {\n\t\tapp, err := s.GetApp(appName)","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/spinnaker/spinnaker.go#L206-L242","documentation":"alternateAccountID() is a fallback for accounts without their own accountId: it maps names containing \"test\" to the \"test\" account and everything else to \"prod\". This guard rejects calls with \"prod\" or \"test\" themselves, because recursing on them would loop forever (AccountID(\"prod\") -> no accountId -> alternateAccountID(\"prod\") -> ...).","triggerScenarios":"AccountID(\"prod\") or AccountID(\"test\") succeeds at HTTP level but the response JSON has an empty accountId field, causing the fallback alternateAccountID(\"prod\")/alternateAccountID(\"test\") to be invoked, which immediately fails with this error.","commonSituations":"Spinnaker/clouddriver version change where the prod/test accounts stop returning an accountId field; a misbehaving backend returning 200 with empty bodies; querying an endpoint that proxies but does not enrich account data.","solutions":["Inspect the raw response of GET <endpoint>/accounts/prod — if accountId is genuinely missing, fix the Spinnaker/clouddriver deployment","Check the API URL construction (accountURL) and the Spinnaker version compatibility; upgrade chaosmonkey or clouddriver as needed","As a workaround, run against a Spinnaker instance that returns accountId for the prod/test accounts"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify prod/test accounts return an accountId before running:\nvar info struct{ AccountID string `json:\"accountId\"` }\n// GET <endpoint>/accounts/prod, unmarshal; if AccountID == \"\", the fallback will trip","typeGuard":null,"tryCatchPattern":"id, err := spin.AccountID(\"prod\")\nif err != nil {\n\tif strings.Contains(err.Error(), \"alternateAccountID called with forbidden arg\") {\n\t\tlog.Printf(\"Spinnaker not returning accountId for prod/test: %v\", err)\n\t}\n\treturn err\n}","preventionTips":["Check after Spinnaker upgrades that /accounts/prod and /accounts/test still include accountId","Use clouddriver versions compatible with this chaosmonkey release","Alert on this error since it indicates backend schema drift","Test account-ID resolution in a pre-flight check"],"tags":["spinnaker","api","infinite-recursion-guard"],"backgroundTag":"api-response-missing-field","analyzedSha":"eaa28fb761c0ebe8644d1333e5d164e9cc3071e9","analyzedAt":"2026-09-03T17:04:39.020Z","contentChangedAt":"2026-09-03T17:04:39.020Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}