fix(images): change agent user UID from 1000 to 1001#466
fix(images): change agent user UID from 1000 to 1001#466jonwiggins merged 1 commit intojonwiggins:mainfrom
Conversation
|
The UID fix itself is correct and worth merging — However, the branch can't be reviewed in this state. It has 13 commits including copies of #462, #463, #464, three
Could you rebase this onto fresh The drive-bys look potentially useful — please split them into separate PRs so each can be reviewed on its own merits. Happy to fast-track the ones that are obviously correct once they're isolated. |
The K8s securityContext in k8s-workload-service.ts sets runAsUser=1001, but the base image was creating the agent user with UID 1000. This mismatch caused git to fail with permission errors because: - Pod runs as UID 1001 (no matching user in /etc/passwd) - No HOME directory set for UID 1001 - Git falls back to / for .gitconfig - Permission denied: /.gitconfig Fix: - Changed agent user from UID 1000 to UID 1001 - Removed ubuntu user deletion (no longer needed - agent naturally gets 1001) - Simplified Dockerfile by removing unnecessary steps This aligns with commit eeaa4ba which changed K8s to UID 1001. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
73eea9f to
4bb3d4c
Compare
The K8s securityContext in k8s-workload-service.ts sets runAsUser=1001, but the base image was creating the agent user with UID 1000. This mismatch caused git to fail with permission errors because: - Pod runs as UID 1001 (no matching user in /etc/passwd) - No HOME directory set for UID 1001 - Git falls back to / for .gitconfig - Permission denied: /.gitconfig Fix: - Changed agent user from UID 1000 to UID 1001 - Removed ubuntu user deletion (no longer needed - agent naturally gets 1001) - Simplified Dockerfile by removing unnecessary steps This aligns with commit eeaa4ba which changed K8s to UID 1001. Co-authored-by: Ramesh Nethi <r.nethi@gogatewayai.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Problem
StatefulSet pods were crashing with git permission errors:
Root Cause
Mismatch between Dockerfile and K8s securityContext:
images/base.Dockerfile): Created agent user with UID 1000k8s-workload-service.ts): Runs as UID 1001When the pod runs as UID 1001 with no matching user in
/etc/passwd:/for.gitconfig/.gitconfigHistory
0a32e34(Apr 15): Set both Dockerfile and K8s to UID 1000 ✅eeaa4ba(later): Changed K8s spec to UID 1001, but incorrectly assumed the Dockerfile was already 1001 ❌The commit message in
eeaa4bastated:But the image was still at UID 1000, creating the mismatch.
Solution
Changed agent user from UID 1000 to UID 1001 in
base.Dockerfile:Testing
Files Changed
images/base.Dockerfile- Simplified agent user creation to use UID 1001Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com