Skip to contentSkip to conversation

dtschema v2020.08.1 json.decoder.JSONDecodeError error

DISCUSSION Krzysztof Kozlowski 2 participants 5 messages Aug 28, 2020 – Sep 2, 2020

lore
Share & tools
lore
#0 lore raw

Hi Rob,

I am trying dt_bindings_check with on top of next-20200826 with dtschema v2020.08.01 and got errors on all schemas:

=======
Traceback (most recent call last):
File "/home/krzk/.local/lib/python3.5/site-packages/jsonschema/validators.py", line 777, in resolve_from_url
document = self.resolve_remote(url)
File "/home/krzk/.local/lib/python3.5/site-packages/jsonschema/validators.py", line 860, in resolve_remote
result = requests.get(uri).json()
File "/home/krzk/.local/lib/python3.5/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
DTEX Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.example.dts

    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/krzk/.local/bin/dt-doc-validate", line 67, in <module>
ret = check_doc(f)
File "/home/krzk/.local/bin/dt-doc-validate", line 33, in check_doc
for error in sorted(dtschema.DTValidator.iter_schema_errors(testtree), key=lambda e: e.linecol):
File "/home/krzk/.local/lib/python3.5/site-packages/dtschema/lib.py", line 663, in iter_schema_errors
meta_schema = cls.resolver.resolve_from_url(schema['$schema'])
File "/home/krzk/.local/lib/python3.5/site-packages/jsonschema/validators.py", line 779, in resolve_from_url
raise exceptions.RefResolutionError(exc)
jsonschema.exceptions.RefResolutionError: Expecting value: line 1 column 1 (char 0)
=======

Python v3.5.2
Ubuntu 16.04

Direct dependencies of dtschema updated via pip3.

Any hints?

Best regards,
Krzysztof

#1 lore raw
Quoted 37 lines · Krzysztof Kozlowski

Hi Rob,

I am trying dt_bindings_check with on top of next-20200826 with dtschema v2020.08.01 and got errors on all schemas:

=======
Traceback (most recent call last):
File "/home/krzk/.local/lib/python3.5/site-packages/jsonschema/validators.py", line 777, in resolve_from_url
document = self.resolve_remote(url)
File "/home/krzk/.local/lib/python3.5/site-packages/jsonschema/validators.py", line 860, in resolve_remote
result = requests.get(uri).json()
File "/home/krzk/.local/lib/python3.5/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
DTEX Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.example.dts

    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/krzk/.local/bin/dt-doc-validate", line 67, in <module>
ret = check_doc(f)
File "/home/krzk/.local/bin/dt-doc-validate", line 33, in check_doc
for error in sorted(dtschema.DTValidator.iter_schema_errors(testtree), key=lambda e: e.linecol):
File "/home/krzk/.local/lib/python3.5/site-packages/dtschema/lib.py", line 663, in iter_schema_errors
meta_schema = cls.resolver.resolve_from_url(schema['$schema'])
File "/home/krzk/.local/lib/python3.5/site-packages/jsonschema/validators.py", line 779, in resolve_from_url
raise exceptions.RefResolutionError(exc)
jsonschema.exceptions.RefResolutionError: Expecting value: line 1 column 1 (char 0)
=======

Quoted 2 lines

Python v3.5.2
Ubuntu 16.04

I tried also on newer machine (Ubuntu 18.04, Python 3.6.9) - the same.

Best regards,
Krzysztof

#2 lore raw
In reply to Krzysztof Kozlowski
Quoted 38 lines · Krzysztof Kozlowski

Hi Rob,

I am trying dt_bindings_check with on top of next-20200826 with dtschema v2020.08.01 and got errors on all schemas:

=======
Traceback (most recent call last):
File "/home/krzk/.local/lib/python3.5/site-packages/jsonschema/validators.py", line 777, in resolve_from_url
document = self.resolve_remote(url)
File "/home/krzk/.local/lib/python3.5/site-packages/jsonschema/validators.py", line 860, in resolve_remote
result = requests.get(uri).json()
File "/home/krzk/.local/lib/python3.5/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
DTEX Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.example.dts

    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/krzk/.local/bin/dt-doc-validate", line 67, in <module>
ret = check_doc(f)
File "/home/krzk/.local/bin/dt-doc-validate", line 33, in check_doc
for error in sorted(dtschema.DTValidator.iter_schema_errors(testtree), key=lambda e: e.linecol):
File "/home/krzk/.local/lib/python3.5/site-packages/dtschema/lib.py", line 663, in iter_schema_errors
meta_schema = cls.resolver.resolve_from_url(schema['$schema'])
File "/home/krzk/.local/lib/python3.5/site-packages/jsonschema/validators.py", line 779, in resolve_from_url
raise exceptions.RefResolutionError(exc)
jsonschema.exceptions.RefResolutionError: Expecting value: line 1 column 1 (char 0)
=======

Quoted 4 lines

Python v3.5.2
Ubuntu 16.04

Direct dependencies of dtschema updated via pip3.

Not sure. I'm on version 2.0.9 for the json module which I guess is what comes with python 3.8 (I'm on ubuntu 20.04).

Nothing jumps out at me looking at the module history:
https://github.com/python/cpython/commits/master/Lib/json

I'll try some older versions.

Rob

#3 lore raw
Quoted 9 lines · Rob Herring
Quoted 7 lines · Krzysztof Kozlowski

Hi Rob,

I am trying dt_bindings_check with on top of next-20200826 with dtschema v2020.08.01 and got errors on all schemas:

=======

Did you miss some of the traceback?:

Traceback (most recent call last):
File "/home/rob/.local/lib/python3.6/site-packages/jsonschema-3.2.0-py3.6.egg/jsonschema/validators.py",
line 774,
in resolve_from_url
document = self.store[url]
File "/home/rob/.local/lib/python3.6/site-packages/jsonschema-3.2.0-py3.6.egg/jsonschema/_utils.py",
line 22, in _
_getitem__
return self.store[self.normalize(uri)]
KeyError: 'https://protect2.fireeye.com/url?k=59835ffc-05905d01-59822c67-0cc47a336902-306bd2691e458c36&q=1&u=http%3A %2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23'

I get this and then the same traceback as you. This is now fixed in -next.

Rob

#4 lore raw
Quoted 14 lines · Rob Herring
Quoted 9 lines · Rob Herring
Quoted 7 lines · Krzysztof Kozlowski

Hi Rob,

I am trying dt_bindings_check with on top of next-20200826 with dtschema v2020.08.01 and got errors on all schemas:

=======

Did you miss some of the traceback?:

Quoted 11 lines

Traceback (most recent call last):
File "/home/rob/.local/lib/python3.6/site-packages/jsonschema-3.2.0-py3.6.egg/jsonschema/validators.py",
line 774,
in resolve_from_url
document = self.store[url]
File "/home/rob/.local/lib/python3.6/site-packages/jsonschema-3.2.0-py3.6.egg/jsonschema/_utils.py",
line 22, in _
_getitem__
return self.store[self.normalize(uri)]
KeyError: 'https://protect2.fireeye.com/url?k=59835ffc-05905d01-59822c67-0cc47a336902-306bd2691e458c36&q=1&u=http%3A %2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23'

No, I think I did not have it.

Quoted 1 line

I get this and then the same traceback as you. This is now fixed in -next.

Yes, I noticed it today, thanks!

Best regards,
Krzysztof