dave-hagedorn / jenkins-runner

VS Code plugin to develop and run Jenkins Pipeline scripts
MIT License
30 stars 8 forks source link

Error if pipeline job is freshly created #14

Closed bvarnai closed 4 years ago

bvarnai commented 4 years ago

Running freshly created pipeline job result in an error

[2019-10-09 12:26:25.062] [Jenkins] [info] Creating Jenkins instance @url=https://localhost/jenkins, with user=****, password=****
[2019-10-09 12:26:25.062] [Jenkins] [info] Creating pipeline build using job just-created @https://localhost/jenkins, with params undefined
[2019-10-09 12:26:25.064] [Jenkins] [info] Fetching remote XML config for job just-created @https://localhost/jenkins
[2019-10-09 12:26:33.366] [Jenkins] [info] Stopping job default-test #undefined @https://localhost/jenkins
[2019-10-09 12:26:33.367] [Jenkins] [info] Stopping job default-test #undefined @https://localhost/jenkins
[2019-10-09 12:26:34.054] [Jenkins] [info] Parsing and updating XML with new pipeline script
[2019-10-09 12:26:34.055] [Jenkins] [error] Error starting job just-created #undefined @https://localhost/jenkins}: TypeError: Cannot read property '0' of undefined
[2019-10-09 12:26:36.564] [Jenkins] [info] Stopping job just-created #undefined @https://localhost/jenkins
[2019-10-09 12:26:36.564] [Jenkins] [info] Stopping job just-created #undefined @https://localhost/jenkins

As workaround you have save an empty Jenkinsfile. Probably it's due to non-existing Jenkinsfile which cannot be updated at first.

dave-hagedorn commented 4 years ago

Hi @bvarnai - I'm digging into this a bit more - I might have a fix but I can't repro - are you using a pipeline job, or a multi-branch pipeline job? Thanks!