{"record":{"id":"01db27f4570582ee","repo":"AlistGo/alist","slug":"too-many-active-devices","errorCode":null,"errorMessage":"too many active devices","messagePattern":"too many active devices","errorType":"exception","errorClass":"TooManyDevices","httpStatus":null,"severity":"error","filePath":"internal/errs/device.go","lineNumber":6,"sourceCode":"package errs\n\nimport \"errors\"\n\nvar (\n\tTooManyDevices  = errors.New(\"too many active devices\")\n\tSessionInactive = errors.New(\"session inactive\")\n)\n","sourceCodeStart":1,"sourceCodeEnd":9,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/internal/errs/device.go#L1-L9","documentation":"errs.TooManyDevices signals that the remote account has more active sessions/devices than the provider permits, and a new one was refused or an existing one was invalidated. It is a package-level sentinel in internal/errs/device.go paired with SessionInactive for session-state problems.","triggerScenarios":"Drivers or services that enforce device/session caps (e.g. cloud-drive clients that map one mounted storage to one 'device') returning this error when mounting additional instances beyond the account limit, or when the provider API reports a device-count violation during login/refresh.","commonSituations":"The same cloud account mounted in several environments (dev + prod + laptop) exceeding the provider's device quota; stale devices never logged out accumulating over time; team members sharing one account for testing; provider lowered the device limit.","solutions":["Log out unused devices/sessions from the provider's account security page, then retry","Consolidate mounts: use one shared storage instance instead of mounting per-environment","Check the provider's documented device limit and count active sessions against it","If the limit is per-plan, upgrade the plan or use service/daemon accounts for automation"],"exampleFix":"// before\nfor _, cfg := range envConfigs {\n    go mount(cfg) // each mount = new device, exceeds cap\n}\n\n// after: single shared mount\nmount(primaryCfg)\n// other environments proxy through it","handlingStrategy":"fallback","validationCode":"if activeDevices >= providerDeviceLimit { return errs.TooManyDevices }","typeGuard":"func isTooManyDevices(err error) bool { return errors.Is(err, errs.TooManyDevices) }","tryCatchPattern":"err := mountStorage(cfg)\nif errors.Is(err, errs.TooManyDevices) {\n    // fall back to reusing an existing shared mount instead of a new device\n    return reuseExistingMount(cfg)\n}","preventionTips":["Track active sessions per account; log out unused devices during onboarding","Prefer one shared storage mount over many per-service mounts","Surface 'device limit reached' clearly so users know to prune sessions"],"tags":["sessions","device-limit","quota","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}