Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50148

Unable to edit pipeline in blueocean when Jenkinsfile contains "withSonarQubeEnv"

XMLWordPrintable

      Everything is fine until I switch to edit mode. Then, OceanBlue layout is displayed but the stages are not.

      In chrome console, this error message appears :

      blueocean.js:58253 Unhandled Rejection: "Error: No parameters for: withSonarQubeEnv\n at convertStepFromJson (https://app.jaguards.com:4433/adjuncts/e896cb23/org/jenkins/ui/jsmodules/blueocean-pipeline-editor/jenkins-js-extension.js:63287:27)\n at convertStageFromJson (https://app.jaguards.com:4433/adjuncts/e896cb23/org/jenkins/ui/jsmodules/blueocean-pipeline-editor/jenkins-js-extension.js:63239:28)\n at convertJsonToInternalModel (https://app.jaguards.com:4433/adjuncts/e896cb23/org/jenkins/ui/jsmodules/blueocean-pipeline-editor/jenkins-js-extension.js:63195:28)\n at https://app.jaguards.com:4433/adjuncts/e896cb23/org/jenkins/ui/jsmodules/blueocean-pipeline-editor/jenkins-js-extension.js:57251:96\n at https://app.jaguards.com:4433/adjuncts/e896cb23/org/jenkins/ui/jsmodules/blueocean-pipeline-editor/jenkins-js-extension.js:63513:13\n at https://app.jaguards.com:4433/adjuncts/e896cb23/org/jenkins/ui/jsmodules/blueocean-pipeline-editor/jenkins-js-extension.js:64335:17\n at <anonymous>"
      logUnhandledPromiseRejection @ blueocean.js:58253

      In case it helps, this is the Jenkinsfile : 

      pipeline {
        agent any
        stages {
          stage('Server build (Java 8)') {
            agent {
              docker {
                image 'openjdk:8'
                args '-v /srv/docker/jenkins-containers/cache/gradle-java8:/root/.gradle'
              }
            }
            steps {
              sh 'cd server && ./gradlew clean && ./gradlew build'
            }
          }
          stage('Client build') {
            agent {
              docker {
                image 'node:9'
                args '--network jenkinscontainers_default --link sonarqube -v /srv/docker/jenkins-containers/cache/npm-node9:/root/.npm'
              }
            }
            steps {
              withSonarQubeEnv('sonar') {
                sh 'cd ./client && npm install'
              }
            }
          }
          stage('Server SonarQube analysis') {
            agent {
              docker {
                image 'openjdk:8'
                args '--network jenkinscontainers_default --link sonarqube -v /srv/docker/jenkins-containers/cache/gradle-java8:/root/.gradle'
              }
            }
            steps {
              withSonarQubeEnv('sonar') {
                sh 'cd ./server && ./gradlew --info sonarqube'
              }
            }
          }
          stage('Server SonarQube QG') {
            agent {
              docker {
                image 'openjdk:8'
                args '--network jenkinscontainers_default --link sonarqube -v /srv/docker/jenkins-containers/cache/gradle-java8:/root/.gradle'
              }
            }
            steps {
              timeout(time: 1, unit: 'HOURS') {
                waitForQualityGate()
              }
            }
          }
          stage('Client SonarQube analysis') {
            agent {
              docker {
                image 'node:9'
                args '--network jenkinscontainers_default --link sonarqube -v /srv/docker/jenkins-containers/cache/npm-node9:/root/.npm'
              }
            }
            steps {
              withSonarQubeEnv('sonar') {
                sh 'cd ./client && npm install && npm run-script sonar-scanner'
              }
            }
          }
          stage('Client SonarQube QG') {
            agent {
              docker {
                image 'node:9'
                args '--network jenkinscontainers_default --link sonarqube -v /srv/docker/jenkins-containers/cache/npm-node9:/root/.npm'
              }
            }
            steps {
              timeout(time: 1, unit: 'HOURS') {
                waitForQualityGate()
              }
            }
          }
        }
      }
       

       

       

            abayer Andrew Bayer
            romlly Romain Ciaccafava
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: