jenkins-x / lighthouse

Apache License 2.0
185 stars 115 forks source link

Errors in the LightHouse and Tide Pods when creating a Pull/Merge Request on Gitlab. Serverless Jenkins X Pipeline for Preview Environment is not created. #223

Closed kdevu closed 4 years ago

kdevu commented 5 years ago

Hi,

Apologies if this isn't the right repository to create this issue.

I've been using Serverless Jenkins X with Gitlab, as a result I've also been using LightHouse and Tide. I've tried creating a pipeline by creating a Pull/Merge Requests, but after following these steps

  1. Import my project with jx import
  2. Create a new branch (using the GitLab GUI)
  3. Make a change
  4. Create a merge request, to merge the new branch into master (using the Gitlab GUI)

I run into the following errors in the LightHouse and Tide Pods.

Errors in the LightHouse Pod

The errors in question:

The logs are below, all the errors are in the bottom half

$ kubectl logs LIGHTHOUSE-POD -n jx
{"level":"info","msg":"about to parse webhook","time":"2019-10-11T15:39:24Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","level":"info","msg":"invoking Push handler","time":"2019-10-11T15:39:24Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","head":"","level":"info","msg":"Push event.","org":"USER","ref":"refs/heads/PR-3","repo":"serviceA","time":"2019-10-11T15:39:24Z"}
{"level":"info","msg":"found plugins approve, assign, blunderbuss, help, hold, lgtm, lifecycle, override, size, trigger, wip, heart, cat, dog, pony\n","time":"2019-10-11T15:39:24Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","count":"1","head":"","level":"info","msg":"number of push handlers","org":"USER","ref":"refs/heads/PR-3","repo":"serviceA","time":"2019-10-11T15:39:24Z"}
{"level":"info","msg":"about to parse webhook","time":"2019-10-11T15:39:40Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","level":"info","msg":"invoking Push handler","time":"2019-10-11T15:39:40Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","head":"","level":"info","msg":"Push event.","org":"USER","ref":"refs/heads/PR-3","repo":"serviceA","time":"2019-10-11T15:39:40Z"}
{"level":"info","msg":"found plugins approve, assign, blunderbuss, help, hold, lgtm, lifecycle, override, size, trigger, wip, heart, cat, dog, pony\n","time":"2019-10-11T15:39:40Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","count":"1","head":"","level":"info","msg":"number of push handlers","org":"USER","ref":"refs/heads/PR-3","repo":"serviceA","time":"2019-10-11T15:39:40Z"}

