{"record":{"id":"e76684cc6e708ff3","repo":"weaviate/weaviate","slug":"connection-to-s-failed-with-status-d-e76684","errorCode":null,"errorMessage":"connection to: %s failed with status: %d","messagePattern":"connection to: (.+?) failed with status: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/text2vec-digitalocean/clients/digitalocean.go","lineNumber":230,"sourceCode":"func buildURL(ctx context.Context, baseURL string) (string, error) {\n\tbaseURL, err := modulecomponents.ValidatedBaseURLFromHeader(ctx, \"X-Digitalocean-Baseurl\", baseURL)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn url.JoinPath(baseURL, \"/v1/embeddings\")\n}\n\nfunc formatError(statusCode int, requestID string, body *digitalOceanError) error {\n\tendpoint := \"DigitalOcean Serverless Inference API\"\n\tmsg := fmt.Sprintf(\"connection to: %s failed with status: %d\", endpoint, statusCode)\n\tif requestID != \"\" {\n\t\tmsg = fmt.Sprintf(\"%s request-id: %s\", msg, requestID)\n\t}\n\tif body != nil && body.Message != \"\" {\n\t\tmsg = fmt.Sprintf(\"%s error: %s\", msg, body.Message)\n\t}\n\tmonitoring.GetMetrics().ModuleExternalError.WithLabelValues(\"text2vec\", endpoint, msg, strconv.Itoa(statusCode)).Inc()\n\treturn errors.New(msg)\n}\n\n// rateLimitsFromHeader parses DigitalOcean's ratelimit-* headers, which carry\n// per-request totals. Tokens-per-minute is not exposed, so we set a high dummy\n// limit to keep the batcher from throttling on it.\nfunc rateLimitsFromHeader(header http.Header) *modulecomponents.RateLimits {\n\tlimit := getHeaderInt(header, \"ratelimit-limit\")\n\tremaining := getHeaderInt(header, \"ratelimit-remaining\")\n\n\tvar resetTime time.Time\n\tif resetEpoch, err := strconv.ParseInt(header.Get(\"ratelimit-reset\"), 10, 64); err == nil && resetEpoch > 0 {\n\t\tresetTime = time.Unix(resetEpoch, 0)\n\t} else {\n\t\tresetTime = time.Now().Add(time.Minute)\n\t}\n\n\tif limit <= 0 {\n\t\tlimit = dummyLimit","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/modules/text2vec-digitalocean/clients/digitalocean.go#L212-L248","documentation":"formatError builds a descriptive error for any non-200 response from the DigitalOcean Serverless Inference API, including the status code, request-id header and API error message, and increments the module external error metric. It surfaces every HTTP-level failure the vectorizer encounters.","triggerScenarios":"Any /v1/embeddings call that returns a non-OK status: 401 bad API key, 404 unknown model, 429 rate limit exceeded, 5xx server error.","commonSituations":"Expired or missing DIGITALOCEAN_API_KEY; typo in model name; hitting inference rate limits during batch imports; DigitalOcean region outages.","solutions":["Read the status code and message embedded in the error to identify the cause","Fix the API key (401) or model name (404) in the module configuration","Back off and retry on 429/5xx — the batcher respects rate limit headers","Check the request-id against DigitalOcean support if the error persists"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if os.Getenv(\"DIGITALOCEAN_API_KEY\") == \"\" { return errors.New(\"DIGITALOCEAN_API_KEY not set\") }","typeGuard":null,"tryCatchPattern":"_, err := vectorizer.Vectorize(ctx, texts)\nvar he *HTTPError\nif err != nil {\n  if strings.Contains(err.Error(), \"status: 429\") || strings.Contains(err.Error(), \"status: 5\") {\n    // exponential backoff and retry\n  }\n}","preventionTips":["Rotate and verify the API key before deploys","Respect the ratelimit-* headers the client parses","Log request-id from the error message when contacting support","Check the error status code: 4xx config, 5xx transient"],"tags":["digitalocean","http","api-error","network"],"backgroundTag":"http-error-response","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}