Checkpoint Lab — Scheduled Tasks, Repair Jobs, Metadata Rebuilds, Blob Maintenance, and Operational Housekeeping
Integrate the chapter into an operator-grade checkpoint: design a small maintenance calendar, configure two safe disposable tasks, induce and diagnose one controlled failure, verify artifact consistency, and produce evidence plus a runbook that bridges to REST automation.
Learning objectives
- Build a maintenance calendar with scope, dependencies, windows, and owners.
- Configure two Community-compatible disposable tasks with explicit predictions.
- Induce one safe task failure and diagnose it from task history/logs.
- Prove repository content remains consistent with independent checksums and requests.
- Produce an evidence packet and cleanup/rollback procedure suitable for operational review.
Version baseline (26 August 2026). These lessons use Sonatype Nexus Repository 3.95.2 as a dated reference point and Java 21 as the current runtime requirement. New installations default to H2, while Sonatype recommends external PostgreSQL for production. The mandatory lab assumes a small, disposable, loopback-only self-hosted Community Edition instance installed from the distribution archive with H2 and a file blob store. Task names, task availability, edition entitlements, and repair guidance are version-sensitive, so inspect the task list on your exact instance before following any example.
Repair-task boundary. Current Sonatype task documentation says tasks prefixed Repair are intended for specific problems rather than routine schedules, and Sonatype recommends running them only with an identified need and, for production incidents, appropriate support guidance. In this chapter, routine labs use harmless Admin tasks. Repair tasks are inspected, reasoned about, or demonstrated only in disposable/simulated recovery contexts.
1. Checkpoint scenario
You operate a tiny internal Nexus instance used by a training CI system. The artifact repository is healthy, but the team has no maintenance calendar. A previous operator copied a weekly “repair everything” checklist from an old blog. Your job is to replace folklore with a controlled operating model.
You will:
- create a dedicated Raw hosted repository and file blob store;
- publish two tiny immutable evidence files;
- create a safe H2 backup task;
- create a safe file-blob temporary-file cleanup task;
- intentionally fail a second backup execution using a disposable unwritable destination or synthetic fixture;
- diagnose the failure from task history/logs;
- prove repository content did not change;
- produce a maintenance calendar and runbook.
2. Preflight and assumptions
| Item | Required checkpoint value |
|---|---|
| Instance | Disposable self-hosted Community Edition; loopback/private only |
| Nexus baseline | 3.95.2 reference, record actual version |
| Java | 21 / bundled recommended runtime where applicable |
| Database | H2 for this small archive-install lab only |
| Blob store |
Dedicated file blob store task-checkpoint-blobs
|
| Repository | Raw hosted task-checkpoint-raw |
| Credentials | Temporary lab admin for creation; separate task observer/runner where practical |
| Backup destination | Dedicated local directory outside valuable data |
Stop if the instance contains valuable data, if you cannot identify the data directory/database/blob store, or if another maintenance/migration/restore task is running.
3. Required predictions before mutation
Write these predictions in predictions.md before
creating tasks:
- Prediction A: a successful H2 backup run creates backup output and updates task history/log evidence, but does not change the two Raw artifact hashes.
- Prediction B: a temporary-file cleanup on the dedicated file blob store may be a no-op; it should not delete normal repository assets.
- Prediction C: an H2 backup directed to a safely unwritable lab destination should fail without changing repository artifact bytes.
- Prediction D: no Repair task is required because the repository is healthy.
4. Create immutable evidence payloads
mkdir -p task-checkpoint-evidence
cd task-checkpoint-evidence
printf 'checkpoint artifact alpha\n' > alpha.txt
printf 'checkpoint artifact beta\n' > beta.txt
sha256sum alpha.txt beta.txt | tee expected-sha256.txt
Upload them to:
learner-example/task-checkpoint/1.0.0/alpha.txt
learner-example/task-checkpoint/1.0.0/beta.txt
Verify by fresh HTTP requests and save the downloaded hashes in
before-sha256.txt. This is your independent consistency
baseline.
5. Capture task inventory before changes
Save either a screenshot/export or a manually transcribed table of
task name, type, enabled state, schedule, next run, last run, and
result. If using the list API with a least-privilege observer, save
the JSON as tasks-before.json. Redact credentials and
internal secrets.
6. Configure Task A — H2 backup
Create Admin - Backup H2 Database:
Name: LAB19 - H2 backup - checkpoint
Frequency: Manual for first validation
Location: <dedicated writable relative lab path>
Notification: optional; do not require external SMTP for the lab
Run it once. Capture result, task log, backup directory listing, and output size. Then verify alpha/beta again. Prediction A should hold.
7. Configure Task B — delete blobstore temporary files
Create Admin - Delete blobstore temporary files for
task-checkpoint-blobs if present in your version.
Ensure no upload is in progress. Run it once manually and capture
the task result/log.
Do not create fake temporary blob files in Nexus internals. A zero-deletion run is acceptable and preferable to unsupported mutation. Verify alpha/beta again. Prediction B should hold.
8. Failure injection — backup destination denied
Choose one of two paths:
Path A — live safe failure
If your disposable deployment lets you identify a safely isolated directory resolved by the H2 task's relative Location field, create a lab-only subdirectory there and deny the Nexus process identity write permission. Point a copied/manual H2 backup task to that relative location and run it. Do not change permissions on the Nexus application directory, database files, blob stores, or unrelated data-directory content. If that isolation is not clear, use Path B instead.
Path B — simulation when safe permission control is impractical
Use this fixture and treat it as the task log for diagnosis:
Task: LAB19 - H2 backup - denied
Type: h2.backup.task
State: WAITING
Last result: FAILURE
Message: java.nio.file.AccessDeniedException: /lab/denied
Timestamp: 2026-08-26T03:10:14+04:00
Prediction C is about state separation: a failed backup output path should not mutate artifact bytes.
9. Diagnose the failure
- Preserve the failed task configuration and log.
- Confirm the task type and Nexus version.
- Confirm H2 database assumption; do not apply this task to PostgreSQL.
- Inspect the destination path and Nexus process identity.
- Check free disk and file permissions.
- Confirm no unrelated task failed at the same time.
- Correct only the lab backup destination/permissions.
- Rerun the backup task and verify success.
- Re-download alpha/beta and compare SHA-256 hashes.
Document why the least-destructive correction was changing the destination permissions, not restarting as root or editing Nexus internals.
10. Build the maintenance calendar
Create maintenance-calendar.md with a table like this,
using your measured durations rather than copying these exact times:
| Job | Trigger | Scope | Window | Dependency / conflict | Verification |
|---|---|---|---|---|---|
| H2 DB backup | RPO policy / lab exercise | Database | Low traffic; periodic offline backup also required by production guidance | Coordinate with blob backup | Backup output + restore test plan |
| Cleanup service | Retention policy | Attached repositories | Low traffic | Review before compaction | Kept/deleted coordinates |
| Blob compaction | Accepted soft deletes/capacity | Blob store | Off-peak | After retention acceptance; avoid conflicting jobs | Capacity + task log |
| Temp blob cleanup | Housekeeping | File blob store | Low traffic | No active upload | Task result + artifact checks |
| Search rebuild | Incident/migration requirement | Repository | Manual window | No duplicate repair work | Search + exact download |
| Data Repair Plan/Execute | Recovery inconsistency | Blob/repository/time range | Recovery event only | Support/current docs | Plan/results + restored components |
11. Task authorization matrix
Create task-authz.md:
| Persona | Task privileges | Repository privileges | Can redefine tasks? |
|---|---|---|---|
| Observer | nx-tasks-read |
Browse/search as needed | No |
| Runner |
nx-tasks-read + nx-tasks-run
|
Only operational scope required | No |
| Task designer | Specific create/update/delete | Specific admin scope | Yes, change-controlled |
| Admin | Broad | Broad | Yes; not for routine CI |
12. Prove repository content remained consistent
curl -fsS -o alpha-after.txt \
'http://127.0.0.1:8081/repository/task-checkpoint-raw/learner-example/task-checkpoint/1.0.0/alpha.txt'
curl -fsS -o beta-after.txt \
'http://127.0.0.1:8081/repository/task-checkpoint-raw/learner-example/task-checkpoint/1.0.0/beta.txt'
sha256sum alpha-after.txt beta-after.txt | tee after-sha256.txt
Compare against the original hashes. Also verify the assets in Browse and, if available, Search. If search differs but exact downloads and hashes are correct, do not jump to blob recovery; diagnose the derived index layer.
13. Required evidence packet
| Artifact | Minimum content |
|---|---|
environment.txt |
Version, edition, Java, DB, blob store, disk |
tasks-before.json or screenshot |
Task inventory before changes |
expected-sha256.txt |
Original payload identity |
task-a.log |
Successful H2 backup evidence |
task-b.log |
Temp-file cleanup evidence |
task-failure.log |
AccessDenied live/synthetic failure evidence |
after-sha256.txt |
Post-maintenance artifact identity |
maintenance-calendar.md |
Triggers, windows, conflicts, verification |
task-authz.md |
Least-privilege operator matrix |
runbook.md |
Preflight, run, verify, failure, rollback, cleanup |
14. Checkpoint runbook
Your runbook must explain:
- how to identify the exact task type in the current version;
- how to prove no conflicting maintenance is running;
- how to record task-specific scope and expected mutation;
- which task logs and Nexus logs to preserve;
- how to verify repository content independently;
- when cancellation is unsafe or incomplete;
- why Repair tasks are incident-driven;
- how to detect stale task names after upgrades;
- how to restore a failed task to a known-good schedule;
- how Chapter 20 automation will inspect state before changing it.
15. Cleanup and rollback
- Restore permissions on any lab-only failure directory, then remove it.
- Return lab tasks to Manual/disabled or delete only the lab-created task definitions through supported UI controls.
- Delete
task-checkpoint-rawthrough Nexus. -
Delete
task-checkpoint-blobsonly after Nexus confirms it is unused. - Remove temporary observer/runner users and credentials.
- Keep the evidence packet outside the disposable Nexus data directory.
- Do not delete internal task rows, H2 files, blob files, or logs needed for unresolved incidents.
16. Knowledge check
Why did the checkpoint require artifact hashes before and after maintenance?
Task SUCCESS/FAILURE is scheduler evidence; hashes independently prove that the repository payload bytes remained consistent.
What is the correct interpretation of the AccessDenied backup failure?
The backup output path or process permission is wrong. Fix that narrow boundary; do not elevate Nexus to root or alter repository content.
Why is no Repair task executed in the healthy checkpoint repository?
Current guidance treats Repair tasks as problem-driven. Running one without a symptom would teach unsafe maintenance folklore.
Which task privilege lets an operator start/stop approved tasks without necessarily redefining them?
nx-tasks-run, typically paired with
nx-tasks-read, while create/update/delete remain
separated.
A search rebuild is cancelled halfway. What must the runbook say?
Cancellation does not restore the old index; search may be partial. Preserve evidence and complete a justified rebuild in a safe window.
What does Chapter 20 add to this operating model?
REST API provisioning, pagination, security automation, idempotence, and infrastructure-as-code patterns that inspect current state before mutation.
17. Chapter checkpoint summary
You can now operate Nexus tasks as controlled maintenance jobs rather than mysterious buttons: inventory current task types, separate routine work from repair, schedule against real resource windows, use least privilege, preserve task logs, diagnose failures without escalation, and independently verify repository state. Chapter 20 builds on this discipline by automating repository and security operations through documented REST APIs and idempotent infrastructure-as-code patterns.
Official references and version notes
- Sonatype: Tasks — task states, schedules, logs, current task catalog, and Repair-task cautions.
- Sonatype: Tasks API — list/get/run/stop operations and Pro-only create/update/delete/template endpoints.
- Sonatype: Data Repair Tasks — current plan/execute workflow and recovery-only use.
- Sonatype: Cleanup Policies — cleanup-system tasks, soft deletion, and compact-blob-store reclamation.
-
Sonatype: Privileges
—
nx-tasks-read,nx-tasks-run, create/update/delete task privileges, and least-privilege design. - Sonatype: Nexus Repository 3.95.0–3.95.2 Release Notes — dated feature and maintenance-task changes.
- Sonatype: System Requirements — Java 21, database guidance, storage, and capacity prerequisites.
- Sonatype: Backup and Restore — recovery context for backup tasks.
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0
Send only Ethereum/ERC-20 compatible assets to this
address.