Chapter 02Lesson 04~120 minutes

Nexus Repository Editions, Deployment Models, Architecture, Installation, and Java Runtime Planning: Diagnostics, Failure Modes, Security, and Performance

Diagnose runtime, process, filesystem, exposure, resource, storage, authorization and performance failures with evidence-first, least-destructive corrections.

DiagnosticsSecurityPerformanceFailure modesLeast destructive

Learning objectives

  • Use one evidence-preserving diagnostic sequence across installation, routing, authorization, storage and runtime failures.
  • Recognize unsupported Java, root execution, file-handle exhaustion, disk pressure, and path confusion before changing repository state.
  • Repair a deliberately broken loopback binding without deleting caches, databases, or blobs.
  • Separate client cache, Nexus proxy cache, upstream latency, database latency, blob IO, JVM memory, task load and network latency.
  • Classify credential, TLS, repository, task, migration, backup and exposure changes as security-sensitive operations.

Version checkpoint — reviewed 2026-08-26. Sonatype's official download page currently offers Nexus Repository 3.94.1 (build line 3.94.1-06), while Sonatype also publishes an official 3.95.0 release-notes page dated August 5, 2026. Because those primary pages are temporarily out of sync, the executable labs in this chapter pin the currently downloadable 3.94.1-06 archive. Re-check the download page, version-status page, release notes, and known issues before using a newer build. Java 21 is required for current H2/PostgreSQL releases; current official packages include a supported runtime.

1. The diagnostic sequence

Evidence-first Nexus diagnostics
flowchart TD
E[Preserve concise evidence] --> V[Version edition runtime]
V --> C[Client URL and auth]
C --> R[Repository type routing group]
R --> A[Authorization]
A --> M[Component asset metadata]
M --> P[Proxy cache upstream]
P --> S[Database blob disk]
S --> L[Logs tasks metrics]
L --> F[Least destructive correction]
F --> Q[Controlled verification request]

This order prevents “fixes” from destroying the evidence that identifies the layer. A 401 is not a reason to rebuild metadata. A 404 caused by a misspelled repository is not a reason to clear blobs. A startup failure caused by Java compatibility is not a reason to delete the database. Preserve the first failure and narrow the causal layer.

2. Unsupported Java and unsafe process identity

Current H2/PostgreSQL Nexus 3.87+ requires Java 21. If an operator overrides the bundled runtime with Java 17 or Java 25, treat the runtime mismatch as the primary suspect. Capture the Nexus version, configured APP_JAVA_HOME/app_java_home, Java version, and startup log before changing anything.

# Read-only evidence examples
ps -eo user,pid,args | grep '[n]exus' || true
grep -E 'java|JVM|version|UnsupportedClassVersion|Started|ERROR' "$NX_DATA/log/nexus.log" | tail -120
ulimit -n

If the process owner is root, correct the service design instead of accepting “it works.” Sonatype explicitly says not to run Nexus as root and recommends a dedicated OS account. Stop the disposable instance, correct ownership/service identity, and start again. Do not recursively chmod world-writable as a shortcut.

3. File descriptors, disk, memory and IO

File-descriptor exhaustion can produce seemingly unrelated repository and network errors. Sonatype warns that running out of file descriptors can cause data loss. Record the process limit and open-file pressure; increase the dedicated service user's limit through the operating system/service configuration, then restart in a controlled window.

Disk pressure must be decomposed by path. Application binaries, data/log/temp, database state, and blob stores can grow differently. Deleting files under db or blobs to make df green is not troubleshooting—it risks corruption. Use Nexus cleanup/storage mechanisms and a capacity plan later in the course.

Memory diagnosis must distinguish JVM heap from direct/native memory and OS cache. Increasing -Xmx blindly can starve the operating system and make IO worse. Record heap/direct-memory configuration, host RAM, GC/runtime symptoms and workload before tuning.

4. Install directory and data directory failure patterns

Mistake Observed symptom Preserve Least destructive response
Delete old install dir while data path points inside it Startup/path failures after “upgrade” vmoptions, effective karaf.data, directory listing Restore expected path or follow supported upgrade layout; do not invent new db/blob contents
Copy only sonatype-work/db to new host Repositories/users may not align with blobs database + blob + config inventory Stop and use supported backup/migration/restore workflow
Move data dir while process is running Partial/inconsistent copy timestamps, process state, logs Abort mutation, preserve source, plan stopped consistent copy/migration
Edit nexus-default.properties Change disappears on install replacement install defaults + data-dir overrides Move customization into $data-dir/etc/nexus.properties

5. Intentionally broken example: accidental network exposure

Use only the disposable Chapter 02 instance. First preserve the healthy loopback listener. Then intentionally change application-host to 0.0.0.0, restart, observe the listener, and repair it. Do this only on a host whose firewall/private environment prevents external access during the brief experiment. If that condition is not true, use the supplied observation as a simulation and do not create exposure.

