## TL;DR
A crashed revaluation posts some currency adjustments and not their offsets, so the FX account holds one-sided entries. Extract every journal the run created from its batch id, total them by currency and account, and decide: reverse the partial set and rerun clean, which is usually safer than completing a half-known calculation. After the clean rerun, the FX account balance should equal the sum of the run's reported gains and losses exactly.

```text
"FX gain/loss account out of balance" error after the period-end revaluation crashed
```

## Use this when
- The FX gain loss account balance does not tie to the revaluation report after a crash.
- The revaluation run status is failed, aborted, or incomplete with journals already posted.
- Some currencies revalued and others did not in the same run.

## Not for this skill when
- The run completed and the balance is large. Large is not wrong; tie it to the report and investigate only a proven gap.
- Manual FX journals posted into the same account during the period. Separate manual activity before blaming the run.

## Steps
1. List all journals carrying the crashed run's batch id with currency, account, and amount. Verify: the partial footprint is complete, including any offset journals
2. Total the partial postings by currency and compare with the run report's intended results per currency. Verify: you can state what fraction of the run actually posted
3. Reverse the partial postings as a set, referencing the batch id, unless the system can provably resume without duplication. Verify: the FX account returns to its pre-run balance
4. Fix the crash cause if identifiable, such as a missing rate or a locked account, before rerunning. Verify: the blocking condition is removed, not just retried past
5. Rerun revaluation for the full scope and tie the FX account movement to the new run report to the cent. Verify: run report total equals the FX account movement for the period

## Variant phrasings
### revaluation crashed FX gain loss account incomplete
The crashed-run phrasing.
### period end revaluation partial posting reverse rerun
When reversing the partial set.

Compatibility: Period-end revaluation in SAP, NetSuite, Dynamics 365, Oracle, and Sage multi-currency closes.

## Why it happens
Revaluation is a calculation with a posting phase, and the posting phase is many journals. A crash between journals leaves the ledger in a state the calculation never intended: some balance sheet accounts restated, their FX offsets missing, the FX account holding fragments. Because fragments look like real FX activity, the only reliable marker is the batch id tying them to the aborted run. Set-based reversal restores the pre-run truth so a clean rerun can replace it.

## Edge cases / pitfalls
- If the crash happened during a database failover, check for journals posted but missing from the run log; reconcile by account movement, not by log alone.
- Do not let the next period's revaluation run on top of an unreversed partial run; the new run values balances that include fragments and compounds the error.
- A status dashboard for close jobs that distinguishes posted-nothing, posted-partial, and posted-complete prevents most rediscovery work.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_Gae7GToLMclo_5DGjBmBAA
