fix: lib/env.sh crashes with USER unbound variable in agent container #229
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#229
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
lib/env.shline 127 crashes withUSER: unbound variablewhen$USERis not set in the environment:This affects:
USER=agent, but the variable is consumed before cron env is fully loaded in some code paths)docker exec -u agentinvocation (Docker exec does not setUSER)Root cause
The container does not export
USERin the entrypoint. The crontab header setsUSER=agentbut that only applies to cron-spawned processes, not todocker execor other entry points into the container.Fix
Either:
export USER=agenttodocker/agents/entrypoint.sh(before cron starts), ORlib/env.sh:${USER:-agent}Option 1 is better since
USERmay be referenced elsewhere too.Files
lib/env.sh— line 127,OPS_REPO_ROOTdefaultdocker/agents/entrypoint.sh— missingUSERexport