# BEFORE: preserve healthy config and listener.
cp "$NX_DATA/etc/nexus.properties" "$HOME/nexus-ch02-lab/evidence/20-nexus-properties-before.txt"
ss -ltn 2>/dev/null | grep ':8081' | tee "$HOME/nexus-ch02-lab/evidence/21-listener-before.txt" || true

# SECURITY-SENSITIVE / DISPOSABLE ONLY:
# Stop Nexus first. Then edit only this known lab property:
# application-host=0.0.0.0
# Restart and inspect; do NOT leave the instance this way.

ss -ltn 2>/dev/null | grep ':8081' | tee "$HOME/nexus-ch02-lab/evidence/22-listener-broken.txt" || true

# Repair: stop Nexus, restore loopback, then restart.
sed -i 's/^application-host=.*/application-host=127.0.0.1/' "$NX_DATA/etc/nexus.properties"
grep '^application-host=' "$NX_DATA/etc/nexus.properties"

Interpretation: the application itself may still return HTTP 200, so application readiness alone does not detect an over-broad network bind. The listener evidence proves the exposure layer. The repair changes only the connector binding; no repository, cache, database or blob deletion is warranted.

6. Initial admin endpoint on an untrusted network

Bootstrap is unusually sensitive because the generated initial admin password exists in the data directory and the account has broad authority. If you discover a fresh instance listening publicly, preserve minimal listener/version evidence, block exposure at the network/listener layer, rotate/bootstrap credentials in a trusted path, and review logs/audit evidence. Do not continue onboarding over an untrusted public HTTP connection.

7. Operations that deserve a change record

Credential/token changes, realms, roles/content selectors, TLS/reverse proxy, remote-repository credentials, cleanup policies, scheduled tasks, migration/upgrade mode, backups, database/blob configuration and public exposure all cross trust or persistence boundaries. For each: record before state, exact scope, rollback/restore point, expected state change, operator identity, and post-change verification.

8. Performance: identify the waiting layer

Layer Symptom clues Useful evidence Wrong shortcut
Client cache Only one workstation behaves differently isolated client home, cache hit/miss, request trace delete Nexus blobs
Nexus proxy cache First fetch slow, warm fetch faster; remote-dependent behavior request/log evidence, cache state, upstream health clear every cache
Upstream/network Proxy misses slow/fail; hosted local content healthy DNS/TLS/connect timing, remote status raise JVM heap
Database metadata/search/security operations slow broadly DB latency/connections, Nexus metrics/logs move blob files
Blob IO large asset reads/writes slow disk/object-store latency, throughput, space rebuild search index
JVM memory GC/direct-memory pressure, allocation symptoms heap/direct config, GC/JVM logs, host memory set Xmx to all RAM
Scheduled tasks periodic IO/CPU spikes task history, tasks.log, timing correlation disable maintenance permanently

9. Controlled verification after correction

curl -sS -o /dev/null -w 'read=%{http_code}\n'   http://127.0.0.1:8081/service/rest/v1/status
curl -sS -o /dev/null -w 'writable=%{http_code}\n'   http://127.0.0.1:8081/service/rest/v1/status/writable
ss -ltn 2>/dev/null | grep ':8081' || true

Expected result: 200 readiness codes and a loopback-only listener. Then verify the original client action that failed. A diagnostic is complete only when the controlled request succeeds and the corrected state matches the intended security/architecture boundary.

Knowledge check

A startup error begins immediately after APP_JAVA_HOME is pointed at Java 17. Should you delete H2 to retry?

Nexus /status returns 200 but ss shows 0.0.0.0:8081. Is the lab safe?

Disk is 95% full. Why not delete old files directly under the blob directory?

Only one Maven developer sees a stale dependency while other clients are current. Which cache should you inspect first?

A scheduled task overlaps peak downloads and blob latency rises. Is increasing heap the first correction?

10. Summary

Reliable Nexus troubleshooting is a layer-by-layer investigation. Preserve the first failure, identify version/runtime/client/routing/auth/metadata/cache/storage/log evidence, correct the smallest causal state, and prove the original request plus the intended security boundary afterward.

Next lesson

Checkpoint Lab — Nexus Repository Editions, Deployment Models, Architecture, Installation, and Java Runtime Planning

Run the complete deployment checkpoint: create, bootstrap, restart, prove persistence, collect sanitized evidence, and safely remove the disposable instance.

Official references and version notes

Version-sensitive statements were rechecked against Sonatype primary documentation on 2026-08-26. The mandatory path remains self-hosted, Community/free-compatible, and disposable; production credentials, production repositories, and paid-only capabilities are outside the lab boundary.

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.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0 Send only Ethereum/ERC-20 compatible assets to this address.