{"record":{"id":"e23f6366fef8af2e","repo":"vercel/ai","slug":"google-files-upload-error","errorCode":"GOOGLE_FILES_UPLOAD_ERROR","errorMessage":"Failed to initiate resumable upload: ${initResponse.status} ${errorBody}","messagePattern":"Failed to initiate resumable upload: (.+?) (.+?)","errorType":"error_code","errorClass":"AISDKError","httpStatus":null,"severity":"error","filePath":"packages/google/src/google-files.ts","lineNumber":100,"sourceCode":"      method: 'POST',\n      headers: {\n        ...resolvedHeaders,\n        'X-Goog-Upload-Protocol': 'resumable',\n        'X-Goog-Upload-Command': 'start',\n        'X-Goog-Upload-Header-Content-Length': String(fileBytes.length),\n        'X-Goog-Upload-Header-Content-Type': mediaType,\n        'Content-Type': 'application/json',\n      },\n      body: JSON.stringify({\n        file: {\n          ...(displayName != null ? { display_name: displayName } : {}),\n        },\n      }),\n    });\n\n    if (!initResponse.ok) {\n      const errorBody = await initResponse.text();\n      throw new AISDKError({\n        name: 'GOOGLE_FILES_UPLOAD_ERROR',\n        message: `Failed to initiate resumable upload: ${initResponse.status} ${errorBody}`,\n      });\n    }\n\n    const uploadUrl = initResponse.headers.get('x-goog-upload-url');\n    if (!uploadUrl) {\n      throw new AISDKError({\n        name: 'GOOGLE_FILES_UPLOAD_ERROR',\n        message: 'No upload URL returned from initiation request',\n      });\n    }\n\n    const uploadResponse = await fetchFn(uploadUrl, {\n      method: 'POST',\n      headers: {\n        'X-Goog-Upload-Offset': '0',\n        'X-Goog-Upload-Command': 'upload, finalize',","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/google/src/google-files.ts#L82-L118","documentation":"Error \"Failed to initiate resumable upload: ${initResponse.status} ${errorBody}\" thrown in vercel/ai.","triggerScenarios":"Thrown at packages/google/src/google-files.ts:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}