Open sushengloong opened 8 years ago
@sushengloong I've a feeling it's bad response from the server, it's not seeing stage['result']
and that would be my instinctive guess.
The code definitely should be testing that result exists before pulling in the stage, I'll have a look at it this weekend.
The suggestion for logging is great and I would suggest looking at adding logging to the request handling in gocd.Server. Default debug logging and then adding a flag for verbosity level. :)
I just realized, there's already a flag on gocd.Server that you can use to set the logging level for requests. It just needs to be togglable from gocd-cli.
I've a feeling that an overhaul of the flags interface is necessary to handle global flags, although a quick hack will always work for now. :P
Thanks! Do let me know if I can be of any help.
Regarding the flag, I tried changing Server
to accept logging level via a dictionary options
.
A PR for your consideration - https://github.com/gaqzi/py-gocd/pull/11 :grin:
@sushengloong I've added code for this and manually tested it, but I still need to add some proper tests to it.
You can find it at py-gocd/feature/more-logging and gocd-cli/feature/more-logging.
@gaqzi nice! Looking forward to the next release.
@gaqzi Setting debuglevel
seems to only log HTTP headers and not the request/response body. Still have to put in a few print
statements for that.
What we have observed is Go server API may indeed not return 'result'
for the 'stage'
object.
As such, PR https://github.com/gaqzi/gocd-cli/pull/15 for your consideration :smiley:
Hi,
We encountered the error below (
KeyError
) when runninggocd-cli
to trigger a pipeline. Despite the error, the pipeline was actually triggered and run successfully though the duration was close to half-an-hour. Not sure if it'sgocd-cli
orpy-gocd
orgocd
server API itself that was causing the error. Any pointer?Furthermore the API response was not written into logs so it is difficult to troubleshoot. Would you be able to suggest ways to improve logging in
gocd-cli
? Thanks :)