question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When resolving git-lfs references, json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

See original GitHub issue

We are unable to access attck.enterprise.actors, attck.enterprise.techniques, etc because the code is downloading a json file that is actually a git-lfs reference and not valid json.

It fails when parsing the output of https://github.com/swimlane/pyattck/blob/master/attck_to_nist_controls.json?raw=True.

We are using version 3.0.1.

Reproduction below:

Python 3.8.6 (default, Jan  8 2021, 15:34:15)
[Clang 12.0.0 (clang-1200.0.26.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyattck import Attck
>>> attck = Attck()
>>> attck.enterprise.actors
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/blah/lib/python3.8/site-packages/pyattck/attck.py", line 224, in enterprise
    self.__load_data()
  File "/blah/lib/python3.8/site-packages/pyattck/attck.py", line 285, in __load_data
    Attck.__ENTERPRISE_NIST_DATA_JSON = self.__datasets.get_data(
  File "/blah/lib/python3.8/site-packages/pyattck/datasets.py", line 66, in get_data
    return self.__get_json_data(
  File "/blah/lib/python3.8/site-packages/pyattck/datasets.py", line 48, in __get_json_data
    data = requests.get(url).json()
  File "/blah/lib/python3.8/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/blah/.pyenv/versions/3.8.6/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/blah/.pyenv/versions/3.8.6/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/blah/.pyenv/versions/3.8.6/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
MSAdministratorcommented, Jun 25, 2021

@amirjalali65 @jbraswell Please checkout the new release which resolves this issue and adds much better handling of configuration going forward.

pip install pyattck==4.0.0
0reactions
amirjalali65commented, Jun 25, 2021

I was using 3.0.0, bumping to 3.0.1 fixed the issue. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSONDecodeError: Expecting value: line 1 column 1 (char 0 ...
I still have the same problem after git lfs fetch successful. The problem is because of this following line: img = Image(imageName) ...
Read more >
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The following is the code I use for the curl request. The error happens at return simplejson.loads(response_json) response_json = self.web_fetch ...
Read more >
Expecting Value: Line 1 column 1 (char 0) - Python Pool
JSONDecodeError means there is an incorrect JSON format being followed. For instance, the JSON data may be missing a curly bracket, have a...
Read more >
Fix: json.decoder.jsondecodeerror: expecting value: line 1 ...
If you're working with APIs and trying to fetch or parse JSON data during HTTP or CURL requests, getting a properly formatted JSON...
Read more >
Git LFS Repositories - JFrog
One solution for all binaries: Once you are using Artifactory to store media assets there is no need to use a 3rd party...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found