runatlantis / helm-charts

Atlantis Helm Chart
Apache License 2.0
109 stars 174 forks source link

unable to create dir "/atlantis-data/bin": mkdir /atlantis-data/bin: permission denied #149

Closed nokernel closed 1 day ago

nokernel commented 2 years ago

Using atlantis helm chart version 4.0.1.

Getting this when scaling up the statefulset replicas from 1 to 2, and also when doing a fresh install on a new namespace.

akhan23wgu commented 1 year ago

Not sure what's changed in the new helm chart exactly, but if you have a PVC configured for your namespace then it will use that by default. There's no way to configure the path, so it'll use the root path (and I don't see a way to change this, which would be nice).

From there, you'll need to set the proper security context (example below). I was able to get past the error, but now I am getting Error: initializing server: initializing terraform: writing generated .terraformrc file with TFE token to /.terraformrc: open /.terraformrc: permission denied, even though folders were created on pod creation and my user (99) has full permissions to write to the designated directory.

securityContext:
  fsGroup: 100
  runAsUser: 99
  fsGroupChangePolicy: "OnRootMismatch"
  priorityClassName: ""

Update:

Just upgrade to chart version v0.20.1. I was able to get rid of that error by using the deprecated option dataStorage: 5Gi.

nitrocode commented 1 year ago

That's bizarre. The volume claim template looks exactly the same.

https://github.com/runatlantis/helm-charts/blob/bc9db325f8f023a282fabe03de6a5fb9b969ac7a/charts/atlantis/templates/statefulset.yaml#L520-L548

Values

https://github.com/runatlantis/helm-charts/blob/bc9db325f8f023a282fabe03de6a5fb9b969ac7a/charts/atlantis/values.yaml#L271-L283

Is this still an issue with the latest helm chart?

Could you show the helm template command diff between supplying the deprecated input and omitting it? Perhaps that will bubble up the issue here.

particledecay commented 1 year ago

I'm experiencing this same error. I'm installing into minikube. I tried chart version 4.0.0 and 4.12.2. Same error both times.

The only overrides I have are as follows:

orgAllowlist: github.com/particledecay/*
logLevel: debug
github:
  user: particledecay
vcsSecretName: github
awsSecretName: aws-credentials
repoConfig: |
  ---
  repos:
  - id: /.*/
    workflow: terragrunt
  workflows:
    terragrunt:
      plan:
        steps:
          - env:
              name: TERRAGRUNT_TFPATH
              command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
          - run: terragrunt run-all init -reconfigure
          - run: terragrunt plan -input=false -out=$PLANFILE
          - run: terragrunt show -json $PLANFILE > $SHOWFILE
      apply:
        steps:
          - env:
              name: TERRAGRUNT_TFPATH
              command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
          - run: terragrunt run-all init -reconfigure
          - run: terragrunt apply -input=false $PLANFILE
GMartinez-Sisti commented 2 months ago

Is this still happening?

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month.'