Create worker data_dir in edge install scripts - #21
Open
ajayshekar-s1 wants to merge 2 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
1. Create worker data_dir (original commit)
edge-config.jsonsetsdata_dirto$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, andinstall.ps1only 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.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.data_diraddition — it preserves theedge_manager_tls_enabledfix from Sync edge install/uninstall scripts from pipeline/edge/configs/ #20 as-is.2. Always set edge_manager_tls_enabled to true (added commit)
wss://|https://→ true, else false) with an unconditionaltruein all three install scripts.INSECURE_PLAINTEXT_OPAMP=true,ws://) will now have its enrollment HTTP client unconditionally attempthttps://, which has no fallback/retry and fails fatally after 10 attempts — unlike the OpAMP client, which has aschemeFlipretry for exactly this case. Confirmed viaedge/internal/utils/enroll.goandedge/internal/supervisor/supervisor.gothat 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 ownvalidatecommand 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/opt/observo/data, reran the worker'svalidatecommand →Validated, exit 0install.ps1changes look right (not live-tested on Windows this session)🤖 Generated with Claude Code