Skip to content

Create worker data_dir in edge install scripts - #21

Open
ajayshekar-s1 wants to merge 2 commits into
mainfrom
fix-edge-worker-data-dir-missing
Open

Create worker data_dir in edge install scripts#21
ajayshekar-s1 wants to merge 2 commits into
mainfrom
fix-edge-worker-data-dir-missing

Conversation

@ajayshekar-s1

@ajayshekar-s1 ajayshekar-s1 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

1. Create worker data_dir (original commit)

  • Every edge-config.json sets data_dir to $ROOT_DIR/data, and the Vector-based worker's config validation hard-fails with exit 78 (data_dir "..." does not exist) if that directory isn't already present — the worker does not create it itself.
  • install.sh, install_darwin.sh, and install.ps1 only ever created the root, logs, and update directories, so every fresh install left the worker permanently unable to start, independent of any config content/entitlement issues.
  • Adds DATA_DIR/$DataDir (overridable via env var, consistent with the other paths) and creates/chowns/chmods it alongside the existing directories in all three installers.
  • This diff was intentionally scoped to only the data_dir addition — it preserves the edge_manager_tls_enabled fix from Sync edge install/uninstall scripts from pipeline/edge/configs/ #20 as-is.

2. Always set edge_manager_tls_enabled to true (added commit)

  • Replaces the URL-scheme-based derivation (wss://|https:// → true, else false) with an unconditional true in all three install scripts.
  • Every supported deployment terminates TLS at the edge-manager ingress, so the derivation was redundant in practice.
  • Real behavior change, explicitly requested: a plaintext-only edge-manager deployment (INSECURE_PLAINTEXT_OPAMP=true, ws://) will now have its enrollment HTTP client unconditionally attempt https://, which has no fallback/retry and fails fatally after 10 attempts — unlike the OpAMP client, which has a schemeFlip retry for exactly this case. Confirmed via edge/internal/utils/enroll.go and edge/internal/supervisor/supervisor.go that no other consumer of this flag is affected.

How the data_dir issue was found

Live end-to-end testing on a fresh Linux ARM64 VM: agent enrolled successfully, a real (non-empty) config was delivered by edge-manager, but the worker never started — error while validating Observo Edge Worker config err: exit status 78, stderr: (empty stderr in the log, since it went to stdout). Running the worker's own validate command manually on the box surfaced the real message: data_dir "/opt/observo/data" does not exist. Creating the directory unblocked it immediately — worker validated cleanly and started, confirmed via process + healthy logs + real file-tailing activity.

Test plan

  • bash -n install.sh / bash -n install_darwin.sh — syntax OK
  • Verified live on VM: manually created /opt/observo/data, reran the worker's validate command → Validated, exit 0
  • Restarted the agent service on the VM → worker started and stayed healthy
  • Reviewer: confirm install.ps1 changes look right (not live-tested on Windows this session)

🤖 Generated with Claude Code

ajayshek and others added 2 commits September 1, 2026 13:44
Every edge-config.json sets data_dir to $ROOT_DIR/data, and the
Vector-based worker's config validation hard-fails with exit 78
("data_dir ... does not exist") if that directory isn't already
present -- the worker does not create it itself. install.sh,
install_darwin.sh, and install.ps1 only ever created the root, logs,
and update directories, so every fresh install left the worker
permanently unable to start. Add data_dir creation/ownership
alongside the existing directories in all three installers.

Root-caused and verified live on a fresh Linux ARM64 test VM: agent
enrolled and received a real config, but the worker never started
(exit status 78, empty stderr). Running the worker's own validate
command surfaced the actual message ("data_dir ... does not exist");
creating the directory manually unblocked it immediately.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replaces the URL-scheme-based derivation (wss://|https:// -> true,
else false) with an unconditional true in all three install scripts.

Every supported deployment terminates TLS at the edge-manager
ingress, so the derivation was redundant in practice. Note this is a
real behavior change for a plaintext-only edge-manager deployment
(INSECURE_PLAINTEXT_OPAMP=true, ws://): the enrollment HTTP client
will now unconditionally attempt https://, which has no fallback and
fails fatally after 10 attempts (unlike the OpAMP client, which has a
schemeFlip retry for exactly this case).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants