Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic encountered in the version 0.24 #3671

Closed
paduartesre opened this issue Aug 14, 2023 · 2 comments
Closed

Panic encountered in the version 0.24 #3671

paduartesre opened this issue Aug 14, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@paduartesre
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

We are running Atlantis on the GKE cluster, connecting to GitLab Enterprise version 16.2.3. The failure of the 'plan' and 'apply' commands in the PRs opened. At the beginning of the deployment, 'plan' was still working, but stopped working after trying the 'apply' command.

Relevant stack in the Gitlab

image

Reference link based in the error:

if resp.NextPage == 0 {

return d.clients[repo.VCSHost.Type].PullIsApproved(repo, pull)

// We want to continue because not all apply's will need this status,

"github.com/runatlantis/atlantis/server/metrics"

Reproduction Steps

See above

Logs

See above

Environment details

  • Atlantis version: 0.24.4
  • Deployment method: helm chart with ArgoCD Application and overrides in the file values.yaml with deploy GKE
  • If not running the latest Atlantis version have you tried to reproduce this issue on the latest version: In version 0.25.0, this problem is not reproduced. In other words, the problem in question is not occurring for the time being.

Atlantis server-side config file:

---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  annotations:
    argocd.argoproj.io/sync-wave: "0"
  name: atlantis
  namespace: contoso-system
spec:
  project: services
  destination:
    namespace: services
    server: https://kubernetes.default.svc
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
  source:
    repoURL: https://runatlantis.github.io/helm-charts
    chart: atlantis
    targetRevision: 4.15.0
    helm:
      valueFiles:
        - values.yaml
      values: |
        fullnameOverride: atlantis
        image:
          repository: ghcr.io/runatlantis/atlantis
          pullPolicy: IfNotPresent

        ######## Basic configurations ########

        orgWhitelist: 'gitlab.contoso.svc/*'

        logLevel: "debug"

        gitlab:
          user: atlantis
          hostname: 'gitlab.contoso.svc'
          token: <REDACTED>
          secret: <REDACTED>

        dataStorage: 8Gi

        environment:
          ATLANTIS_CHECKOUT_STRATEGY: merge
          ATLANTIS_DISABLE_AUTOPLAN: true
          ATLANTIS_AUTOMERGE: true
          ATLANTIS_ENABLE_POLICY_CHECKS: true

        environmentRaw:
          - name: GOOGLE_APPLICATION_CREDENTIALS
            value: /home/atlantis/.gcs/gcs-credentials.json

        environmentSecrets:
          - name: ATLANTIS_GITLAB_TOKEN
            secretKeyRef:
              name: atlantis-gitlab-token
              key: gitlab-token

        ######## Configurations Atlantis - Workflows ########

        ## Use Server Side Repo Config,
        ## ref: https://www.runatlantis.io/docs/server-side-repo-config.html
        ## Example default configuration

        repoConfig: |
          ---
          repos:
          - id: 'gitlab.contoso.svc/svc/cloud/applications/*/*/environments/development'
            workflow: environments
            apply_requirements: [mergeable]
            allowed_overrides: [workflow, delete_source_branch_on_merge]
            allow_custom_workflows: true

          - id: 'gitlab.contoso.svc/svc/cloud/applications/*/*/environments/staging'
            workflow: environments
            apply_requirements: [approved, mergeable]
            allowed_overrides: [apply_requirements, workflow, delete_source_branch_on_merge]
            allow_custom_workflows: true

          - id: 'gitlab.contoso.svc/svc/cloud/applications/*/*/environments/production'
            workflow: environments
            apply_requirements: [approved, mergeable]
            allowed_overrides: [apply_requirements, workflow, delete_source_branch_on_merge]
            allow_custom_workflows: true

          - id: 'gitlab.contoso.svc/svc/cloud/applications/*/*/environments/'
            workflow: environments
            apply_requirements: [approved, mergeable]
            allowed_overrides: [workflow, delete_source_branch_on_merge]
            allow_custom_workflows: true
            
          - id: 'gitlab.contoso.svc/svc/cloud/terraform-modules/labels/'
            workflow: environments
            apply_requirements: [approved, mergeable]
            allowed_overrides: [apply_requirements, workflow, delete_source_branch_on_merge]
            allow_custom_workflows: true

          workflows:
            environments:
              plan:
                steps: [init, plan]
              apply:
                steps: [apply]

        # allowForkPRs enables atlantis to run on a fork Pull Requests
        allowForkPRs: false

        # allowDraftPRs enables atlantis to run on a draft Pull Requests
        allowDraftPRs: true

        # hidePrevPlanComments enables atlantis to hide previous plan comments
        hidePrevPlanComments: false

        # disableApply disables running `atlantis apply` regardless of which flags are sent with it
        disableApply: false

        # disableApplyAll disables running `atlantis apply` without any flags
        disableApplyAll: false

        # Use Diff Markdown Format for color coding diffs
        #enableDiffMarkdownFormat: true

        gitconfig: |
          [url "https://oauth2:<REDACTED>@gitlab.contoso.svc"]
            instead = git::ssh://[email protected]

        ######## Other configurations ########

        googleServiceAccountSecrets:
          - name: gcs-credentials
            secretName: atlantis-gitlab-token
            keyName: gcs-credentials

        extraVolumes:
          - name: ssh-key
            secret:
              secretName: atlantis-gitlab-token
              defaultMode: 0600
              items:
              - key: privkey
                path: ssh-private-key
          - name: atlantis-gcs-credentials
            secret:
              secretName: atlantis-gitlab-token
              items:
              - key: gcs-credentials
                path: gcs-credentials.json
          - name: ssh-config
            emptyDir: {}
          - name: atlantis-home
            emptyDir: {}

        extraVolumeMounts:
          - name: ssh-key
            mountPath: /home/atlantis/.ssh/keys
            readOnly: true
          - name: atlantis-gcs-credentials
            mountPath: /home/atlantis/.gcs
            readOnly: true
          - name: ssh-config
            mountPath: /home/atlantis/.ssh
          - name: atlantis-home
            mountPath: /home/atlantis/

        initContainers:
          - name: install-gcloud
            image: google/cloud-sdk:latest
            command: ["/bin/sh", "-c"]
            args:
              - |
                rm -Rf /home/atlantis/google-cloud-sdk
                export CLOUDSDK_CONFIG=/home/atlantis/.config/gcloud
                curl https://sdk.cloud.google.com | bash -s -- --disable-prompts --install-dir=/home/atlantis
            volumeMounts:
              - name: atlantis-home
                mountPath: /home/atlantis/
          - name: ssh-config
            image: alpine/git
            securityContext:
              runAsUser: 0
            volumeMounts:
            - name: ssh-key
              mountPath: /home/atlantis/.ssh/keys
              readOnly: true
            - name: ssh-config
              mountPath: /home/atlantis/.ssh/
              readOnly: false
            - name: atlantis-home
              mountPath: /home/atlantis/
            command:
              - sh
              - -c
              - |
                touch /home/atlantis/.ssh/known_hosts

        service:
          type: ClusterIP
          annotations: {}
          port: 80

        ingress:
          enabled: true
          path: /
          pathType: ImplementationSpecific
          hostname: atlantis.contoso.svc
          ingressClassName: traefik-atlantis
          annotations: {}
          tls:
            - hosts:
                - atlantis.contoso.svc
          extraTls:
            - hosts:
                - atlantis.contoso.svc

        livenessProbe:
          enabled: true

        readinessProbe:
          enabled: true

        resources:
          requests:
            memory: 1Gi
            cpu: 100m
          limits:
            memory: 2Gi
            cpu: 300m

        replicaCount: 1

        statefulSet:
          annotations: {}
          labels: {}
          securityContext:
            fsGroup: 1000
            runAsUser: 100
            fsGroupChangePolicy: "OnRootMismatch"
          priorityClassName: ""
          updateStrategy: {}

        podTemplate:
          annotations: {}

        nodeSelector: {}

        tolerations: []

        affinity: {}

        containerSecurityContext:
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true

Repo atlantis.yaml file:

version: 3
automerge: true
delete_source_branch_on_merge: false
parallel_plan: true
parallel_apply: true
projects:
- name: vila-do-chaves
  branch: /.*/
  dir: .
  workflow: environments
repos:
    - id: /.*/
workflows:
  environments:
    plan:
      steps: [init, plan]
    apply:
      steps: [apply]

Cloud: GCP

  • GKE v1.23.17-gke.5600
  • OS linux (amd64)
  • OS Image Container-Optimized OS from Google
  • Kernel version 5.10.177+
  • Container runtime containerd://1.5.18
  • Kubelet version v1.23.17-gke.5600

--->

Additional Context

@paduartesre paduartesre added the bug Something isn't working label Aug 14, 2023
@jamengual
Copy link
Contributor

jamengual commented Aug 14, 2023 via email

@paduartesre
Copy link
Author

Thanks for your confirmation. Everything is working fine in the new version 0.25.0.
I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants