AlistGo/alist · error

password is required

Error message

password is required

What it means

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).

Source

Thrown at drivers/123_open/other.go:314

		ParentFileID:   req.ParentFileID,
		Page:           req.Page,
		Limit:          req.Limit,
		OrderBy:        req.OrderBy,
		OrderDirection: req.OrderDirection,
		Trashed:        req.Trashed,
		SearchData:     req.SearchData,
	})
}

func otherSafeboxID(d *Open123, ctx context.Context, args model.OtherArgs) (interface{}, error) {
	var req struct {
		Password string `json:"password"`
	}
	if err := decodeOtherArgs(args.Data, &req); err != nil {
		return nil, err
	}
	if req.Password == "" {
		return nil, errors.New("password is required")
	}
	fileID, err := d.client.File.SafeboxID(ctx, req.Password)
	if err != nil {
		return nil, err
	}
	return struct {
		FileID int64 `json:"file_id"`
	}{FileID: fileID}, nil
}

// ---------------------------------------------------------------- share

// shareCreateArgs carries the settings shared by free and paid share links.
type shareCreateArgs struct {
	ShareName          string  `json:"share_name"`
	FileIDs            []int64 `json:"file_ids"`
	ShareExpire        int     `json:"share_expire"`
	SharePwd           string  `json:"share_pwd"`

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Re-list the parent directory to confirm the file still exists, then retry the link request.
  2. Check account entitlements — VIP-gated content cannot be linked from a free account.
  3. Slow down link fetching and add caching to avoid dlink rate limits.
  4. Verify server clock accuracy (sign uses time.Now().Unix(); skew can invalidate the signature).

Example fix

// before
if len(resp.Dlink) == 0 {
	return nil, fmt.Errorf("fid %s no dlink found, errno: %d", file.GetID(), resp.Errno)
}

// after: map known errnos to actionable messages
if len(resp.Dlink) == 0 {
	switch resp.Errno {
	case -9:
		return nil, fmt.Errorf("file %s not found/deleted", file.GetID())
	case 112:
		return nil, fmt.Errorf("file %s requires VIP to download", file.GetID())
	default:
		return nil, fmt.Errorf("fid %s no dlink found, errno: %d", file.GetID(), resp.Errno)
	}
}
Defensive patterns

Strategy: validation

Validate before calling

// confirm file still exists before requesting dlink
var info map[string]interface{}
if _, err := d.get("/api/filemetas", map[string]string{"fsids": "[" + file.GetID() + "]"}, &info); err != nil {
	// stale entry; re-list parent
}

Type guard

func isNoDlinkErr(err error) bool {
	return err != nil && strings.Contains(err.Error(), "no dlink found")
}

Try / catch

link, err := d.link(ctx, file, args)
if isNoDlinkErr(err) {
	// re-list parent; drop stale objects; map errno to user reason (VIP/deleted/perm)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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().

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/7fae0d8a7900defc. Report an issue: GitHub.