srichter / asksonic

An Alexa skill to play music from Subsonic API compatible music servers
MIT License
59 stars 17 forks source link

python error when attempting to start #1

Closed swensonator closed 3 years ago

swensonator commented 3 years ago

Trying to run asksonic with navidrome. I have swag running for my reverse proxy and it works as expected on port 443.

I get the following error, regardless of whether I run asksonic locally or on Heroku.

08:44:05 web.1  | started with pid 1908524
08:44:05 web.1  | [2021-08-20 08:44:05 -0400] [1908526] [INFO] Starting gunicorn 20.1.0
08:44:05 web.1  | [2021-08-20 08:44:05 -0400] [1908526] [INFO] Listening at: http://0.0.0.0:5000 (1908526)
08:44:05 web.1  | [2021-08-20 08:44:05 -0400] [1908526] [INFO] Using worker: sync
08:44:05 web.1  | [2021-08-20 08:44:05 -0400] [1908528] [INFO] Booting worker with pid: 1908528
08:44:05 web.1  | [2021-08-20 08:44:05 -0400] [1908528] [ERROR] Exception in worker process
08:44:05 web.1  | Traceback (most recent call last):
08:44:05 web.1  |   File "/home/*****/.local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
08:44:05 web.1  |     worker.init_process()
08:44:05 web.1  |   File "/home/*****/.local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 134, in init_process
08:44:05 web.1  |     self.load_wsgi()
08:44:05 web.1  |   File "/home/*****/.local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
08:44:05 web.1  |     self.wsgi = self.app.wsgi()
08:44:05 web.1  |   File "/home/*****/.local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
08:44:05 web.1  |     self.callable = self.load()
08:44:05 web.1  |   File "/home/*****/.local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
08:44:05 web.1  |     return self.load_wsgiapp()
08:44:05 web.1  |   File "/home/*****/.local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
08:44:05 web.1  |     return util.import_app(self.app_uri)
08:44:05 web.1  |   File "/home/*****/.local/lib/python3.8/site-packages/gunicorn/util.py", line 359, in import_app
08:44:05 web.1  |     mod = importlib.import_module(module)
08:44:05 web.1  |   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
08:44:05 web.1  |     return _bootstrap._gcd_import(name[level:], package, level)
08:44:05 web.1  |   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
08:44:05 web.1  |   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
08:44:05 web.1  |   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
08:44:05 web.1  |   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
08:44:05 web.1  |   File "<frozen importlib._bootstrap_external>", line 848, in exec_module
08:44:05 web.1  |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
08:44:05 web.1  |   File "/home/*****/navidrome_docker/asksonic/asksonic/__init__.py", line 21, in <module>
08:44:05 web.1  |     from . import intents
08:44:05 web.1  |   File "/home/*****/navidrome_docker/asksonic/asksonic/intents/__init__.py", line 1, in <module>
08:44:05 web.1  |     from asksonic.utils.queue.queue_manager import QueueManager
08:44:05 web.1  |   File "/home/*****/navidrome_docker/asksonic/asksonic/utils/queue/queue_manager.py", line 8, in <module>
08:44:05 web.1  |     from asksonic.utils.subsonic.track import Track
08:44:05 web.1  |   File "/home/*****/navidrome_docker/asksonic/asksonic/utils/subsonic/__init__.py", line 2, in <module>
08:44:05 web.1  |     from .api import Subsonic
08:44:05 web.1  |   File "/home/*****/navidrome_docker/asksonic/asksonic/utils/subsonic/api.py", line 6, in <module>
08:44:05 web.1  |     from .track import Track
08:44:05 web.1  |   File "/home/*****/navidrome_docker/asksonic/asksonic/utils/subsonic/track.py", line 5, in <module>
08:44:05 web.1  |     class Track():
08:44:05 web.1  |   File "/home/*****/navidrome_docker/asksonic/asksonic/utils/subsonic/track.py", line 82, in Track
08:44:05 web.1  |     def metadata(self) -> dict[str, str]:
08:44:05 web.1  | TypeError: 'type' object is not subscriptable
08:44:05 web.1  | [2021-08-20 08:44:05 -0400] [1908528] [INFO] Worker exiting (pid: 1908528)
08:44:05 web.1  | [2021-08-20 08:44:05 -0400] [1908526] [INFO] Shutting down: Master
08:44:05 web.1  | [2021-08-20 08:44:05 -0400] [1908526] [INFO] Reason: Worker failed to boot.

Before I started trying to debug the code myself, I figured I would ask here.

srichter commented 3 years ago

It's due to your environment being Python 3.8; Asksonic requires 3.9. It should work in Heroku as the runtime.txt specifies 3.9.5. Is the error the same on Heroku?

srichter commented 3 years ago

Closing this for now, feel free to reopen it if you're still having trouble