{"record":{"id":"7fae0d8a7900defc","repo":"AlistGo/alist","slug":"password-is-required","errorCode":null,"errorMessage":"password is required","messagePattern":"password is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/123_open/other.go","lineNumber":314,"sourceCode":"\t\tParentFileID:   req.ParentFileID,\n\t\tPage:           req.Page,\n\t\tLimit:          req.Limit,\n\t\tOrderBy:        req.OrderBy,\n\t\tOrderDirection: req.OrderDirection,\n\t\tTrashed:        req.Trashed,\n\t\tSearchData:     req.SearchData,\n\t})\n}\n\nfunc otherSafeboxID(d *Open123, ctx context.Context, args model.OtherArgs) (interface{}, error) {\n\tvar req struct {\n\t\tPassword string `json:\"password\"`\n\t}\n\tif err := decodeOtherArgs(args.Data, &req); err != nil {\n\t\treturn nil, err\n\t}\n\tif req.Password == \"\" {\n\t\treturn nil, errors.New(\"password is required\")\n\t}\n\tfileID, err := d.client.File.SafeboxID(ctx, req.Password)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn struct {\n\t\tFileID int64 `json:\"file_id\"`\n\t}{FileID: fileID}, nil\n}\n\n// ---------------------------------------------------------------- share\n\n// shareCreateArgs carries the settings shared by free and paid share links.\ntype shareCreateArgs struct {\n\tShareName          string  `json:\"share_name\"`\n\tFileIDs            []int64 `json:\"file_ids\"`\n\tShareExpire        int     `json:\"share_expire\"`\n\tSharePwd           string  `json:\"share_pwd\"`","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/123_open/other.go#L296-L332","documentation":"Returned by the Terabox link builder (drivers/terabox/util.go:217) when /api/download returns an empty dlink array for the requested fid. The response's errno field is embedded in the message; common non-zero errnos mean the file cannot get a direct link (permission, deleted, requires VIP, or rate-limited).","triggerScenarios":"Requesting a download link for a file deleted since listing; a shared/private file the account lacks download rights for; files requiring VIP/subscription for direct links; sign/timestamp parameters rejected so the dlink list comes back empty; heavy link-fetch rate limiting.","commonSituations":"Stale directory cache listing files already removed; free-tier accounts hitting VIP-gated downloads; rapidly fetching links for many files triggering dlink throttling; clock skew invalidating timestamp-based sign().","solutions":["Re-list the parent directory to confirm the file still exists, then retry the link request.","Check account entitlements — VIP-gated content cannot be linked from a free account.","Slow down link fetching and add caching to avoid dlink rate limits.","Verify server clock accuracy (sign uses time.Now().Unix(); skew can invalidate the signature)."],"exampleFix":"// before\nif len(resp.Dlink) == 0 {\n\treturn nil, fmt.Errorf(\"fid %s no dlink found, errno: %d\", file.GetID(), resp.Errno)\n}\n\n// after: map known errnos to actionable messages\nif len(resp.Dlink) == 0 {\n\tswitch resp.Errno {\n\tcase -9:\n\t\treturn nil, fmt.Errorf(\"file %s not found/deleted\", file.GetID())\n\tcase 112:\n\t\treturn nil, fmt.Errorf(\"file %s requires VIP to download\", file.GetID())\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"fid %s no dlink found, errno: %d\", file.GetID(), resp.Errno)\n\t}\n}","handlingStrategy":"validation","validationCode":"// confirm file still exists before requesting dlink\nvar info map[string]interface{}\nif _, err := d.get(\"/api/filemetas\", map[string]string{\"fsids\": \"[\" + file.GetID() + \"]\"}, &info); err != nil {\n\t// stale entry; re-list parent\n}","typeGuard":"func isNoDlinkErr(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"no dlink found\")\n}","tryCatchPattern":"link, err := d.link(ctx, file, args)\nif isNoDlinkErr(err) {\n\t// re-list parent; drop stale objects; map errno to user reason (VIP/deleted/perm)\n}","preventionTips":["Cache dlinks with a TTL instead of re-requesting per download.","Re-validate listings before link requests for files cached longer than the TTL.","Keep server clocks NTP-synced (sign() is timestamp-based)."],"tags":["terabox","download-link","api-error","entitlement"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}