{"record":{"id":"69621390bfc33391","repo":"actualbudget/actual","slug":"internal-error","errorCode":"internal-error","errorMessage":"Internal error occurred during import.","messagePattern":"Internal error occurred during import\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/loot-core/src/server/dashboard/app.ts","lineNumber":349,"sourceCode":"              tombstone: false,\n            }),\n          ),\n      ]);\n    });\n\n    return { status: 'ok' as const };\n  } catch (err: unknown) {\n    if (err instanceof Error) {\n      err.message = 'Error importing file: ' + err.message;\n      captureException(err);\n    }\n    if (err instanceof SyntaxError) {\n      throw new Error('Invalid JSON file.', { cause: 'json-parse-error' });\n    }\n    if (err instanceof ValidationError) {\n      throw new Error(err.message, { cause: 'validation-error' });\n    }\n    throw new Error('Internal error occurred during import.', {\n      cause: 'internal-error',\n    });\n  }\n}\n\nexport type DashboardHandlers = {\n  'dashboard-create': typeof createDashboardPage;\n  'dashboard-delete': typeof deleteDashboardPage;\n  'dashboard-rename': typeof renameDashboardPage;\n  'dashboard-update': typeof updateDashboard;\n  'dashboard-update-widget': typeof updateDashboardWidget;\n  'dashboard-reset': typeof resetDashboard;\n  'dashboard-add-widget': typeof addDashboardWidget;\n  'dashboard-remove-widget': typeof removeDashboardWidget;\n  'dashboard-copy-widget': typeof copyDashboardWidget;\n  'dashboard-import': typeof importDashboard;\n};\n","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/loot-core/src/server/dashboard/app.ts#L331-L367","documentation":"Any error thrown during import that is neither a SyntaxError nor a ValidationError is converted to `Error('Internal error occurred during import.', { cause: 'internal-error' })`, and the original error is reported via captureException. This masks DB/write failures behind a generic message.","triggerScenarios":"Database insert failures while writing imported widgets (constraint violations, locked DB), errors in addDashboardWidget/import internals, or any non-parse non-validation exception inside the try block.","commonSituations":"Corrupt or locked SQLite file; disk full; imported data violating DB constraints (e.g. duplicate ids or broken references in meta); running an old build against a newer export.","solutions":["Check the server/app logs (captureException output) for the underlying original error.","Verify the database file is not locked or corrupt; back up and repair if needed.","Retry the import with a minimal dashboard file (one simple widget) to isolate the failing data.","Upgrade Actual; if reproducible, file an issue with the sanitized import file."],"exampleFix":"// before\nawait send('dashboard-import', { filePath: hugeMixedFile, dashboardPageId });\n// after\ntry {\n  await send('dashboard-import', { filePath: minimalFile, dashboardPageId });\n} catch (e) {\n  if (e.cause === 'internal-error') console.error('check server logs');\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await send('dashboard-import', { filePath, dashboardPageId });\n} catch (e) {\n  if (e.cause === 'internal-error') {\n    // original error was sent to captureException; check server logs\n    console.error('Import failed internally; inspect server logs and DB state.');\n  }\n}","preventionTips":["Keep the SQLite database healthy (no locks, enough disk space) before large imports.","Test imports with a minimal one-widget file to isolate bad data.","Monitor server logs via captureException/Sentry for the masked root cause."],"tags":["internal","import","database"],"backgroundTag":"internal-error","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}