Homeassistant & Music Assistant

Creating a bug report/issue

Required Information

  • DietPi version |
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=11
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
    G_LIVE_PATCH_STATUS[0]=‘not applicable’

  • Distro version | bullseye 0

  • Kernel version | Linux DietPi 5.15.76-v8+ #1597 SMP PREEMPT Fri Nov 4 12:16:41 GMT 2022 aarch64 GNU/Linux

  • SBC model | RPi4

  • Power supply used | Official PiHut 5v / 3A

  • SD card used | SSD

Additional Information (if applicable)

  • Software title | Homeassistant
  • Was the software title installed freshly or updated/migrated? Upgraded, but only to see if it would resolve the issue
  • Can this issue be replicated on a fresh installation of DietPi? Yes

Steps to reproduce

  1. Install HA
  2. Install HACS
  3. Once HACS installed, add Music Assistant
  4. Restart HA
  5. Add integration of Music Assistant

Expected behaviour

  • Not throw an error and function as it should

Actual behaviour

  • Says “Failed to set up. Check the logs”

Extra details

  • The logs say:
Logger: homeassistant.config_entries
Source: deps/lib/python3.9/site-packages/sqlalchemy/engine/cursor.py:164
First occurred: 12:40:57 (2 occurrences)
Last logged: 12:42:27

Error setting up entry Music Assistant for mass
Traceback (most recent call last):
  File "/home/homeassistant/.pyenv/versions/3.9.15/lib/python3.9/site-packages/homeassistant/config_entries.py", line 365, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/mnt/dietpi_userdata/homeassistant/custom_components/mass/__init__.py", line 197, in async_setup_entry
    raise exc
  File "/mnt/dietpi_userdata/homeassistant/custom_components/mass/__init__.py", line 190, in async_setup_entry
    await mass.setup()
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/music_assistant/mass.py", line 79, in setup
    await self.database.setup()
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/music_assistant/controllers/database.py", line 43, in setup
    await self._migrate()
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/music_assistant/controllers/database.py", line 216, in _migrate
    await self.set_setting("version", str(SCHEMA_VERSION))
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/music_assistant/controllers/database.py", line 60, in set_setting
    return await self.insert(
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/music_assistant/controllers/database.py", line 137, in insert
    return await self.get_row(table, lookup_vals)
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/music_assistant/controllers/database.py", line 115, in get_row
    return await self._db.fetch_one(sql_query, match)
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/databases/core.py", line 148, in fetch_one
    return await connection.fetch_one(query, values)
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/databases/core.py", line 257, in fetch_one
    return await self._connection.fetch_one(built_query)
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/databases/backends/sqlite.py", line 120, in fetch_one
    metadata = CursorResultMetaData(context, cursor.description)
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.9/site-packages/sqlalchemy/engine/cursor.py", line 164, in __init__
    (
ValueError: not enough values to unpack (expected 5, got 4)

I have also installed sqlalchemy as this was missing in the HA PIP3 environment and this didn’t make any difference.

I appreciate that this is specific to the integration and not the installation and also have raised an issue over on their GH repo asking the same MA - Failed to Setup · Issue #1000 · music-assistant/hass-music-assistant · GitHub

This was resolved by uninstalling home assistant and starting from scratch again. Must read the documentation more thoroughly before doing things like this :smiley:

2 Likes