Skip to content

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

Open
@dodo5522

Description

@dodo5522

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions