swingmx / swingmusic

Swing Music is a beautiful, self-hosted music player for your local audio files. Like a cooler Spotify ... but bring your own music.
https://swingmx.com
MIT License
666 stars 41 forks source link

Unable to add any music folder #207

Closed gardiol closed 2 months ago

gardiol commented 2 months ago

Downloaded latest linux binary and i get, when starting:

------------------------------
SwingMusic 1.4.8 
Started app on:
➤ http://localhost:1970
------------------------------

Exception in thread Thread-1 (run_swingmusic):
Traceback (most recent call last):
  File "threading.py", line 1016, in _bootstrap_inner
  File "threading.py", line 953, in run
  File "manage.py", line 121, in run_swingmusic
  File "app/start_info_logger.py", line 29, in log_startup_info
  File "app/settings.py", line 40, in get_app_dir
273 INFO: Serving on http://[::1]:1970
273 INFO: Serving on http://127.0.0.1:1970
  File "posixpath.py", line 76, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType

App seems to be working, but every attempt to add any kind of folder result in:

78046 ERROR: Exception on /settings/add-root-dirs [POST]
Traceback (most recent call last):
  File "flask/app.py", line 2190, in wsgi_app
  File "flask/app.py", line 1486, in full_dispatch_request
  File "flask_restful/__init__.py", line 298, in error_router
  File "flask_restful/__init__.py", line 298, in error_router
  File "flask_restful/__init__.py", line 298, in error_router
  File "flask_cors/extension.py", line 165, in wrapped_function
  File "flask/app.py", line 1484, in full_dispatch_request
  File "flask/app.py", line 1469, in dispatch_request
  File "app/api/settings.py", line 98, in add_root_dirs
  File "app/db/sqlite/settings.py", line 42, in get_root_dirs
  File "app/db/sqlite/utils.py", line 91, in __enter__
  File "app/settings.py", line 112, in get_app_db_path
  File "app/settings.py", line 40, in get_app_dir
  File "posixpath.py", line 76, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType

Any idea on how to enable logs or get more info and fix this issue?

cwilvx commented 2 months ago

Hello @gardiol

Thanks for trying Swing Music. The errors indicate that the XDG config folder could not be automatically determined (a guess). Are you running it in a root kind of setting?

Anyway, try setting the config folder manually using --config:

# use fullpath
./swingmusic --config /home/user/.config

The config folder should exist before using the above.

gardiol commented 2 months ago

By manually specifying:

--config /data/daemons/swingmusic/.config

and mkdir'ing it, it worked.

I am running swing as user "swingmusic", but the .config was missing, so i guess that was the issue. I think swing should create it if missing or at least print a more meaningful message, just in case!

thanks!