{"level":"info","msg":"about to parse webhook","time":"2019-10-11T15:40:31Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","level":"info","msg":"invoking PR handler","time":"2019-10-11T15:40:31Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","author":"USER","level":"info","msg":"Pull request opened.","org":"USER","pr":5,"repo":"serviceA","time":"2019-10-11T15:40:31Z","url":"https://GITLAB_URL/USER/serviceA/merge_requests/5"}
{"level":"info","msg":"found plugins approve, assign, blunderbuss, help, hold, lgtm, lifecycle, override, size, trigger, wip, heart, cat, dog, pony\n","time":"2019-10-11T15:40:31Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","author":"USER","count":"5","level":"info","msg":"number of PR handlers","org":"USER","pr":5,"repo":"serviceA","time":"2019-10-11T15:40:31Z","url":"https://GITLAB_URL/USER/serviceA/merge_requests/5"}
{"level":"info","msg":"found plugins approve, assign, blunderbuss, help, hold, lgtm, lifecycle, override, size, trigger, wip, heart, cat, dog, pony\n","time":"2019-10-11T15:40:31Z"}
{"client":"git","level":"info","msg":"Cloning USER/serviceA for the first time.","time":"2019-10-11T15:40:46Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","author":"USER","error":"could not get .generated_files: 404 Commit Not Found","level":"error","msg":"Error handling PullRequestEvent.","org":"USER","plugin":"size","pr":5,"repo":"serviceA","time":"2019-10-11T15:40:48Z","url":"https://GITLAB_URL/USER/serviceA/merge_requests/5"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","author":"USER","error":"could not check membership: error in IsCollaborator: ","level":"error","msg":"Error handling PullRequestEvent.","org":"USER","plugin":"trigger","pr":5,"repo":"serviceA","time":"2019-10-11T15:40:49Z","url":"https://GITLAB_URL/USER/serviceA/merge_requests/5"}
{"client":"git","level":"info","msg":"Checkout master.","time":"2019-10-11T15:42:12Z"}
{"base":"master","client":"repoowners","error":"error unmarshaling JSON: while decoding JSON: json: cannot unmarshal array into Go struct field .aliases of type map[string][]string","level":"error","msg":"Failed to unmarshal aliases from \"/tmp/git895832845/OWNERS_ALIASES\". Using empty alias map.","org":"USER","repo":"serviceA","time":"2019-10-11T15:42:12Z"}
{"base":"master","client":"repoowners","error":"","level":"error","msg":"Failed to list collaborators while loading RepoOwners. Skipping collaborator filtering.","org":"USER","repo":"serviceA","time":"2019-10-11T15:42:12Z"}
{"Branch":"master","Clone":"https://GITLAB_URL/USER/serviceA.git","CloneSSH":"git@GITLAB_URL:USER/serviceA.git","ID":"0","Link":"https://GITLAB_URL/USER/serviceA","Name":"serviceA","Namespace":"USER","author":"USER","error":"failed to get issue comments for USER/serviceA#5: 404 Not found","level":"error","msg":"Error handling PullRequestEvent.","org":"USER","plugin":"approve","pr":5,"repo":"serviceA","time":"2019-10-11T15:42:13Z","url":"https://GITLAB_URL/USER/serviceA/merge_requests/5"}

Errors in the Tide Pod

The error in question: no GraphQL graphql supported for git provider gitlab. The logs are below.

$ kubectl logs TIDE-POD -n jx

{"component":"tide","file":"/go/src/github.com/jenkins-x/lighthouse/pkg/prow/gitprovider/issues.go:48","func":"github.com/jenkins-x/lighthouse/pkg/prow/gitprovider.(*Client).Query","level":"warning","msg":"no GraphQL graphql supported for git provider gitlab","time":"2019-10-11T16:15:06Z"}
{"component":"tide","controller":"sync","duration":"340.393µs","file":"/go/src/github.com/jenkins-x/lighthouse/pkg/tide/tide.go:282","func":"github.com/jenkins-x/lighthouse/pkg/tide.(*Controller).Sync.func1","level":"info","msg":"Synced","time":"2019-10-11T16:15:06Z"}
{"component":"tide","file":"/go/src/github.com/jenkins-x/lighthouse/pkg/prow/gitprovider/issues.go:48","func":"github.com/jenkins-x/lighthouse/pkg/prow/gitprovider.(*Client).Query","level":"warning","msg":"no GraphQL graphql supported for git provider gitlab","time":"2019-10-11T16:15:06Z"}
{"component":"tide","controller":"status-update","duration":"160.365µs","file":"/go/src/github.com/jenkins-x/lighthouse/pkg/tide/status.go:452","func":"github.com/jenkins-x/lighthouse/pkg/tide.(*statusController).sync.func1","level":"info","msg":"Statuses synced.","time":"2019-10-11T16:15:06Z"}

Expected Behaviour

I expect a pipeline to be created that will deploy the service to a Preview environment.

My Configurations

These are my configurations (the relevant files), should I expect Pull Requests on Gitlab to create a pipeline and deploy to a Preview environment with these configurations?

jenkins-x-boot-config/jx-requirements.yml file

# jx-requirements.yml
autoUpdate:
  enabled: false
  schedule: ""
cluster:
  clusterName: test-cluster
  environmentGitOwner: owner
  gitKind: gitlab
  gitName: test
  gitServer: GITLAB_URL
  namespace: jx
  project: serverless-jx-tests
  provider: gke
  zone: europe-west2-b
environments:
- ingress:
    domain: ""
    externalDNS: false
    namespaceSubDomain: ""
    tls:
      email: ""
      enabled: false
      production: false
  key: dev
- ingress:
    domain: ""
    externalDNS: false
    namespaceSubDomain: ""
    tls:
      email: ""
      enabled: false
      production: false
  key: staging
- ingress:
    domain: ""
    externalDNS: false
    namespaceSubDomain: ""
    tls:
      email: ""
      enabled: false
      production: false
  key: production
gitops: true
ingress:
  cloud_dns_secret_name: external-dns-gcp-sa
  domain: DOMAIN
  externalDNS: true
  namespaceSubDomain: -jx.
  tls:
    email: ""
    enabled: false
    production: false
kaniko: true
secretStorage: vault
storage:
  backup:
    enabled: false
    url: ""
  logs:
    enabled: false
    url: ""
  reports:
    enabled: false
    url: ""
  repository:
    enabled: false
    url: ""
vault: {}
velero: {}
versionStream:
  ref: master
  url: https://github.com/jenkins-x/jenkins-x-versions.git
webhook: lighthouse

MyProject/jenkins-x.yml file

# jenkins-x.yml

pipelineConfig:
  agent:
    image: nodejs
    label: jenkins-nodejs
  pipelines:
    pullRequest:
      pipeline:
        agent:
          image: nodejs
        stages:
        - name: build-project
          steps: 
          - command: mkdir temp -p
            name: make-temp-dir
            dir: /workspace
          - command: curl -Lo hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.32/hugo_0.32_Linux-64bit.tar.gz
            dir: /workspace/temp
            name: curl-hugo-release
          - command: tar xvzf hugo.tar.gz
            dir: /workspace/temp
            name: unzip-hugo-tar-gz
          - command: ./hugo version
            dir: /workspace/temp
            name: output-hugo-version                
          - command: ./hugo -s /workspace/source
            name: generate-website
            dir: /workspace/temp
        - name: everything-else
          steps:
          - args:
            - --cache=true
            - --cache-dir=/workspace
            - --context=/workspace/source
            - --dockerfile=/workspace/source/Dockerfile
            - --destination=DOCKER_REGISTRY/REPLACE_ME_DOCKER_REGISTRY_ORG/serviceA:${inputs.params.version}
            - --cache-repo=DOCKER_REGISTRY/REPLACE_ME_DOCKER_REGISTRY_ORG/cache
            command: /kaniko/executor
            dir: /workspace/source
            image: gcr.io/kaniko-project/executor:9912ccbf8d22bbafbf971124600fbb0b13b9cbd6
            name: build-container-build
          - command: jx step post build --image DOCKER_REGISTRY/REPLACE_ME_DOCKER_REGISTRY_ORG/serviceA:${VERSION}
            name: postbuild-post-build
          - command: make preview
            dir: /workspace/source/charts/preview
            name: promote-make-preview
          - command: jx preview --app $APP_NAME --dir ../..
            dir: /workspace/source/charts/preview
            name: promote-jx-preview
    release:
      pipeline:
        agent: 
          image: nodejs
        stages:
        - name: build-project
          steps: 
          - command: ls -l 
            name: ls-source-dir
            dir: /workspace/source
          - command: mkdir temp -p
            name: make-temp-dir
            dir: /workspace
          - command: curl -Lo hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.32/hugo_0.32_Linux-64bit.tar.gz
            dir: /workspace/temp
            name: curl-hugo-release
          - command: tar xvzf hugo.tar.gz
            dir: /workspace/temp
            name: unzip-hugo-tar-gz
          - command: ./hugo version
            dir: /workspace/temp
            name: output-hugo-version                
          - command: ./hugo -s /workspace/source
            name: generate-website
            dir: /workspace/temp
        - name: everything-else
          steps:
          - args:
            - --cache=true
            - --cache-dir=/workspace
            - --context=/workspace/source
            - --dockerfile=/workspace/source/Dockerfile
            - --destination=DOCKER_REGISTRY/REPLACE_ME_DOCKER_REGISTRY_ORG/serviceA:${inputs.params.version}
            - --cache-repo=DOCKER_REGISTRY/cache
            command: /kaniko/executor
            dir: /workspace/source
            image: gcr.io/kaniko-project/executor:9912ccbf8d22bbafbf971124600fbb0b13b9cbd6
            name: build-container-build
          - command: jx step post build --image DOCKER_REGISTRY/REPLACE_ME_DOCKER_REGISTRY_ORG/serviceA:${VERSION}
            name: build-post-build
          - command: jx step changelog --version v${VERSION}
            name: promote-changelog
          - command: jx step helm release
            dir: /workspace/source/charts/serviceA
            name: promote-helm-release
          - command: jx promote -b --all-auto --timeout 2m --no-wait  --version ${VERSION}
            dir: /workspace/source/charts/serviceA
            name: promote-jx-promote

MyProject/OWNERS file

approvers:
- USER
reviewers:
- USER

MyProject/OWNERS_ALIASES file

aliases:
- USER
best-approvers:
- USER
best-reviewers:
- USER

JX Version

NAME               VERSION
jx                 2.0.837
Kubernetes cluster v1.13.7-gke.24
kubectl            v1.16.1
helm client        Client: v2.13.1+g618447c
git                2.17.1
Operating System   Ubuntu 18.04.3 LTS
jenkins-x-bot commented 4 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle stale

jenkins-x-bot commented 4 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle rotten

jenkins-x-bot commented 4 years ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten. Provide feedback via https://jenkins-x.io/community. /close

jenkins-x-bot commented 4 years ago

@jenkins-x-bot: Closing this issue.

In response to [this](https://github.com/jenkins-x/lighthouse/issues/223#issuecomment-686628542): >Rotten issues close after 30d of inactivity. >Reopen the issue with `/reopen`. >Mark the issue as fresh with `/remove-lifecycle rotten`. >Provide feedback via https://jenkins-x.io/community. >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository.