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

emsm fails with JSON Decoder error #88

Open
SilkAndSlug opened this issue Aug 7, 2019 · 1 comment
Open

emsm fails with JSON Decoder error #88

SilkAndSlug opened this issue Aug 7, 2019 · 1 comment

Comments

@SilkAndSlug
Copy link
Contributor

This affects at least the guard, worlds, and backups plugins. Everytime I call emsm, I get the below error.

EMSM: Uncaught exception:
 > Exception: JSONDecodeError
 > Module     /usr/lib/python3.7/json/decoder.py
 > Message:   Expecting value: line 1 column 1 (char 0)
 > A full traceback can be found in the log file.

The log ends with:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/emsm/__init__.py", line 41, in run
    app.setup()
  File "/usr/local/lib/python3.7/dist-packages/emsm/core/application.py", line 327, in setup
    self._plugins.init_plugins()
  File "/usr/local/lib/python3.7/dist-packages/emsm/core/plugins.py", line 399, in init_plugins
    plugin = plugin_type(self._app, name)
  File "/usr/local/lib/python3.7/dist-packages/emsm/plugins/guard.py", line 224, in __init__
    self._load_guard_db()
  File "/usr/local/lib/python3.7/dist-packages/emsm/plugins/guard.py", line 324, in     _load_guard_db
    self._guard_db = json.load(file)
  File "/usr/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.7/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)

This has been happening for the past few days (since 15:01 BST, 2019-08-06). From that log, I guess I upgraded the JSON package, and it's got a bug. It's a show-stopper for EMSM, hence I've raised it here.

@SilkAndSlug
Copy link
Contributor Author

I've been poking. The above stacktrace leaves EMSM via guard.py#324, which references plugin_data/guard/errors.json. On my server, that file is empty. Changing it to an empty object:

{
}

fixed the problem. I don't know why the file was empty -- it's not empty in my backups.

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

No branches or pull requests

1 participant