Search code examples
jenkins-x

jx boot is failing on steps: failed to run '/bin/sh -c jx step git validate' command in directory 'workspace\source', output: ''


I have an existing Kubernetes cluster running on Azure Kubernetes Service that I am trying to install Jenkins X into using the Jenkins X cli. My Operating System is WIndows 10.

I've cloned and executed the command jx boot within the jenkins-x-boot-config directory. Here is the output:

Attempting to resolve version for boot config https://github.com/jenkins-x/jenkins-x-boot-config from https://github.com/jenkins-x/jenkins-x-versions.git
Current HEAD HEAD in . is not an ancestor of v1.0.81, the boot config version from the version stream.
Proceeding with current HEAD.
Booting Jenkins X
WARNING: failed to load ConfigMap jenkins-x-docker-registry in namespace jx: failed to get configmap jenkins-x-docker-registry in namespace jx, configmaps "jenkins-x-docker-registry" not found
WARNING: failed to load ConfigMap jenkins-x-docker-registry in namespace jx: failed to get configmap jenkins-x-docker-registry in namespace jx, configmaps "jenkins-x-docker-registry" not found

STEP: validate-git command: /bin/sh -c jx step git validate in dir: C:\Users\drioux.guidry\Documents\jenkins-x-boot-config\workspace\source

error: failed to interpret pipeline file jenkins-x.yml: failed to run '/bin/sh -c jx step git validate' command in directory 'workspace\source', output: ''

I am receiving the same error when running jx boot within bash and Windows Command Prompt. The odd thing is that I am able to successfully execute the command manually that failed, albeit, I have to surround the arguments in quotes (Although, I tried surrounding the arguments with quotes in the jenkins-x.yml file and I still receive the same error displayed above):

$ /bin/sh -c "jx step git validate"
WARNING

Traditional Jenkins masters are being deprecated and removed from all new Jenkins X releases starting on April 20, 2020.
We strongly recommend using the default Tekton-based configuration instead for all Jenkins X activity going forward. We do not recommend using the Jenkins X workflow based around Jenkins masters.

For more information: https://jenkins-x.io/blog/2020/03/11/tekton/
Git configured for user: Dr** **** and email dr*****@******.com

I have jx cli installed. Here is the output of running the command jx version :

NAME               VERSION
jx                 2.0.1215
Kubernetes cluster v1.14.8
kubectl            v1.15.2
helm client        v2.16.1+gbbdfe5e
helm server        v2.16.1+gbbdfe5e
git                2.25.1.windows.1
Operating System   Windows 10 Enterprise 1903 build 18362


verifying packages

WARNING: jx version 2.0.1263 is available in the version stream. You are using 2.0.1215. We highly recommend you upgrade to it.

Here is my jenkins-x-boot-config/jenkins-x.yml

