Troubleshooting
Troubleshoot backup and migration safety — Sustainable Catalyst Platform Core
Diagnose backup, restore, and migration failures in Sustainable Catalyst Platform Core. Includes database-integrity checks, isolated restore procedures, schema compatibility testing, recovery objectives, and evidence-based incident resolution.
Troubleshoot backup and migration safety — Sustainable Catalyst Platform Core
Application: Sustainable Catalyst Platform Core
Component: Continuity / Backup Verification / Migration Assurance
Article type: Troubleshooting and operational recovery
Estimated reading time: 18–22 minutes
Source commit: 59b8444365525a58fd4f6a7e29a20d712769e1a2
Source version: 4.21.0 (deployment unverified)
Status: Source-anchored guidance; independent staging, production and scientific verification pending.
Goal
Diagnose and safely resolve backup and migration failures in Sustainable Catalyst Platform Core without damaging research records, publishing incomplete evidence, or confusing a registered backup with recoverable data. A successful outcome requires an independently checked backup, a rehearsed restore into an isolated target, matching schema/application lineage, and a deliberate authorization decision before any real cutover.
Primary acceptance: an authorized operator can restore a known-good snapshot to a separate environment, validate its data and migration state, demonstrate compatible application behavior, and preserve the original source and audit trail.
Requirements
Applies to the continuity implementation documented in Platform Core source commit 59b8444365525a58fd4f6a7e29a20d712769e1a2, which declares Settings.version = "4.21.0". This is a source baseline; it does not establish the deployed or supported production version. Earlier continuity design documentation covers v2.17.0–v2.20.0.
- Access: owner-approved, least-privilege read access to monitoring, backup inventory, release metadata and recovery evidence; a separate authorized operator conducts any rehearsal or recovery.
- Identity: confirmed environment, tenant/organization, database engine, data classification, application image digest, database endpoint alias, schema head, and ownership.
- Backup provenance: completed-at timestamp, immutable backup key, storage format, source-engine version, bytes or manifest digest, off-host retention policy, and any encryption-key recovery requirements.
- Isolation: disposable SQLite or fully isolated PostgreSQL target; restricted network, different credentials, no production connections or event/webhook delivery.
- Recovery plan: preapproved recovery point objective (RPO), recovery time objective (RTO), capacity/space budget, change window, rollback boundary and evidence retention.
Symptoms
Failures normally present as one of the following observable conditions, not a single generic “backup failed” state.
| Signal | What it may indicate | Immediate response |
|---|---|---|
No eligible backup; recent_verified_backup |
No backup registered with a current verified or attested state, or the selected backup exceeds the age objective. |
Check inventory, independent bytes, timestamps and the objective; do not relabel an untested file as verified. |
mismatch or missing |
Filesystem digest differs or the configured backup file is absent. | Quarantine the record, preserve logs, verify the independent source; do not modify the suspect bytes. |
recent_restore_rehearsal |
No recent passed, recorded rehearsal. | Run an owner-authorized isolated restore before certification. |
rpo or rto |
Latest selected backup is older than the RPO or rehearsal duration exceeds target. | Inspect actual time points, read-only metrics and recovery plan. |
| Pending migration or schema-head mismatch | Restored database is incompatible with the pinned application or migration inventory. | Freeze cutover and compare exact migration heads on an isolated target. |
401/403/404 |
Missing read/write authorization, scoped interface or hidden record. | Confirm authenticated identity and environment without disclosing secrets. |
422 |
Invalid backup digest, storage kind, filesystem root or attestation payload. | Read the returned nonsecret validation detail and compare against schema. |
| Timeout or ambiguous write response | Network fault after a request might have persisted a record. | Read the current backup/rehearsal inventory before retrying. |
Cause
Root causes frequently cross several layers. Classify the earliest failing boundary before making changes.
- Media integrity: missing, truncated, modified or unreadable backup; checksum was calculated for a different file or compression/encryption representation.
- Restorability: a digest matches but the dump cannot actually be restored, lacks required external files, encryption keys, database roles or extensions.
- Schema compatibility: the backup has the wrong migration head, unsupported downgrade expectations, untested forward migrations or a different application image.
- Authority and policy: operator has insufficient permissions, signing/restore procedures are unapproved, or a certification gate was configured differently than expected.
- Evidence semantics: an operator attestation was mistaken for Core reading the underlying bytes, or a metadata checkpoint was mistaken for an actual database dump.
- Control-plane consistency: backup identifiers reused, stale status data, interrupted registration, or a successful metadata write mistaken for an actual restore.
- Data isolation: a rehearsal target connected to production integrations, or unredacted backup locations and private research material entered public logs.
Architecture and authority boundaries
Platform Core separates backup artifact metadata, integrity verification, restore rehearsal records, recovery objectives, and production certification. These records do not substitute for operator-managed storage or host recovery.
| Component | Established source contract | Not established |
|---|---|---|
| Continuity service | register_backup / verify_backup / rehearse / continuity_status | It does not create real PostgreSQL backups or perform automatic production restores. |
| Continuity routes | /v1/continuity and /api/v1/continuity | A public aggregate status is not a backup inventory or an authorization token. |
| Certification | migration assurance and optional backup gates | A “certified” result does not by itself prove a PostgreSQL restore occurred. |
| Migration ledger | run_migrations and migration_status | A schema-head number does not confirm all application-level invariants. |
| Historical documentation | v2.20 continuity contract | Historical version documentation does not establish the currently deployed release. |
Recorded backup versus recoverable backup
Do not mistake a recovery checkpoint for a database image. The v2.17 recovery checkpoint captures a release, applied migration inventory, table names and selected row counts, plus a SHA-256 over metadata. It explicitly sets database_backup_embedded=false.
For a filesystem backup within SC_CORE_BACKUP_FILESYSTEM_ROOT, Core can read and hash the actual bytes and mark verified or mismatch. For operator-managed PostgreSQL or remote storage, it records a attested state based on operator-submitted digest evidence; Core does not independently read that remote backup.
Consequently a readiness response can include an eligible attested backup even when no independent operator restore evidence has been reviewed. Check the underlying proof before declaring the service recoverable.
Procedure
Use the following workflow for a backup or migration incident. The initial steps are investigative, but even a readiness GET can seed an objective record, so check permissions and side effects first. Any rehearsal or mutation requires explicit approval and a separate environment.
- Freeze the boundary: stop unapproved migrations, releases and automated writes that could enlarge data divergence. Preserve the last known successful deployment and source state.
- Record an incident packet: incident ID, UTC time, affected service/environment, release commit and image digest, engine/version, applicable objectives, and trace IDs. Never put credentials or private research bodies in a public ticket.
- Observe Core: inspect authorized continuity readiness, backup inventory and migration status after confirming that readiness may seed a default objective. Keep the request ID and distinguish public summary from internal detail.
- Inspect the candidate backup: verify its origin, completion, size and expected SHA-256 using authorized storage. Never reuse a backup key for a different snapshot.
- Rehearse away from production: for a local SQLite backup, use the source-supported isolated rehearsal; for PostgreSQL/MySQL, use an approved external database-native restore into disposable infrastructure.
- Compare compatibility: verify target database engine/version, expected schema/migration head, application source and container images, required extensions, role mappings and external dependencies.
- Validate data and behavior: run integrity checks, representative counts, specific immutable research-object checksums, application read-only smoke tests, and privacy/isolation checks.
- Approve or refuse: record test outcomes, RPO/RTO observations, blockers and reviewer decision. Do not infer permission to cut over from a successful local drill.
- Escalate production action separately: if actual recovery is authorized, follow the named runbook with explicit backups, hold points, rollback criteria and post-cutover acceptance.
1. Read-only discovery and triage
Use a network-approved client. These are HTTP GET requests that do not request a restore or publication change, but the Core readiness implementation calls get_or_create_objective and may create a default recovery-objective database record on first access. Arrange authorized observational access and confirm this side effect before querying a live instance. Supply authentication using an approved credential manager rather than embedding a token in published commands. The internal routes require permissions and may return 401/403.
# Replace with the authorized internal address; never paste credentials into the command.
CORE_ORIGIN="https://YOUR-APPROVED-CORE-ENDPOINT"
# AUTH_HEADER is a placeholder injected by your authorized credential manager.
curl --fail-with-body --silent --show-error \
-H "$AUTH_HEADER" "$CORE_ORIGIN/v1/continuity/readiness?environment=production"
curl --fail-with-body --silent --show-error \
-H "$AUTH_HEADER" "$CORE_ORIGIN/v1/continuity/backups?environment=production&limit=20"
curl --fail-with-body --silent --show-error \
-H "$AUTH_HEADER" "$CORE_ORIGIN/v1/continuity/restore-rehearsals?environment=production&limit=20"
In the readiness response, record release, pending_migrations, eligible_backup_present, latest_backup_verification_state, backup_recent, rpo_met, restore_rehearsal_recent, rto_met and blockers. Treat the response as an observation at the requested UTC time, not as a forensic backup copy.
2. Inspect storage and checksum failures
The filesystem verification implementation resolves the candidate path and refuses access outside the configured root. It hashes the file in bounded chunks; a missing backup is marked missing, differing bytes mismatch, and a matching file verified. For a remote or operator-managed artifact, do not call the filesystem verify action: record independent external checksum evidence through the attestation process.
# On an operator-approved copy of an individual backup artifact:
python3 - <<'PY'
import hashlib, pathlib
p = pathlib.Path('APPROVED_BACKUP_COPY')
h = hashlib.sha256()
with p.open('rb') as f:
for block in iter(lambda: f.read(1024 * 1024), b''):
h.update(block)
print('sha256:', h.hexdigest(), 'bytes:', p.stat().st_size)
PY
Compare with the hash computed at backup completion from the same representation. For encrypted/compressed archives, document whether the digest covers ciphertext, compressed bytes, or logical uncompressed data. A matching SHA-256 validates byte correspondence, not completeness or logical database validity.
3. Execute a disposable SQLite restore rehearsal
Core’s built-in SQLite rehearsal reads a previously Core-verified SQLite file, opens the source read-only, uses the SQLite backup API to restore into a temporary database, compares PRAGMA integrity_check, records the recovered schema head, and removes the temporary target. It does not mutate the source or restore production.
The downloadable package includes an independent restore_rehearsal.py and a synthetic test fixture. Run these commands locally without any Platform Core credentials:
python3 restore_rehearsal.py --make-fixture /tmp/sc-kb-example-backup.db
# Copy the sha256 value printed above into EXPECTED_SHA.
python3 restore_rehearsal.py \
--source /tmp/sc-kb-example-backup.db \
--expected-sha256 "$EXPECTED_SHA" \
--schema-head synthetic-0001 \
--table research_objects --count 2
python3 -m unittest -v test_restore_rehearsal.py
Additional safety check: Core’s built-in rehearsal checks the stored verification_state before opening the file; it does not recompute the file SHA-256 inside the rehearsal routine. On real exercises, recalculate the hash immediately before the rehearsal and compare it again afterward to guard against changes since the earlier verification.
The utility verifies a synthetic example independently of Core. It does not use the Platform Core API, certify a deployed service, or validate real PostgreSQL backup policy. Expected sample result: status: passed, six boolean checks true, and production_verified: false.
4. PostgreSQL and external database recovery
For PostgreSQL or MySQL, Platform Core provides external operator attestation/recording only. An authorized database operator must perform and independently verify a real restoration using database-native tools and appropriately secured media. Do not execute a restore against production to troubleshoot an article.
- Select a separate isolated host or container, network and database name. Ensure it cannot send emails, publish research, run background queues, or contact production writers.
- Confirm the backup engine/version, archive/WAL requirements, roles and extensions; restore the snapshot and required transaction logs according to the approved plan.
- Capture the exact restore command in the restricted operator evidence store, not in the public article or incident summary.
- Check native database integrity, schema head and critical table/record totals; verify deterministic research-object hashes and application read-only behavior.
- Record backup digest, restore target image digest, restore duration, target schema head, operator identity and independent reviewer decision. Then dismantle the isolated target following policy.
Useful authoritative references: PostgreSQL Backup and Restore, PostgreSQL continuous archiving and PITR, and SQLite Online Backup API.
5. Migration safety and schema lineage
Pin the exact application commit and image digest before comparing migration status. Run the migration-status check against an isolated database first. Confirm the expected head from the same source commit, not from an earlier article or example:
# From backend/ in the exact source checkout; use isolated dependencies:
python3 -c 'from app.migrations import MIGRATIONS; print(MIGRATIONS[-1][0])'
# Never run migrations against a production database as part of this guide.
Version caveat: the historical feature validator checks for migration 0023, and a checked-in continuity test asserts a historical 2.35.0 readiness release. The inspected configuration now declares 4.21.0. These fixed expectations should be reconciled with the exact candidate image before treating older test results as current release acceptance.
| Test | Expected |
|---|---|
| Migration ledger | All required revisions applied; no unexplained pending, duplicate, partial or divergent entries. |
| Schema versus application | Restored schema and dependencies match the exact pinned Core image. |
| Forward migration | Representative records, access rules and research provenance survive migration on an isolated clone. |
| Rollback | Document whether an application rollback can occur without destructive down migration; never assume reversibility. |
| External dependencies | Confirm object storage, credentials, queues and service integrations are compatible and isolated. |
6. Recovery objectives: RPO, RTO, and freshness
Recovery point objective (RPO) limits tolerated data loss. Recovery time objective (RTO) limits tolerated restoration time. Core computes backup age against configured RPO, and the recorded rehearsal duration against configured RTO:
backup age = UTC assessment time − backup completion time; rehearsal duration = finish − start.
These are proxies, not proof of an incident’s end-to-end outcome. A database may restore quickly but require additional time for DNS, encryption keys, object storage, network policy, publication controls and acceptance tests. Actual RTO should include those steps. Backup age alone does not quantify every write that would be lost in a real incident.
The inspected source declares defaults of 1440 minutes RPO, 240 minutes RTO, a 1440-minute maximum backup age and a 720-hour maximum rehearsal age. These are configuration defaults, not approved organizational recovery objectives.
7. Incident decision matrix
| Observation | Decision | Safe next step |
|---|---|---|
| Filesystem SHA mismatch | Do not accept this artifact | Preserve evidence; select a separate trustworthy backup for an isolated rehearsal. |
| SQLite integrity check fails | No restore acceptance | Investigate media corruption or incomplete source snapshot. Do not overwrite original bytes. |
| Operator-managed PostgreSQL is only attested | Require evidence review | Confirm external restore, source media, operator sign-off and target identity. |
| Pending migrations or wrong head | Hold deployment | Compare the exact versioned migration inventory in staging. |
| No recent passed drill | Recovery readiness incomplete | Conduct authorized isolated rehearsal, not a live trial restore. |
| API response uncertain after write | State not known | Read persisted inventory before reissuing the request. |
| Public status leaks private details | Treat as security incident | Contain exposure, preserve restricted evidence and follow privacy incident procedure. |
| Certificate is green but gates optional | Review policy before acceptance | Check the actual certification flags and independent restore evidence. |
8. Negative test matrix
Adverse tests belong in disposable environments with synthetic records.
| Negative case | Required response | Retained evidence |
|---|---|---|
| Wrong SHA-256 | Mismatch; no passed checksum check | Expected/observed digests and immutable snapshot identifier |
| Backup missing or outside permitted filesystem root | Missing or explicit path-boundary refusal | Sanitized error; no private path in public output |
| Wrong schema head or incompatible image | Stop release acceptance | Migration inventory and image digest |
| Changed record count after restore | Fail functional acceptance | Read-only query, expected baseline, observed count |
| Expired backup or rehearsal | RPO/RTO or freshness block | UTC timestamps and owner-approved targets |
| Wrong authentication role | 401/403 or documented refusal; no state mutation | Request ID and nonsecret identity scope |
| PostgreSQL artifact sent to SQLite restore route | Reject unsupported database engine | Engine label and response |
Reused backup_key |
Read existing record; do not silently reassign key | Original registration and new candidate identity |
| Credential or research content appears in public status | Fail privacy acceptance | Restricted reproduction; remediation decision |
9. Preserve evidence and contain the incident
Use an internal incident identifier and immutable evidence manifest. Record UTC times, environment, service release, database version, relevant trace IDs, backup identifier and exact bytes/hash, migration head, owner action, reviewer findings and explicit limitations. Preserve the suspected failure and earlier successful state. Do not delete failed backup metadata, replace the only snapshot, edit migration history to silence an alert, or disclose research bodies and credentials in public tickets.
If a service is in danger of writing to inconsistent state, obtain authorization to pause deployments or writers using the existing incident/runbook process. Avoid guessing at rollback commands: a rollback of application code is not necessarily a rollback of a database schema.
10. Reconcile a partially completed operation
Core registration is idempotent by backup_key: when an existing record has that key, registration returns the original object, even if the retry names another storage URI. Therefore each new snapshot requires a new unique backup key. If a POST timed out, first query the internal backup inventory and compare the exact key, URI, engine, digest and completion time. Avoid blind retry of an unverified write or restore operation.
Troubleshooting
Identify the first failing invariant and inspect its authoritative source:
- 401/403/404: distinguish authenticated internal routes from optional public aggregate status; verify role and environment without publishing credentials.
- 422 checksum or path error: validate 64-character digest, permitted engine/storage kind, and restricted filesystem root.
- Verified backup but no rehearsal: checksum verifies media, not database restorability; rehash the actual bytes immediately before a separate isolated restore.
- Ready despite missing proof: check the certification gates
SC_CORE_CERTIFICATION_REQUIRE_RECENT_VERIFIED_BACKUPandSC_CORE_CERTIFICATION_REQUIRE_RECENT_RESTORE_REHEARSAL. Both default to false in the inspected source. - Migration test disagreement: the historical continuity validator and fixed-version test may not reflect later Core versions; inspect the exact image and migration head.
- RPO/RTO mismatch: review actual UTC values, rehearsal duration and current authorized objectives; do not edit objectives to conceal a failing run.
- Missing scientific state after restore: inspect external object storage, relationships, provenance, retention constraints, and WAL/PITR completeness.
Resolution
Close each issue only when the corrective action is backed by repeatable evidence:
- Bad backup media: retain the failed artifact, verify a different independent backup, restore it in isolation, and check original bytes unchanged.
- Migration divergence: pin application/source and schema head, repair with an approved forward plan on a disposable clone and check reference data; stop any destructive downgrade.
- Missing operator proof: obtain real database-native restore results and reviewed attestation instead of relying on metadata or an empty certificate.
- Outdated recovery evidence: create a new verified backup and recent isolated rehearsal under the authorized objectives.
- Deployment recovery: execute the separate authorized production runbook, preserve rollback checkpoints, and obtain independent post-cutover verification.
One successful HTTP response, dashboard badge, digest check or local test suite is insufficient to certify an entire restoration.
Verification
An independent reviewer should confirm these properties before closure:
| Property | Acceptance | Evidence scope |
|---|---|---|
| Backup bytes | Digest and media identity match the original completed backup | Independent storage or filesystem |
| Restore | An isolated target actually contains recoverable data; original source unaffected | SQLite or external database-native rehearsal |
| Schema | Restored migration head and application image are compatible | Pinned integration / staging |
| Research state | Critical objects, checksums, references and access boundaries are intact | Cross-service checks |
| RPO/RTO | Actual operational recovery and data-loss limits satisfy approved objectives | Measured rehearsal and incident review |
| Security | No exposed secrets, paths or private records | Least-privilege access and privacy review |
| Authorization | Owner/operator and independent reviewer sign off with limitations | Documented governance decision |
Classify source inspection, synthetic offline tests, isolated integration, staging, production recovery, and scientific review separately. Evidence does not automatically transfer between them.
11. Validate against the actual Platform Core checkout
Once the exact repository commit has been checked out, developers can execute the existing tests in a disposable environment with backend dependencies installed. These Core tests were not run during this article upgrade; version-pinned assertions may fail against later source.
git clone https://github.com/Content-Catalyst-LLC/sustainable-catalyst-platform-core.git
cd sustainable-catalyst-platform-core
git checkout 59b8444365525a58fd4f6a7e29a20d712769e1a2
cd backend
# Configure an isolated development Python environment; never use production DB credentials.
python -m pytest -q tests/test_continuity_disaster_recovery_v2200.py
# This validator creates and migrates its own disposable SQLite database.
PYTHONPATH=. python scripts/validate_continuity_disaster_recovery.py
Record exact command, dependency lock, exit status, observed version, expected migration head and failure traces. Do not replace actual failures with previously reported green statuses.
12. Acceptance and escalation packet
Include the affected deployment image digest, DB engine/version, current migration head, last known successful backup, checksum, backup age, immutable media reference, isolated restore result, data/lineage checks, authorization, actual measured times, RPO/RTO decision, security/privacy results, independent reviewer, unresolved issues, and a documented rollback/forward-recovery boundary. A missing mandatory item is a blocker, not a “passed with caveats” result.
13. Supported version and Knowledge Base metadata
Application: Sustainable Catalyst Platform Core. Component: Continuity / Backup Verification & Disaster Recovery / Migration Assurance. Source reference: commit 59b8444, which declares Settings.version = "4.21.0". Original feature documentation: v2.17.0–v2.20.0. Supported deployed version and last verified deployment: not independently established.
Assign component taxonomy and supported/last-verified versions in WordPress only after the deployment owner supplies a corresponding release receipt. A published Knowledge Base article may remain marked verification pending and is not itself an operational or scientific certification.
14. Technical references
Implementation references, all pinned to the inspected Core commit:
- Continuity API, request payloads and permission gates
- Backup registration, checksums, restore rehearsals and RPO/RTO
- Migration assurance and certification gating
- Versioned Core migrations and status
- Source version and continuity configuration defaults
- Continuity integration tests
- Disposable SQLite feature validator
- Backup artifact schema
- Restore rehearsal schema
- Continuity and recovery safety boundaries
- Production certification and recovery metadata
- Incident control and rollback documentation
External technical documentation: PostgreSQL Backup and Restore, Continuous Archiving and PITR, and SQLite Online Backup API.
