Bee-Mar / mmpm

MagicMirror Package Manager
MIT License
196 stars 30 forks source link

BUG: guided-setup SystemD error #139

Closed TimoFrancke-cnic closed 10 months ago

TimoFrancke-cnic commented 1 year ago

When attempting to install MMPM GUI via guided-setup, get the following error after step "Enabling MMPM SystemdD daemon" ERROR: Failed to start MMPM SystemD service. See mmpm log for details

Attempting "mmpm log" returns

Traceback (most recent call last):
  File "/home/magic/.local/bin/mmpm", line 8, in <module>
    sys.exit(main())
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/entrypoint.py", line 12, in main
    _main_(args)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/mmpm.py", line 51, in main
    packages: Dict[str, List[MagicMirrorPackage]] = mmpm.core.load_packages(force_refresh=should_refresh)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/core.py", line 1069, in load_packages
    packages = json.load(db)
  File "/usr/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/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 1 column 2 (char 1)

Is this an issue with the CLI or GUI? CLI

Is this something that should be put in the Wiki? no

A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. install via PIP
  2. run the setup

Expected behavior for the systems service to start.

Screenshots If applicable, add screenshots to help explain your problem.

$ sudo systemctl status mmpm ● mmpm.service - MMPM Gunicorn daemon Loaded: loaded (/etc/systemd/system/mmpm.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2023-09-22 15:21:15 PDT; 4min 27s ago Process: 1721 ExecStart=/home/magic/.local/bin/gunicorn --worker-class gevent --bind localhost:7891 mmpm.wsgi:app --user=magic (code=exited, status=3) Main PID: 1721 (code=exited, status=3) Status: "Gunicorn arbiter booted" CPU: 7.977s

Sep 22 15:21:14 magicmirror gunicorn[1722]: File "/usr/lib/python3.9/json/decoder.py", line 353, in raw_decode Sep 22 15:21:14 magicmirror gunicorn[1722]: obj, end = self.scan_once(s, idx) Sep 22 15:21:14 magicmirror gunicorn[1722]: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) Sep 22 15:21:14 magicmirror gunicorn[1722]: [2023-09-22 15:21:14 -0700] [1722] [INFO] Worker exiting (pid: 1722) Sep 22 15:21:15 magicmirror gunicorn[1721]: [2023-09-22 15:21:15 -0700] [1721] [ERROR] Worker (pid:1722) exited with code 3 Sep 22 15:21:15 magicmirror gunicorn[1721]: [2023-09-22 15:21:15 -0700] [1721] [ERROR] Shutting down: Master Sep 22 15:21:15 magicmirror gunicorn[1721]: [2023-09-22 15:21:15 -0700] [1721] [ERROR] Reason: Worker failed to boot. Sep 22 15:21:15 magicmirror systemd[1]: mmpm.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED Sep 22 15:21:15 magicmirror systemd[1]: mmpm.service: Failed with result 'exit-code'. Sep 22 15:21:15 magicmirror systemd[1]: mmpm.service: Consumed 7.977s CPU time.

Operating System, Python3 Version, and Web Browser\ (Please complete the following information)

MMPM Environment Settings

MMPM Log Files

MagicMirror Config

TimoFrancke-cnic commented 1 year ago

oh, a raspberry Pi 3

Bee-Mar commented 1 year ago

@TimoFrancke-cnic The error snippet you provided isn't actually related to SystemD, and is addressed in the new version I'm uploading to PyPi at this moment. Please update when version 3.1 is available and see what happens after that

TimoFrancke-cnic commented 1 year ago

@Bee-Mar I have updated to 3.1, and completed the guided setup. However I still get a similar error when calling mmpm open --env per the ending text.

$ mmpm open --env
Traceback (most recent call last):
  File "/home/magic/.local/bin/mmpm", line 8, in <module>
    sys.exit(main())
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/entrypoint.py", line 12, in main
    _main_(args)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/mmpm.py", line 51, in main
    packages: Dict[str, List[MagicMirrorPackage]] = mmpm.core.load_packages(force_refresh=should_refresh)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/core.py", line 1069, in load_packages
    packages = json.load(db)
  File "/usr/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/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 1 column 2 (char 1)
Bee-Mar commented 1 year ago

Can you completely uninstall and reinstall mmpm?

python3 -m pip install --upgrade --force-reinstall mmpm

TimoFrancke-cnic commented 1 year ago

tried a full reinstall, still getting an error.

 $ mmpm open
Traceback (most recent call last):
  File "/home/magic/.local/bin/mmpm", line 8, in <module>
    sys.exit(main())
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/entrypoint.py", line 12, in main
    _main_(args)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/mmpm.py", line 51, in main
    packages: Dict[str, List[MagicMirrorPackage]] = mmpm.core.load_packages(force_refresh=should_refresh)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/core.py", line 1069, in load_packages
    packages = json.load(db)
  File "/usr/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/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 1 column 2 (char 1)

Tried a reboot, same output as far as I can see.

Traceback (most recent call last):
  File "/home/magic/.local/bin/mmpm", line 8, in <module>
    sys.exit(main())
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/entrypoint.py", line 12, in main
    _main_(args)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/mmpm.py", line 51, in main
    packages: Dict[str, List[MagicMirrorPackage]] = mmpm.core.load_packages(force_refresh=should_refresh)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/core.py", line 1069, in load_packages
    packages = json.load(db)
  File "/usr/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/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 1 column 2 (char 1)

I now fully deleted ~/.local/bin, and reinstalled with the force-reinstall flag. It didn't have to redownload since the files were already cached.

still the same error:

$ mmpm open
Traceback (most recent call last):
  File "/home/magic/.local/bin/mmpm", line 8, in <module>
    sys.exit(main())
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/entrypoint.py", line 12, in main
    _main_(args)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/mmpm.py", line 51, in main
    packages: Dict[str, List[MagicMirrorPackage]] = mmpm.core.load_packages(force_refresh=should_refresh)
  File "/home/magic/.local/lib/python3.9/site-packages/mmpm/core.py", line 1069, in load_packages
    packages = json.load(db)
  File "/usr/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/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 1 column 2 (char 1)
TimoFrancke-cnic commented 1 year ago

@Bee-Mar any suggestions?

Bee-Mar commented 10 months ago

@TimoFrancke-cnic version 4.0.0 has been released. This is a complete rework of the application with improvements and stability all-around. Please see How to Migrate to 4.x.x as well the rest of the pages in the Wiki