buildPack: none
pipelineConfig:
  pipelines:
    pullRequest:
      pipeline:
        agent:
          image: gcr.io/jenkinsxio/builder-go
        stages:
        - name: pr-checks
          options:
            containerOptions:
              name: ""
              resources: {}
              volumeMounts:
              - mountPath: /builder/home/.jx/localSecrets/currentCluster
                name: local-secrets
                readOnly: true
            volumes:
            - name: local-secrets
              secret:
                optional: true
                secretName: local-param-secrets
          steps:
          - args:
            - step
            - verify
            - values
            - --values-file=parameters.yaml
            - --schema-file=parameters.tmpl.schema.json
            command: jx
            dir: /workspace/source/env
            name: verify-parameters
          - args:
            - build
            command: make
            dir: /workspace/source/env
            name: lint-env-helm
    release:
      pipeline:
        agent:
          image: gcr.io/jenkinsxio/builder-go
        environment:
        - name: DEPLOY_NAMESPACE
          value: jx
        stages:
        - name: release
          options:
            containerOptions:
              name: ""
              resources: {}
              volumeMounts:
              - mountPath: /builder/home/.jx/localSecrets/currentCluster
                name: local-secrets
                readOnly: true
            volumes:
            - name: local-secrets
              secret:
                optional: true
                secretName: local-param-secrets
          steps:
          - args:
            - step
            - git
            - validate
            command: jx
            dir: .
            name: validate-git
          - args:
            - step
            - verify
            - preinstall
            - --provider-values-dir="kubeProviders"
            command: jx
            dir: /env
            name: verify-preinstall
          - args:
            - upgrade
            - crd
            command: jx
            name: install-jx-crds
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - velero
            command: jx
            dir: /workspace/source/systems/velero
            env:
            - name: DEPLOY_NAMESPACE
              value: velero
            name: install-velero
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - velero-backups
            command: jx
            dir: /workspace/source/systems/velero-backups
            env:
            - name: DEPLOY_NAMESPACE
              value: velero
            name: install-velero-backups
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - jxing
            command: jx
            dir: /workspace/source/systems/jxing
            env:
            - name: DEPLOY_NAMESPACE
              value: kube-system
            name: install-nginx-controller
          - args:
            - step
            - create
            - install
            - values
            - -b
            command: jx
            dir: /workspace/source/env
            name: create-install-values
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - exdns
            command: jx
            dir: /workspace/source/systems/external-dns
            name: install-external-dns
          - args:
            - apply
            - --wait
            - --validate=false
            - -f
            - https://raw.githubusercontent.com/jetstack/cert-manager/release-0.11/deploy/manifests/00-crds.yaml
            command: kubectl
            dir: /workspace/source
            env:
            - name: DEPLOY_NAMESPACE
              value: cert-manager
            name: install-cert-manager-crds
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - cm
            command: jx
            dir: /workspace/source/systems/cm
            env:
            - name: DEPLOY_NAMESPACE
              value: cert-manager
            name: install-cert-manager
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - acme
            command: jx
            dir: /workspace/source/systems/acme
            name: install-acme-issuer-and-certificate
          - args:
            - step
            - boot
            - vault
            - --provider-values-dir
            - ../../kubeProviders
            command: jx
            dir: /workspace/source/systems/vault
            name: install-vault
          - args:
            - step
            - create
            - values
            - --name
            - parameters
            command: jx
            dir: /workspace/source/env
            name: create-helm-values
          - args:
            - step
            - create
            - templated
            - --parameters-file=../../env/parameters.yaml
            - --requirements-dir=../../
            - --template-file=jx-auth-configmap.tmpl.yaml
            - --config-file=templates/jx-auth-configmap.yaml
            command: jx
            dir: /workspace/source/systems/jx-auth
            name: create-jx-auth-config
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --no-vault
            - --name
            - jx-auth
            command: jx
            dir: /workspace/source/systems/jx-auth
            name: install-jx-auth-config
          - args:
            - step
            - helm
            - apply
            - --boot
            - --remote
            - --name
            - jenkins-x
            - --provider-values-dir
            - ../kubeProviders
            command: jx
            dir: /workspace/source/env
            name: install-jenkins-x
          - args:
            - step
            - verify
            - env
            command: jx
            dir: /workspace/source
            name: verify-jenkins-x-environment
          - args:
            - step
            - helm
            - apply
            - --boot
            - --name
            - repos
            command: jx
            dir: /workspace/source/repositories
            name: install-repositories
          - args:
            - step
            - scheduler
            - config
            - apply
            - --direct=true
            command: jx
            dir: /workspace/source/prowConfig
            name: install-pipelines
          - args:
            - update
            - webhooks
            - --verbose
            - --warn-on-fail
            command: jx
            dir: /workspace/source/repositories
            name: update-webhooks
          - args:
            - step
            - verify
            - install
            - --pod-wait-time
            - 30m
            command: jx
            dir: /workspace/source/env
            name: verify-installation

Let me know if there is any other details that I should provide to help resolve this issue.


Solution

  • After trying to create a new Kubernetes cluster in AKS with version v1.16.7, I still received the same error. Also, creating a cluster in Google Cloud Platform using command jx create cluster gke --skip-installation and then running jx boot resulted in the same error as shared in this stack overflow question.

    I posed another question on Stack Overflow, "stackoverflow.com/questions/61806267/…", and someone recommended using a Windows Linux Subsystem which it proved to successfully install Jenkins X into my GKE cluster without needing to follow any steps defined in this Stack Overflow question. Here is the link to setting up WSL that I used: learn.microsoft.com/en-us/windows/wsl/install-win10