IceWhaleTech/CasaOS · error
%s: %v
Error message
%s: %v
What it means
A Google Drive API call returned an error body with a non-zero code other than 401; the driver formats the endpoint's message and Errors details as '%s: %v'. The 401 branch refreshes the access token and retries the request once; every other error code surfaces here.
Source
Thrown at drivers/google_drive/util.go:96
}
if resp != nil {
req.SetResult(resp)
}
var e Error
req.SetError(&e)
res, err := req.Execute(method, url)
if err != nil {
return nil, err
}
if e.Error.Code != 0 {
if e.Error.Code == 401 {
err = d.refreshToken()
if err != nil {
return nil, err
}
return d.request(url, method, callback, resp)
}
return nil, fmt.Errorf("%s: %v", e.Error.Message, e.Error.Errors)
}
return res.Body(), nil
}
func (d *GoogleDrive) getFiles(id string) ([]File, error) {
pageToken := "first"
res := make([]File, 0)
for pageToken != "" {
if pageToken == "first" {
pageToken = ""
}
var resp Files
orderBy := "folder,name,modifiedTime desc"
if d.OrderBy != "" {
orderBy = d.OrderBy + " " + d.OrderDirection
}
query := map[string]string{
"orderBy": orderBy,View on GitHub (pinned to 0d3b2f444e)
Solutions
- Read the Errors details — Google returns a 'reason' (notFound, insufficientFilePermissions, dailyLimitExceeded) that identifies the exact fix.
- For 404: re-list the parent folder; the ID may be stale.
- For quota: back off exponentially and reduce concurrent requests.
- For permission reasons: re-authorize with the required Drive scopes or request access to the shared drive.
Defensive patterns
Strategy: try-catch
Try / catch
_, err := d.request(url, method, cb, resp)
if err != nil {
msg := err.Error()
if strings.Contains(msg, "dailyLimitExceeded") || strings.Contains(msg, "userRateLimitExceeded") {
time.Sleep(backoff) // 429-class: retry later
return d.request(url, method, cb, resp)
}
return err // 404/403 permanent: refresh listing or scopes
} Prevention
- Re-list folders before acting on cached file IDs
- Include Errors[].Reason in wrapped errors for precise branching
- Batch Drive requests and cap concurrency to stay under quotas
When it happens
Trigger: Any Drive v3 request (list, get, create, patch, delete) that fails post-authentication: 404 file not found, 403 insufficientFilePermissions or dailyLimitExceeded, 400 invalid query syntax in the list 'q' parameter.
Common situations: Operating on a file deleted from Drive (including items in trash purged); shared-drive item where includeItemsFromAllDrives needs the right scope; malformed search queries; hitting the per-user 1000 req/100s quota.
Related errors
AI-assisted analysis of IceWhaleTech/CasaOS@0d3b2f444e (2026-08-15).
Data as JSON: /api/errors/7cda916acc191a2f.
Report an issue: GitHub.