jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.58k stars 788 forks source link

jx boot fails to create dev environment in bitbucketcloud #5725

Closed gazal-k closed 4 years ago

gazal-k commented 5 years ago

Summary

jx boot fails to create dev environment in bitbucketcloud

Steps to reproduce the behavior

  1. create fork of https://github.com/jenkins-x/jenkins-x-boot-config in bitbucket cloud.
  2. changes in jx-requirements.yml

    cluster:
      provider: eks
      gitKind: bitbucketcloud
      gitName: bc
      gitServer: https://bitbucket.org
    secretStorage: local
    webhook: lighthouse
  3. run jx boot

Expected behavior

Installs Jenkins X in the EKS cluster with pipelines for the dev, staging and production environment

Actual behavior

Looks like most of the applications do get installed fine

$ kubectl get pods --field-selector=status.phase=Running
NAME                                           READY   STATUS    RESTARTS   AGE
jenkins-x-chartmuseum-67f75c4884-xrrqc         1/1     Running   0          19h
jenkins-x-controllerbuild-65f6ffc455-j4pnc     1/1     Running   0          19h
jenkins-x-controllerrole-5c76ccd846-vd7zr      1/1     Running   0          19h
jenkins-x-heapster-76f6fd9d47-bvz9d            2/2     Running   0          19h
jenkins-x-lighthouse-85f7557b4f-qbrqn          1/1     Running   0          19h
jenkins-x-nexus-57c8447c4-xfwv8                1/1     Running   0          19h
tekton-pipelines-controller-65fff67458-ht9xs   1/1     Running   0          19h
tide-6f77b46cc-w8mqn                           1/1     Running   0          19h

But getting this error towards the end of the jx boot process

creating environment dev git repository for URL: https://bitbucket.org/<org>/environment-<clusterName>-dev.git to namespace jx
error: creating dev environment for environment-<clusterName>-dev: duplicating https://bitbucket.org/<org>/environment-clusterName-dev to org/environment-<clusterName>-dev: getting repo for https://bitbucket.org/<org>/environment-<clusterName>-dev: Status: 429 Too Many Requests, Body: Rate limit for this resource has been exceeded
error: failed to interpret pipeline file jenkins-x.yml: failed to run '/bin/sh -c jx step verify env' command in directory '.', output: ''

Trying to list pipelines shows:

$ jx get pipelines 
error: no pipelines found

Jx version

The output of jx version is:

NAME               VERSION
jx                 2.0.827
Kubernetes cluster v1.13.10-eks-5ac0f1
kubectl            v1.16.0
helm client        Client: v2.14.3+g0e7f3b6
git                2.21.0
Operating System   "Fedora release 30 (Thirty)"

Jenkins type

Kubernetes cluster

EKS created using ClusterConfig similar to https://github.com/weaveworks/eksctl/blob/master/examples/eks-quickstart-app-dev.yaml

Operating system / Environment

Operating System "Fedora release 30 (Thirty)"

hferentschik commented 5 years ago

ATM Bitbucket won't work with jx boot.

gazal-k commented 5 years ago

ATM Bitbucket won't work with jx boot.

I don't understand why there's documentation about setting it up using bitbucketcloud; https://jenkins-x.io/docs/getting-started/setup/boot/#bitbucket-cloud with lighthouse

gazal-k commented 5 years ago

I'm happy to report that after a bit of fiddling about I was able to setup jx using jx boot on eks with bitbucketcloud

I'm not entirely sure what changes helped me get it working.

NAME               VERSION
jx                 2.0.838
Kubernetes cluster v1.13.10-eks-5ac0f1
kubectl            v1.16.1
helm client        Client: v2.14.3+g0e7f3b6
git                2.21.0
Operating System   "Fedora release 30 (Thirty)"

Another minor issue I faced while setting up was when I had some ambiguous special characters in the admin password. I got these errors:

Copying the helm source directory ~/git/environment-<clusterName>-dev/env to a temporary location for building and applying /tmp/jx-helm-apply-256122755/env
Applying helm chart at /tmp/jx-helm-apply-256122755/env as release name jenkins-x to namespace jx
verifying the helm requirements versions in dir: . using version stream URL: https://github.com/jenkins-x/jenkins-x-versions.git and git ref: master
error: generating values.yaml for tree from /tmp/jx-helm-apply-256122755/env: unmarshaling /tmp/jx-helm-apply-256122755/env/parameters.yaml: error converting YAML to JSON: yaml: line 2: did not find expected ',' or ']'
error: failed to interpret pipeline file jenkins-x.yml: failed to run '/bin/sh -c jx step helm apply --boot --remote --name jenkins-x --provider-values-dir ../kubeProviders' command in directory 'env', output: ''

You reckon I should create another issue for that so that u guys can work in maybe some better error handling or pattern matching for the password to prevent that issue?

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

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/jx/issues/5725#issuecomment-671152983): >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.
thetusharr commented 4 years ago

@gazal-k I am trying install jx on my existing kubernetes cluster, i wanted to know how you created personal access token on bitbucket clould

gazal-k commented 4 years ago

Sorry @thetusharr, this was so long ago. Since then Jenkins X has changed a lot. Our SCM has also changed. We migrated from bitbucketcloud to GitHub. But I'm pretty sure lighthouse with it's usage of go-scm supports other SCMs much better now.

Check here: https://jenkins-x.io/docs/reference/components/lighthouse/ & https://github.com/jenkins-x/lighthouse