More detail error messages when parsing the out of tree json file

Bug #898092 reported by Le Chi Thu on 2011-11-30
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Obsolete LAVA Test
Fix Released
High
Le Chi Thu

Bug Description

When run " lava-test register url" and "lava-test list-tests", it the json file is corrupt or missing, the lava-test only reports "Warning: Failed to load test from..". No hits on what is the root problem.

Tested with the url. http://git.linaro.org/gitweb?p=people/bgaignard/cmatest.git;a=blob_plain;f=cma.json;hb=dee9aaf928201b4f7efffe3e39b6cd4556a78314

From the chat :

<benjiG> zyga: same error "Warning: Failed to load test from 'http://git.linaro.org/gitweb?p=people/bgaignard/cmatest.git;a=blob_plain;f=cma.json;hb=HEAD'"
<zyga> let's see again then
<zyga> benjiG, in general you must be able to do this
<zyga> python
<zyga> import json
<zyga> json.load(open('yourfile.json'))
<zyga> if that crashes then you've got a syntax error
* ramana has quit (Ping timeout: 248 seconds)
* davepigott has quit (Ping timeout: 240 seconds)
* davepigott_ is now known as davepigott
<ChiThu> benjiG, testing..
<benjiG> zyga: got this error IOError: [Errno 2] No such file or directory: 'http://git.linaro.org/gitweb?p=people/bgaignard/cmatest.git;a=blob_plain;f=cma.json;hb=HEAD'
<zyga> still syntax ierror
<zyga> simplejson.decoder.JSONDecodeError: Invalid \escape: line 12 column 41 (char 338)
<zyga> benjiG, it seems you must quote your \w sequence
<zyga> as \\w
<zyga> try that
<zyga> yup
<zyga> that applies to all uses of \
<zyga> after doing that the file works
<zyga> :-)
<ChiThu> zyga, lava-test should print out the error messages from json parser. any tips how to do it ?
<zyga> ChiThu, er? I don't know what the problem is
<zyga> ChiThu, just use the parser and catch JSONDecodeError
<zyga> ChiThu, it's a subclass of ValueError
<zyga> ChiThu, also use simplejson, not json
<ChiThu> zyga, instead of "Warning: Failed to load test from...."
<zyga> ChiThu, sure, just do it :)
<ChiThu> zyga, more details error message..
* davidgiluk (~<email address hidden>) has joined #linaro
* davidgiluk has quit (Changing host)
* davidgiluk (~dg@linaro/davidgiluk) has joined #linaro
<ChiThu> zyga, ok catching the JSONDecodeError will do. Thanks for the tip
<zyga> ChiThu, it has a few extra attributes you can use to get the details

Please fix this one! :)

Zygmunt Krynicki (zyga) wrote :

Setting to high, it is very hard for users to debug issues without more detail

Changed in lava-test:
status: New → Incomplete
status: Incomplete → Confirmed
importance: Undecided → High
Paul Larson (pwlars) on 2011-12-14
Changed in lava-test:
milestone: none → 2012.01
Fathi Boudra (fboudra) on 2011-12-16
Changed in lava-test:
milestone: 2012.01 → none
Le Chi Thu (le-chi-thu) on 2012-01-13
Changed in lava-test:
milestone: none → 2012.01
assignee: nobody → Le Chi Thu (le-chi-thu)
Paul Larson (pwlars) on 2012-01-18
Changed in lava-test:
status: Confirmed → Fix Committed
Fathi Boudra (fboudra) on 2012-01-23
Changed in lava-test:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers