actualbudget/actual · error · Error
Error exporting budget: ${result.error}
Error message
Error exporting budget: ${result.error} What it means
exportBudget sends 'export-budget' to serialize the currently loaded budget into a zip buffer. If the core returns an error field, this is thrown with the detail. It means the export of the active budget failed server-side (disk/serialization problem or no usable budget).
Source
Thrown at packages/api/methods.ts:91
filename,
type,
});
if (result.error) {
throw new Error(`Error importing budget: ${result.error}`);
}
if (!result.id) {
throw new Error('Error importing budget: no budget was loaded');
}
return { id: result.id };
}
/** Export the currently-loaded budget as a zip buffer. */
export async function exportBudget(): Promise<Uint8Array> {
const result = await send('export-budget');
if ('error' in result) {
throw new Error(`Error exporting budget: ${result.error}`);
}
if (!result.data) {
throw new Error('Error exporting budget: no data was returned');
}
return new Uint8Array(result.data);
}
function toArrayBuffer(data: ArrayBuffer | Uint8Array): ArrayBuffer {
if (data instanceof Uint8Array) {
// Copy into a fresh ArrayBuffer so that views into a larger (possibly
// shared) buffer are not sent across the worker boundary as-is.
const copy = new Uint8Array(data.byteLength);
copy.set(data);
return copy.buffer;
}
return data;
}
View on GitHub (pinned to d4334cb6e6)
Solutions
- Read the detail in the thrown message to identify the core-side cause.
- Ensure a valid budget is loaded before exporting (loadBudget / successful open).
- Retry the export after restarting the API/server process to clear a bad in-memory state.
- Check available disk space and memory on the machine running the export.
Example fix
// before
const data = await api.exportBudget();
// after
let data;
try {
data = await api.exportBudget();
} catch (e) {
console.error('Budget export failed:', e.message);
await api.loadBudget(budgetId); // re-load a known-good budget
data = await api.exportBudget();
} Defensive patterns
Strategy: try-catch
Validate before calling
null
Type guard
null
Try / catch
try {
const zip = await api.exportBudget();
} catch (e) {
if (String(e.message).startsWith('Error exporting budget:')) {
console.error('Export failed:', e.message);
// re-load budget and retry once, else alert backup pipeline
} else throw e;
} Prevention
- Ensure a budget is loaded before exporting.
- Monitor disk space and memory on the exporting host.
- Run exports in a retry wrapper with backoff in backup jobs.
- Keep core/server versions aligned.
When it happens
Trigger: Calling api.exportBudget() when the underlying core export fails: active budget in a broken state, low disk/memory during zipping, or internal error while building the export archive.
Common situations: Scheduled backup jobs exporting budgets from a long-running API process; exporting right after a failed migration; server under memory pressure with very large budgets.
Related errors
- Error exporting budget: no data was returned
- Error importing budget: ${result.error}
- Error importing budget: no budget was loaded
- Amount to hold needs to be greater than 0
- @actual-app/api requires a node version ${minimumNodeVersion
AI-assisted analysis of actualbudget/actual@d4334cb6e6 (2026-08-29).
Data as JSON: /api/errors/0f404297455cf2c0.
Report an issue: GitHub.