This message was deleted.
# atlantis-community
s
This message was deleted.
p
it should create it in the atlantis home
e
If exec into the container, it is
$HOME == /home/atlantis
Just during debian startup, it's somehow not?
I've forked the repo from current main, and logged
$HOME
how?? 😄 i'm not even sure how something like this can override $HOME
Copy code
❯ k logs -f -n atlantis atlantis-0
No files found in /docker-entrypoint.d/, skipping
{"level":"info","ts":"2024-02-15T18:49:57.407Z","caller":"server/server.go:306","msg":"found home dir%!(EXTRA string=path, string=/run/sshd)","json":{}}
{"level":"info","ts":"2024-02-15T18:49:57.408Z","caller":"server/server.go:309","msg":"HOME env var value%!(EXTRA string=HOME, string=/run/sshd)","json":{}}
{"level":"info","ts":"2024-02-15T18:49:57.451Z","caller":"server/server.go:445","msg":"Utilizing BoltDB","json":{}}
Error: initializing server: could not write credentials: Writing ~/.git-credentials file: writing generated .git-credentials file with user, token and hostname to /run/sshd/.git-credentials: open /run/sshd/.git-credentials: no such file or directory
p
that is very extrange
e
Alright, we've found the issue. • the "atlantis" user in the alpine image is apparently created as a system user, so it ends up with uid
100
, instead of
1000
◦ personal opinion: this feels wrong, since user atlantis also has a home directory and is very obviously not a system user • the "atlantis" user in the debian image is a normal user, and has uid
1000
as usual • because the alpine image with the uid
100
is the default for atlantis, the helm chart also has
securityContext: runAsUser: 100
as the default • and if you use the debian image, uid
100
just so happens to be the user "sshd"...:
Copy code
atlantis@f2045b0018fb:/$ cat /etc/passwd | tail -n 3
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
sshd:x:100:65534::/run/sshd:/usr/sbin/nologin
atlantis:x:1000:1000::/home/atlantis:/bin/bash
• and you end up with
$HOME=/run/sshd
by chance
p
interesting
we can’t change the behaviour for alpine, a lot of people use it so we need to keep that
we could add to the entrypoint a detect for
id atlantis
to set the home
j
That is a good find!
p
there is a legacy component there….
we could adjust alpine to be a system user and change to 1000 uid but it could cost people some grief
h
this is basically a duplicate of the bug that i opened https://github.com/terraform-aws-modules/terraform-aws-atlantis/issues/382