When a Purge Fails
A purge never finishes "with errors". If one step can not complete, the purge stops and waits for you, because a purge that skipped a step would leave rows of the range behind that the roll-ups already counted. Stopping is safe: everything done so far is committed, and resuming continues exactly where it stopped.
What a failure looks like
A chunk of a batch fails. The batch goes to Retry with the error, and the purge tries it again automatically. Short problems (a deadlock, a timeout, a server restart) usually pass on the next attempt.
After five failed attempts the batch becomes Blocked, and its error reads as follows, with the batch's target and its last error in place of the braces (English only):
Blocked after 5 failed attempts of the batch {target}; fix the cause, then run the purge config again. Last error: {error}
If the attempts never even finished (the server died during each of them), it reads instead:
Blocked after 5 attempts that never completed; a previous attempt probably crashed the server - investigate the batch {target} before re-running the purge config
The configuration becomes Failed. The batches still waiting are set to Postponed, so nothing else moves.
You see it in four places:
- the Failures section of the Purge Monitor's Run tab, one card per failed batch with its last error and Show full error;
- the configuration's Failed Batches counter and Purge Batches list;
- Last Run Log, when the failure happened outside a batch;
- the critical errors shown at login: after 60 minutes without progress the oldest active purge raises a "no progress" error, and a coordinator that keeps failing raises its own. Both are quoted in full under Messages you may see and on Critical Errors at Login, and they clear themselves once the purge moves again.
Why it is urgent
A failed purge is a half-done purge, and the business feels it:
- Balances and stock can look doubled. Once the roll-up documents of a stage are posted, they stand beside the history they replace until that history is deleted. A trial balance or a stock report run in that window counts both.
- Nothing dated in the purged range can be saved, and requests dated there keep waiting.
- Stock ages and debt ages processing stay paused for new documents until the purge finishes.
- No other purge can start.
Treat a failed purge like a production outage: find the cause, fix it, resume.
Resuming
- Read the error on the Failures card (Show full error for the whole text), fix the cause, and run Check if the cause was something the pre-flight looks at.
- Press Resume purge (it replaces Run purge once the purge has failed).
- The dialog Resume purge {0} — «استئناف الحذف {0}» lists the failed batches with their errors and {0} batch(es) still to run. Tick the backup line, type the configuration's code, and confirm.
- The server runs the pre-flight again and resets the failed and postponed batches. The purge continues.
What happens on a resume:
- Executed batches are not run again.
- Completed steps are skipped: every step writes a marker when it is fully done, per company where it works per company, and a resume starts after the last marker.
- Inside a step, repeating a chunk is harmless: a row already copied to the archive is not copied twice, and a row already deleted is simply not found.
- The queue checks are skipped on a resume (they would stop forever on the purge's own waiting work), and the inventory check is skipped once the inventory stage has started. The purge proves again before it finishes that no request of the range is left.
A server restart is not a failure
If the server stops in the middle of a purge (a crash, a deployment, a manual restart), the configuration stays Planning, Purging or Cleaning up, and the purge continues by itself when the server is back. A chunk that was cut off is rolled back as a whole, archive copy included, and done again. You do not need to press anything. Only if the batch then fails five times does the configuration become Failed.
What is safe to repeat
| Action | Safe to repeat? |
|---|---|
| Check | Yes, at any time. It changes nothing. |
| Dry run | Yes, until the purge starts. After that it is refused. |
| Create missing indexes | Yes. It only creates what is missing and drops what is still there. |
| Resume purge | Yes. It resets only what failed. |
| Restarting the server during the run | Yes. |
| Editing the purge period's end date | No. The end date is pinned when the run starts, and every batch stops until it is restored. |
| Deleting purge batches or roll-up documents, or changing data by SQL | No. Ask Namasoft support. |
| Restoring the backup | Only as a whole: main and archive databases together, to the state before the run. |
Typical causes
| Error on the batch | What it means | What to do |
|---|---|---|
A REFERENCE constraint conflict while deleting approval cases or attachments | The database still has foreign keys from versions before 2020. | Create missing indexes (it drops them), then resume. |
| The message that asks for dropping foreign keys to ApprovalCase and LargeData (quoted on Pre-flight Check and Dry Run) | Same, found by the purge itself before it started a slow delete. | Same. |
| Invalid column name on an insert into an archive table | The archive tables of this version do not match the main tables. | Send the full error to Namasoft support; it needs a product fix. |
| A validation message on a roll-up document (for example a locator, a dimension, a closed period) | Old data the roll-up must restate exactly, but a rule for new documents refused it. | Send the full error to Namasoft support. |
| Purge can not finish at {time}: {requests} dated on or before {cut-off} are still not fully processed. in Last Run Log (English only) | Requests dated in the range were left waiting when the clean-up ended. | Resolve them in Business Requests, then resume. |
| The refusal about the purge period's end date (quoted below) | The purge period was edited after the start. | Restore the end date, then resume. |
| The "rescheduled without processing a single row" error (quoted below) | A step keeps going round without progress. | Raise it with Namasoft support before resuming. |
Messages you may see
| Message | Why | What to do |
|---|---|---|
| Purge configuration {0} has already started and failed; resume it instead — «بدأ ملف إعدادات الحذف {0} وفشل، قم باستئنافه بدلا من ذلك» | Run purge on a failed purge. | Use Resume purge. |
| Purge configuration {0} has not started yet; run it instead — «لم يبدأ ملف إعدادات الحذف {0} بعد، قم بتشغيله بدلا من ذلك» | Resume purge on a purge that never started. | Use Run purge. |
| Purge configuration {0} is already running in the background (status {1}); it will continue automatically. Re-run it only if it has failed. — «ملف إعدادات الحذف {0} قيد التشغيل بالفعل في الخلفية (الحالة {1})، وسيستمر تلقائيا. لا تعد تشغيله إلا إذا فشل.» | The purge is running, nothing failed. | Wait. |
| Purge can not start: the purge period {0} end date is now {1} while this purge already started with end date {2}; the period was edited after the purge started - restore its end date to {2} first — «لا يمكن بدء الحذف: تاريخ نهاية فترة الحذف {0} أصبح {1} بينما بدأ هذا الحذف بتاريخ نهاية {2}، أي أن الفترة عدلت بعد بدء الحذف - أعد تاريخ نهايتها إلى {2} أولا» | The purge period was edited. | Restore the end date. |
| The purge coordinator has failed {0} time(s) in a row with the error: {1}. No purge can advance and every purge range guard stays up until this is resolved | The step that moves purges forward keeps failing. English only. | Fix the cause in the message, then resume. |
| Purge config {0} (status {1}) has made no progress for {2} minutes. Until it is resumed or fixed the purged period refuses postings, the ledger, inventory, stock ages and debt ages processors stay paused, and the balances and quantities of the already created purge roll-ups are doubled by the sources that are not deleted yet | The oldest active purge has not moved for an hour. English only. | Open the monitor, read the failure, fix and resume. |
| The purge batch {0} asked to be rescheduled {1} times in a row without processing a single row; it has been stopped as a non-progressing purge batch | A step is going round without progress. English only. | Raise it with Namasoft support. |