Common Errors
401 Unauthorized
{"error": "Invalid or expired API key"}
Causes:
- Wrong API key
- Missing Bearer prefix
- Key revoked
Solution:
# Check header format
curl -H "Authorization: Bearer wayscloud_storage_abc123_YourSecretKey"
403 Forbidden
{"error": "API key does not have permission"}
Solution: Create new key with correct service permissions.
404 Not Found
{"error": "Bucket not found"}
Solution: Verify bucket/resource exists.
413 Request Too Large
Solution: Use multipart upload for files >5GB.
429 Rate Limit Exceeded
{"error": "Rate limit exceeded", "retry_after": 60}
Solution: Implement exponential backoff:
import time
def api_call_with_retry(func, max_retries=3):
for attempt in range(max_retries):
try:
return func()
except RateLimitError:
if attempt < max_retries - 1:
wait_time = 2 ** attempt
time.sleep(wait_time)
else:
raise
500 Internal Server Error
Solution: Retry after a few seconds. If persists, contact support.
502 Bad Gateway
Solution: Temporary issue, retry after 5-10 seconds.