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

  1. Verify the storage path env var exists and the process has read access.
  2. Check the logged err object (logger.error '[RagController] Error scanning and syncing storage') for the root cause.
  3. Ensure DB and Qdrant services are up.
  4. 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

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


AI-assisted analysis of Crosstalk-Solutions/project-nomad@0bd1c6f4f9 (2026-08-27). Data as JSON: /api/errors/11733a006527bec6. Report an issue: GitHub.