bitrise-steplib / steps-random-quote

Prints a random quote and saves it into $RANDOM_QUOTE
MIT License
0 stars 5 forks source link

Exception when running this plugin - Json unmarshal failed #8

Closed athkalia closed 8 years ago

athkalia commented 8 years ago

Getting this exception on this plugin:

+------------------------------------------------------------------------------+ 
| (9) random-quote@3.0.0 | 
+------------------------------------------------------------------------------+ 
| id: random-quote | 
| version: 3.0.0 | 
| collection: https://github.com/bitrise-io/bitrise-steplib.git | 
| time: 2016-07-29T10:47:49Z | 
+------------------------------------------------------------------------------+ 
| | 
WARN[10:47:49] step.dependencies is deprecated... Use step.deps instead. 
INFO[10:47:49] Deprecated dependencies found
Quote generation failed! 
Error message: 
Json unmarshal failed, err: invalid character '<' looking for beginning of value
exit status 1 
| | 
+----+--------------------------------------------------------------+----------+ 
|  | random-quote@3.0.0 (exit code: 1) | 19 sec | 
+----+--------------------------------------------------------------+----------+ 
| Issue tracker: https://github.com/bitrise-io/steps-random-quote/issues | 
| Source: https://github.com/bitrise-io/steps-random-quote | 
+----+--------------------------------------------------------------+----------+

Only happens in one out of 20 builds or so

viktorbenei commented 8 years ago

Thanks for reporting, we'll fix this asap!

godrei commented 8 years ago

Hi @athkalia ,

i was not able to reproduce this issue, i guess it was an issue on the service, we use to generate the quotes (http://api.icndb.com/jokes/random).

However the step tried to parse response body before, it checked the reponse status code. We released a new version (3.0.2), which contains fix for this issue and also contains retry logic, if first request fails.