Crosstalk-Solutions/project-nomad · error
Error scanning and syncing storage
Error message
Error scanning and syncing storage
What it means
Catch-all 500 from the scanAndSync controller action: ragService.scanAndSyncStorage() threw an unexpected exception while walking storage and syncing records to the DB/Qdrant.
Source
Thrown at admin/app/controllers/rag_controller.ts:187
const result = await EmbedFileJob.cancelAllJobs()
return response.status(200).json({
message: `Cancelled ${result.cancelled} job${result.cancelled !== 1 ? 's' : ''}${result.filesDeleted > 0 ? `, deleted ${result.filesDeleted} file${result.filesDeleted !== 1 ? 's' : ''}` : ''}.`,
...result,
})
}
public async policyPromptState({ response }: HttpContext) {
const result = await this.ragService.getPolicyPromptState()
return response.status(200).json(result)
}
public async scanAndSync({ response }: HttpContext) {
try {
const syncResult = await this.ragService.scanAndSyncStorage()
return response.status(200).json(syncResult)
} catch (error) {
logger.error({ err: error }, '[RagController] Error scanning and syncing storage')
return response.status(500).json({ error: 'Error scanning and syncing storage' })
}
}
public async reembedAll({ response }: HttpContext) {
try {
const result = await this.ragService.reembedAll()
return response.status(200).json(result)
} catch (error) {
logger.error({ err: error }, '[RagController] Error during re-embed all')
return response.status(500).json({ error: 'Error during re-embed all' })
}
}
public async resetAndRebuild({ response }: HttpContext) {
try {
const result = await this.ragService.resetAndRebuild()
return response.status(200).json(result)
} catch (error) {View on GitHub (pinned to 0bd1c6f4f9)
Solutions
- Verify the storage path env var exists and the process has read access.
- Check the logged err object (logger.error '[RagController] Error scanning and syncing storage') for the root cause.
- Ensure DB and Qdrant services are up.
- Re-run scanAndSync after fixing; consider making the walker skip unreadable files.
Defensive patterns
Strategy: try-catch
Validate before calling
await fs.access(STORAGE_PATH) // ensure storage mounted before sync
Try / catch
try { await scanAndSync() } catch (e) { alertUser('sync failed, check storage mount'); log(e) } Prevention
- Health-check the storage mount before sync
- Make the walker skip unreadable files
When it happens
Trigger: Storage directory missing or unreadable; permission denied on mounted volume; a file with unexpected encoding/name throws the walker; DB write failure during sync.
Common situations: Misconfigured storage mount path in env; read-only volume; huge/odd files causing parse errors; database connection dropped mid-sync.
Related errors
- Storage drive not available: cannot write to ${STORAGE_BASE}
- File not found: ${filename}
- Failed to read file stream: ${filename}
- Base map assets are missing and could not be downloaded. Ple
- Base map assets are missing from storage/maps
AI-assisted analysis of Crosstalk-Solutions/project-nomad@0bd1c6f4f9 (2026-08-27).
Data as JSON: /api/errors/11733a006527bec6.
Report an issue: GitHub.