{"record":{"id":"fa8da309a28c3255","repo":"eyaltoledano/claude-task-master","slug":"vertex-ai-operation-failed-error-message","errorCode":null,"errorMessage":"Vertex AI ${operation} failed: ${error.message}","messagePattern":"Vertex AI (.+?) failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/ai-providers/google-vertex.js","lineNumber":200,"sourceCode":"\t\tif (error.response) {\n\t\t\tconst statusCode = error.response.status;\n\t\t\tconst errorMessage = error.response.data?.error?.message || error.message;\n\n\t\t\t// Categorize by status code\n\t\t\tif (statusCode === 401 || statusCode === 403) {\n\t\t\t\tthrow new VertexAuthError(`Authentication failed: ${errorMessage}`);\n\t\t\t} else if (statusCode === 400) {\n\t\t\t\tthrow new VertexConfigError(`Invalid request: ${errorMessage}`);\n\t\t\t} else {\n\t\t\t\tthrow new VertexApiError(\n\t\t\t\t\t`API error (${statusCode}): ${errorMessage}`,\n\t\t\t\t\tstatusCode\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Generic error handling\n\t\tthrow new Error(`Vertex AI ${operation} failed: ${error.message}`);\n\t}\n}\n","sourceCodeStart":182,"sourceCodeEnd":203,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/ai-providers/google-vertex.js#L182-L203","documentation":"Catch-all path in handleError: when the thrown value is not an HTTP response error (no error.response), it is rethrown as a plain Error reading 'Vertex AI <operation> failed: <message>'. This covers network failures, timeouts, DNS errors, and any non-HTTP exception during the Vertex call.","triggerScenarios":"getClient()/API call throws without an error.response property — e.g. fetch/axios network error, connection reset, timeout, request aborted, or a coding error inside the request path.","commonSituations":"No internet/VPN blocking googleapis.com, DNS resolution failure, request timeout due to slow model responses, proxy misconfiguration, or a bug throwing a non-HTTP error.","solutions":["Log the original error (the message is preserved) to determine network vs code cause.","Check connectivity to aiplatform.googleapis.com (curl/ping, proxy settings).","Increase the client timeout if long generations are being cut off.","Wrap calls in retry logic with backoff for transient network errors."],"exampleFix":"// before: undiagnosed 'Vertex AI generateText failed: socket hang up'\n// after: configure/verify network access\n// curl -I https://us-central1-aiplatform.googleapis.com\n// export HTTPS_PROXY=http://corporate-proxy:8080 # if behind proxy","handlingStrategy":"retry","validationCode":"async function canReachVertex(location = 'us-central1') {\n  try {\n    const res = await fetch(`https://${location}-aiplatform.googleapis.com/`, { signal: AbortSignal.timeout(5000) });\n    return true; // any HTTP response means DNS/TLS/network OK\n  } catch { return false; }\n}","typeGuard":"function isNetworkError(e) {\n  return e instanceof Error && !('response' in e) && /network|socket|timeout|ECONN|ENOTFOUND|aborted/i.test(e.message);\n}","tryCatchPattern":"try {\n  return await vertexCall();\n} catch (e) {\n  if (isNetworkError(e)) {\n    await sleep(backoff(attempt++));\n    return vertexCall(); // retry transient network failures\n  }\n  throw e;\n}","preventionTips":["Set explicit request timeouts sized for long generations","Verify proxy/VPN settings for googleapis.com access","Add connectivity checks before batch jobs","Retry transient network errors with backoff"],"tags":["network","google-vertex","generic-error","timeout"],"backgroundTag":"network-request-failed","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}