linshenkx/prompt-optimizer · error · Error
Google Drive folder creation did not return an id: ${name}
Error message
Google Drive folder creation did not return an id: ${name} What it means
Same guard as the root folder creation, but for intermediate folders created while building a nested path (findOrCreateFolderPath). The created folder JSON lacked an id, so the path chain cannot continue.
Source
Thrown at packages/ui/src/utils/remote-backup.ts:1195
private async createFolder(parentId: string, name: string): Promise<string> {
const response = await this.fetchGoogleDrive(
'https://www.googleapis.com/drive/v3/files?fields=id,name',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
name,
mimeType: GOOGLE_DRIVE_FOLDER_MIME_TYPE,
parents: [parentId],
}),
},
'Google Drive folder creation failed',
)
const created = await response.json()
const id = String(created.id || '')
if (!id) throw new Error(`Google Drive folder creation did not return an id: ${name}`)
return id
}
private async fetchGoogleDrive(
url: string | URL,
init: RequestInit,
context: string,
options?: { downloadRetry?: boolean },
): Promise<Response> {
const response = await this.fetchGoogleDriveOnce(url, init, context, false, options)
if (!isGoogleAuthStatus(response.status)) {
return assertOkResponse(response, context)
}
await response.body?.cancel().catch(() => undefined)
const retryResponse = await this.fetchGoogleDriveOnce(url, init, context, true, options)
return assertOkResponse(retryResponse, context)
}
View on GitHub (pinned to 3e677b1d9f)
Solutions
- Log response body and retry the folder creation
- Check Drive storage quota for the account
- Flatten the backup layout to avoid nested folder creation
Defensive patterns
Strategy: retry
Try / catch
catch (e) { if ((e as Error).message.startsWith('Google Drive folder creation did not return an id')) retry(); else throw e } Prevention
- Retry folder creation
- Flatten backup paths to reduce folder creation
When it happens
Trigger: Creating nested backup directories (e.g. per-date subfolders) when a Drive folder-create response omits id — partial responses, quota errors surfaced as JSON, or API changes.
Common situations: Drive quota exceeded returning an error body with 200; flaky network mid-response; mocking in tests.
Related errors
- Google Drive folder creation did not return an id
- ${context}: ${response.status} ${message || response.statusT
- ${context}: ${(error as Error).message || String(error)}
- Google Drive object not found: ${path}
- Google Drive resumable upload session did not return a locat
AI-assisted analysis of linshenkx/prompt-optimizer@3e677b1d9f (2026-08-27).
Data as JSON: /api/errors/56d619b5eb63cea9.
Report an issue: GitHub.