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

Exactly same project one always pass but another one always failed with BlueOcean

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • blueocean-plugin
    • jenkinsci/blueocean docker image

      host: windows 10
      blueocean-plugin: 1.5

      Frist, I created a new project, TestA, using BlueOcean Plugin and its editor to create a task:

      ```
      pipeline {
      agent {
      docker

      { image 'node:alpine' args '-p 3000:3000' }

      }
      stages {
      stage('build') {
      parallel {
      stage('build') {
      steps

      { sh 'npm install' }

      }
      stage('test') {
      steps

      { sh 'npm test' }

      }
      stage('deliver') {
      steps

      { sh 'npm start' }

      }
      }
      }
      }
      }
      ```
      then, the construction always failed with an error `+ sh 'npm test' sh: 0: Can't open npm`. I tried many times but could not pass any stage of the construction. I googled but no clue, so I tried to create another project NoBlueOcean, with jenkins only, without BlueOcean, with the exactly same source code and config. This time, the construction past in the new project and to my surprise, the previous TestA project past two stages `build` and `test` but failed at the stage `deliver`, the construction logs:

      ```
      + npm start

      > testa@1.0.0 start /var/jenkins_home/workspace/TestA_develop-2FVYGZ7AQEYOGE4PB6TKQSYM3CL5SQG2ZAD2NEG3VSPTBLSGKW3Q
      > http-server -p 3000 ./html

      sh: http-server: not found
      npm ERR! file sh
      npm ERR! code ELIFECYCLE
      npm ERR! errno ENOENT
      npm ERR! syscall spawn
      npm ERR! testa@1.0.0 start: `http-server -p 3000 ./html`
      npm ERR! spawn ENOENT
      npm ERR!

      ```

      I attached two construction logs, 1.txt from jenkins only project, 2.txt from BlueOcean. and upload the test project to github: https://github.com/baivoom/jenkins_testa_0519

        1. 1.txt
          2 kB
          Baivoom Chen
        2. 2.txt
          1 kB
          Baivoom Chen

            Unassigned Unassigned
            baivoom Baivoom Chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: