cliffano / nestor

Jenkins CLI and node.js client
http://blog.cliffano.com/tag/nestor/
MIT License
181 stars 27 forks source link

'Waiting for job to start...' when trying to tail console at build start #46

Closed eriweb closed 7 years ago

eriweb commented 7 years ago

Trying out nestor, and while issuing nestor build 'nestor-test' --console it does not successfully show the console, but gives the following output:

Job nestor-test was triggered successfully
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Waiting for job to start...
Build didn't start after 30 seconds, it's still waiting in the queue

Trying to view the console at a later stage works as expected:

$ nestor console 'nestor-test'                                                                                                                                                                              
Started by user terbolous
Building in workspace /var/lib/jenkins/workspace/nestor-test
[nestor-test] $ /bin/sh -xe /tmp/hudson5853494320620600586.sh
+ echo Hello World
Hello World
Finished: SUCCESS

Any advice?

cliffano commented 7 years ago

@terbolous Thanks for opening this issue. I'll try to reproduce the problem, could you please provide the following info: node.js version: node --version npm version: npm --version Nestor version: nestor --version Jenkins version: nestor ver

eriweb commented 7 years ago

Sure thing. Node version: 7.4.0 npm version: 4.0.5 Nestor version: 1.0.2 Jenkins version: 2.32.1

I just updated Jenkins from 2.19.something, but that didn't help

eriweb commented 7 years ago

Running the Nestor client on macOS 10.12.2 in case it matters by the way

cliffano commented 7 years ago

I've figured out the cause of this problem, it's due to authentication details not being propagated when checking whether the build has started or not. This feature stopped working for secured Jenkins during the last refactoring of console streaming implementation.

Will work on a fix when I have some free time, sorry for being slow on this, life and work have been very busy.

cliffano commented 7 years ago

This is fixed in upcoming version 2.0.0 .

Rather than resorting to sending requests and managing the authentication details via URL, I ended up creating a Jenkins API client called Swaggy Jenkins instead. https://github.com/cliffano/swaggy-jenkins The goal of that library is to generate API clients in multiple tech stacks beyond node.js .