{"record":{"id":"9ecc43f450d28d05","repo":"larksuite/cli","slug":"device-code-expired-please-try-again","errorCode":null,"errorMessage":"device code expired, please try again","messagePattern":"device code expired, please try again","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/app_registration.go","lineNumber":23,"sourceCode":"\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/larksuite/cli/internal/core\"\n)\n\n// Terminal registration outcomes, exposed for typed classification by callers.\nvar (\n\tErrRegistrationDenied   = errors.New(\"app registration denied by user\")\n\tErrRegistrationExpired  = errors.New(\"device code expired, please try again\")\n\tErrRegistrationTimedOut = errors.New(\"app registration timed out, please try again\")\n)\n\n// Protocol defaults, mirroring the official SDK registration flow.\nconst (\n\tregistrationBootstrapBrand = core.BrandFeishu\n\tdefaultPollIntervalSeconds = 5\n\tdefaultExpireInSeconds     = 600\n\tbeginRequestTimeout        = 30 * time.Second\n\tmaxPollIntervalSeconds     = 60\n)\n\n// normalizedInterval clamps a non-positive poll interval to the protocol default.\nfunc normalizedInterval(v int) int {\n\tif v <= 0 {\n\t\treturn defaultPollIntervalSeconds\n\t}\n\treturn v","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/auth/app_registration.go#L5-L41","documentation":"Terminal outcome sentinel of device-code registration: the code the user must scan expired before approval completed, so the poll loop ends. Kept distinct from explicit denial and from the client-side wait timeout so callers can give precise recovery hints.","triggerScenarios":"Thrown at internal/auth/app_registration.go:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run `lark-cli config init --new` to get a fresh device code and complete the scan before it expires"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}