Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes if ~/.mech/data/index was broken #59

Open
dodo5522 opened this issue Jun 8, 2019 · 0 comments

Comments

@dodo5522
Copy link

dodo5522 commented Jun 8, 2019

If I mech up, the following log has come.

bash-3.2$ mech up
Traceback (most recent call last):
  File "/usr/local/bin/mech", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/mech/__main__.py", line 39, in main
    return Mech(arguments)()
  File "/usr/local/lib/python3.7/site-packages/mech/command.py", line 89, in __call__
    obj = klass(arguments)
  File "/usr/local/lib/python3.7/site-packages/mech/mech.py", line 602, in up
    utils.index_active_instance(instance_name)
  File "/usr/local/lib/python3.7/site-packages/mech/utils.py", line 458, in index_active_instance
    'path': path,
  File "/usr/local/lib/python3.7/site-packages/mech/utils.py", line 201, in settle_instance
    instances = json.loads(uncomment(fp.read()))
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 3 (char 4)

The error comes from broken index file. I can't know why the index was broken...

$ cat ~/.mech/data/index
{
  
$ 

I want to know how to recover by indication of log message like below.

$ mech up
Index file seems broken. Try to remove
/Users/takashi/.mech/data/index.
dodo5522 pushed a commit to dodo5522/mech that referenced this issue Jun 8, 2019
…erty name enclosed in double quotes if was broken
dodo5522 pushed a commit to dodo5522/mech that referenced this issue Aug 15, 2021
…erty name enclosed in double quotes if was broken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant