windmill-labs/windmill · error
Artifact store unavailable
Error message
Artifact store unavailable
What it means
getArtifactVersion reads a specific artifact version from the IndexedDB-backed artifact store (versions store). If getDB() returns no database handle (IndexedDB unavailable or the DB failed to open), the store cannot serve reads and this error is thrown. The underlying read errors are logged and rethrown as well.
Source
Thrown at frontend/src/lib/components/copilot/chat/artifacts/artifactsDB.ts:332
const items = await db.getAllFromIndex('versions', 'by-artifact', artifactId)
return items.sort((a, b) => b.version - a.version)
} catch (err) {
console.error('Could not read artifact versions', err)
return []
}
}
/** A stored snapshot, or undefined when there is none. Rejects when the read could not be made
* at all — unlike the other reads here, which degrade to undefined. A caller that conflates the
* two reports a transient failure as permanent absence, and whatever it discards in response
* (a reader's pinned version) is discarded for good. */
export async function getArtifactVersion(
artifactId: string,
version: number
): Promise<ArtifactVersion | undefined> {
const db = await getDB()
if (!db) throw new Error('Artifact store unavailable')
try {
return await db.get('versions', versionKey(artifactId, version))
} catch (err) {
console.error('Could not read artifact version', err)
throw err
}
}
export async function deleteArtifact(id: string): Promise<void> {
const db = await getDB()
if (!db) return
try {
const tx = db.transaction(['items', 'versions'], 'readwrite')
await tx.objectStore('items').delete(id)
await deleteVersionsIn(tx.objectStore('versions'), id)
await tx.done
} catch (err) {
console.error('Could not delete artifact', err)
}View on GitHub (pinned to e474e8803c)
Solutions
- Close and reopen the chat/browser so getDB() can reopen (or re-create) the artifact database
- Clear the site's storage/IndexedDB data to recover from a corrupted DB, then retry
- Check that the browser context allows IndexedDB (not blocking private mode / third-party storage policies)
- Inspect the console for 'Could not read artifact version' to see the underlying IndexedDB error before this throw
Example fix
// before
const version = await artifactsState.getVersion(artifactId, 1) // throws if no DB
// after
let version
try { version = await artifactsState.getVersion(artifactId, 1) }
catch { version = undefined /* degrade to in-memory state */ } Defensive patterns
Strategy: try-catch
Validate before calling
const db = await getDB()
if (!db) throw new Error('Artifact store unavailable before read')
if (!('indexedDB' in globalThis)) throw new Error('IndexedDB not supported in this context') Type guard
function isArtifactVersion(v: unknown): v is ArtifactVersion {
return !!v && typeof v === 'object' && 'artifactId' in v && 'version' in v
} Try / catch
let version: ArtifactVersion | undefined
try {
version = await getArtifactVersion(artifactId, n)
} catch (err) {
console.warn('Artifact store unavailable, falling back to in-memory state', err)
version = inMemoryVersions.get(versionKey(artifactId, n))
} Prevention
- Avoid opening chat in storage-blocked contexts (some private modes)
- Handle getDB() returning null at startup and surface a storage warning early
- Monitor IndexedDB open errors and offer a 'clear site data' recovery path
When it happens
Trigger: Opening the copilot chat in a browser context where IndexedDB is blocked or unavailable (private mode restrictions, storage permission denied, DB open failure), then calling getVersion/getArtifactVersion for an artifact version.
Common situations: Safari/Chrome private browsing with storage restrictions; corrupted IndexedDB after a browser upgrade; security settings or extensions blocking third-party storage; running in an environment without IndexedDB support.
Related errors
- ArtifactPersistenceError
- ${e instanceof Error ? e.message : String(e)}
- Image has no dimensions
- Canvas 2D context unavailable
- error writing file to {path}: {e:#}
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/5e6537906236bb9f.
Report an issue: GitHub.