AlistGo/alist · error
%s: %v
Error message
%s: %v
What it means
Google Drive upload (Put) error: the resumable-upload session creation returned a structured API error with a non-zero code that is not 401. The message is '<Google error message>: <detailed error list>', exposing Drive's reason (e.g. storageQuotaExceeded, teamDrivesFolderNotFound, dailyLimitExceeded).
Source
Thrown at drivers/google_drive/driver.go:156
}).
SetError(&e).SetBody(data).SetContext(ctx)
if obj != nil {
res, err = req.Patch(url)
} else {
res, err = req.Post(url)
}
if err != nil {
return err
}
if e.Error.Code != 0 {
if e.Error.Code == 401 {
err = d.refreshToken()
if err != nil {
return err
}
return d.Put(ctx, dstDir, stream, up)
}
return fmt.Errorf("%s: %v", e.Error.Message, e.Error.Errors)
}
putUrl := res.Header().Get("location")
if stream.GetSize() < d.ChunkSize*1024*1024 {
_, err = d.request(putUrl, http.MethodPut, func(req *resty.Request) {
req.SetHeader("Content-Length", strconv.FormatInt(stream.GetSize(), 10)).
SetBody(driver.NewLimitedUploadStream(ctx, stream))
}, nil)
} else {
err = d.chunkUpload(ctx, stream, putUrl)
}
return err
}
var _ driver.Driver = (*GoogleDrive)(nil)
View on GitHub (pinned to 843d9dc814)
Solutions
- Match the reason string in the error: storageQuotaExceeded -> free space or switch account; userRateLimitExceeded -> throttle uploads and raise per-user quota in Cloud console
- Verify the destination folder exists and the credential has Editor rights on it (service accounts must be granted explicitly, or use impersonation)
- For service accounts, check the Google Cloud project's Drive API quota and domain-wide delegation setup
- If app is in testing mode, push it to production or add the user as a test user
Defensive patterns
Strategy: try-catch
Type guard
func isDriveQuotaError(err error) bool {
return err != nil && (strings.Contains(err.Error(), "storageQuotaExceeded") || strings.Contains(err.Error(), "userRateLimitExceeded"))
} Try / catch
err := d.Put(ctx, dstDir, stream, up)
if err != nil {
if strings.Contains(err.Error(), "storageQuotaExceeded") { /* stop, notify user */ return err }
if strings.Contains(err.Error(), "RateLimitExceeded") { /* backoff + retry upload */ }
} Prevention
- Check Drive quota before large uploads
- Throttle parallel uploads to stay under per-user rate limits
- Keep uploads resumable so retry does not restart from zero
When it happens
Trigger: Initiating an upload where the session-init POST responds with an error JSON: Google account out of storage (storageQuotaExceeded), upload rate limits (userRateLimitExceeded), target folder deleted or inaccessible, or service-account project not approved.
Common situations: Free Google account with 15GB full; too many uploads per second per project; shared-drive folder removed after driver init; OAuth app in testing mode hitting 100-user cap or unverified scopes.
Related errors
- %s: %v
- %s: %v
- 123 offline download cannot target the root directory, pick
- instant upload returns empty task id
- upload token is incomplete
AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15).
Data as JSON: /api/errors/2ca01366e24b7717.
Report an issue: GitHub.