jx: jx edit env - fails with error: secrets "jenkins" not found

Summary

jx edit env command fails with error: creating Jenkins client: secrets “jenkins” not found

Steps to reproduce the behavior

  1. Install Jenkins X with jx boot
  2. Run the command jx edit env staging
  3. Select: Promotion Strategy: Manual

Expected behavior

The promotion strategy for the staging environment was changed to Manual.

Actual behavior

? Label: Staging
? Namespace: jx-********-staging
? Domain: ********.com
? Environment in separate cluster to Dev Environment: No

? Promotion Strategy: Manual
? Git URL for the Environment source code: https://github.com/********/environment-********-staging.git
? Git branch for the Environment source code: master
Updated environment staging
? Do you wish to use ******** as the user name to create the Git repository Yes
error: creating Jenkins client: secrets "jenkins" not found

Jx version

The output of jx version is:

NAME               VERSION
jx                 2.0.1192
Kubernetes cluster v1.15.6
kubectl            v1.17.2
helm client        Client: v2.16.1+gbbdfe5e
git                2.25.0
Operating System   Mac OS X 10.15.3 build 19D76


verifying packages

jx-requirements.yml version stream:

versionStream:
  ref: v1.0.347
  url: https://github.com/jenkins-x/jenkins-x-versions.git

Jenkins type

  • Serverless Jenkins X Pipelines (Tekton + Prow)
  • Classic Jenkins

Kubernetes cluster

Self-created with kubespray

Operating system / Environment

Running the CLI on my MacBook Pro (OS X)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 20 (8 by maintainers)

Most upvoted comments

Same issue for me. First, the secret issue then unable to find external URL of service jenkins in namespace jx

I’ve solved it following this gist:

GKE: https://gist.github.com/vfarcic/fe18870a015f4acc34d91c106d0d43c8 EKS: https://gist.github.com/vfarcic/f4a1df244d1852ee250e751c7191f5bd AKS: https://gist.github.com/vfarcic/b07f45f6907c2a1c71f45dbe0df8d410 Serverless: https://gist.github.com/vfarcic/7b3b3d90ecd7f343effe4fff5241d037

It is from a great book: The DevOps toolkit series: The Devops 2-6 toolkit - Jenkins X Cloud-Native Kubernetes-First Continous Delivery

/assign ankitm123

Just took a quick look, and it appears jx edit env and jx create env are still calling a legacy ImportProject function that tries to import a Jenkins multi-branch project. I…have no idea why that’s the case.

No, it doesn’t exist. And also I’ve checked previous installations for Serverless Jenkins X by jx install and there is no jenkins secret in any of them.

Last login: Thu Feb 13 17:03:53 2020 from 10.20.100.1
Alex-Mac-mini:~ alex$ kubens jx-razomer
Context "alex@km01" modified.
Active namespace is "jx-razomer".
Alex-Mac-mini:~ alex$ kubectl get secrets | grep jenkins
jenkins-docker-cfg                     Opaque                                1      4h12m
jenkins-maven-settings                 Opaque                                1      4h12m
jenkins-npm-token                      Opaque                                1      4h12m
jenkins-release-gpg                    Opaque                                4      4h12m
jenkins-ssh-config                     Opaque                                1      4h12m
jenkins-x-chartmuseum                  Opaque                                2      4h12m
jenkins-x-controllerrole-token-kw7qw   kubernetes.io/service-account-token   3      4h12m
jenkins-x-docker-registry-secret       Opaque                                1      4h12m
jenkins-x-gcactivities-token-qdz4r     kubernetes.io/service-account-token   3      4h12m
jenkins-x-gcpods-token-cqfv5           kubernetes.io/service-account-token   3      4h12m
jenkins-x-gcpreviews-token-m85qr       kubernetes.io/service-account-token   3      4h12m
jenkins-x-heapster-token-np8vb         kubernetes.io/service-account-token   3      4h12m

I’m experiencing the exact same issue. I’m probably created/destroyed about 20 jx GKE clusters (via the jx cli) over the past few weeks and have never seen a jenkins secret in the jx namespace.

Environment setup below.

$ jx version
NAME               VERSION
jx                 2.0.1188
Kubernetes cluster v1.14.9-gke.23
kubectl            v1.16.0
helm client        Client: v2.14.3+g0e7f3b6
git                2.21.0
Operating System   Mac OS X 10.12.6 build 16G2136

@abayer Would you happen to know whether there is any way to properly create a jenkins secret from scratch if its missing? Alternatively, if you have an example yaml manifest for the secret available, and the secret info itself is simply the standard jx base64 encoded creds, then those of us with running jx environments could at least add a hotfix to our provisioning scripts.

No, it doesn’t exist. And also I’ve checked previous installations for Serverless Jenkins X by jx install and there is no jenkins secret in any of them.

Last login: Thu Feb 13 17:03:53 2020 from 10.20.100.1
Alex-Mac-mini:~ alex$ kubens jx-razomer
Context "alex@km01" modified.
Active namespace is "jx-razomer".
Alex-Mac-mini:~ alex$ kubectl get secrets | grep jenkins
jenkins-docker-cfg                     Opaque                                1      4h12m
jenkins-maven-settings                 Opaque                                1      4h12m
jenkins-npm-token                      Opaque                                1      4h12m
jenkins-release-gpg                    Opaque                                4      4h12m
jenkins-ssh-config                     Opaque                                1      4h12m
jenkins-x-chartmuseum                  Opaque                                2      4h12m
jenkins-x-controllerrole-token-kw7qw   kubernetes.io/service-account-token   3      4h12m
jenkins-x-docker-registry-secret       Opaque                                1      4h12m
jenkins-x-gcactivities-token-qdz4r     kubernetes.io/service-account-token   3      4h12m
jenkins-x-gcpods-token-cqfv5           kubernetes.io/service-account-token   3      4h12m
jenkins-x-gcpreviews-token-m85qr       kubernetes.io/service-account-token   3      4h12m
jenkins-x-heapster-token-np8vb         kubernetes.io/service-account-token   3      4h12m