InvalidFieldValue: Field "supported_commands"

Open Beginner friendly
#278 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start by checking the declared aiosendspin dependency version, then inspect aiosendspin/client/client.py at _handle_json_message, where the server message is parsed. Confirm support for the seek and seek_relative commands added in aiosendspin 6.1.0, and verify that the reported server/state message no longer produces InvalidFieldValue errors.

Written by the indexing model from the issue text.

Description

Just installed this as a daemon to give it a go and saw this in the logs, it does seem to work still but thought I should flag it.

After having a bit of a dig in the code, looks like this is happening because the aiosendspin dependency is out of date, we're on 6.0.5 and the seek and seek_relative types being sent by Music Assistant 2.10.1 were added in 6.1.0.

Sep 03 21:34:19 pi3 sendspin[687461]: ERROR:aiosendspin.client.client:Failed to parse server message: {"payload":{"controller":{"supported_commands":["unshuffle","repeat_all","seek_relative","repeat_off","volume","next","previous","mute","repeat_one","pause","stop","switch","play","shuffle"],"volume":86,"muted":false,"repeat":"off","shuffle":false}},"type":"server/state"}
Sep 03 21:34:19 pi3 sendspin[687461]: Traceback (most recent call last):
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 9, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]:   File "/home/sendspin/.local/share/uv/python/cpython-3.12.14-linux-aarch64-gnu/lib/python3.12/enum.py", line 751, in __call__
Sep 03 21:34:19 pi3 sendspin[687461]:     return cls.__new__(cls, value)
Sep 03 21:34:19 pi3 sendspin[687461]:            ^^^^^^^^^^^^^^^^^^^^^^^
Sep 03 21:34:19 pi3 sendspin[687461]:   File "/home/sendspin/.local/share/uv/python/cpython-3.12.14-linux-aarch64-gnu/lib/python3.12/enum.py", line 1170, in __new__
Sep 03 21:34:19 pi3 sendspin[687461]:     raise ve_exc
Sep 03 21:34:19 pi3 sendspin[687461]: ValueError: 'seek_relative' is not a valid MediaCommand
Sep 03 21:34:19 pi3 sendspin[687461]: During handling of the above exception, another exception occurred:
Sep 03 21:34:19 pi3 sendspin[687461]: Traceback (most recent call last):
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 16, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 11, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]: mashumaro.exceptions.InvalidFieldValue: Field "supported_commands" of type list[MediaCommand] in ControllerStatePayload has invalid value ['unshuffle', 'repeat_all', 'seek_relative', 'repeat_off', 'volume', 'next', 'previous', 'mute', 'repeat_one', 'pause', 'stop', 'switch', 'play', 'shuffle']
Sep 03 21:34:19 pi3 sendspin[687461]: During handling of the above exception, another exception occurred:
Sep 03 21:34:19 pi3 sendspin[687461]: Traceback (most recent call last):
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 9, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 18, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]: mashumaro.exceptions.InvalidFieldValue: Field "controller" of type Optional[ControllerStatePayload] in ServerStatePayload has invalid value {'supported_commands': ['unshuffle', 'repeat_all', 'seek_relative', 'repeat_off', 'volume', 'next', 'previous', 'mute', 'repeat_one', 'pause', 'stop', 'switch', 'play', 'shuffle'], 'volume': 86, 'muted': False, 'repeat': 'off', 'shuffle': False}
Sep 03 21:34:19 pi3 sendspin[687461]: During handling of the above exception, another exception occurred:
Sep 03 21:34:19 pi3 sendspin[687461]: Traceback (most recent call last):
Sep 03 21:34:19 pi3 sendspin[687461]:   File "/home/sendspin/.local/share/uv/tools/sendspin/lib/python3.12/site-packages/aiosendspin/client/client.py", line 823, in _handle_json_message
Sep 03 21:34:19 pi3 sendspin[687461]:     message = ServerMessage.from_json(data)
Sep 03 21:34:19 pi3 sendspin[687461]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 4, in __mashumaro_from_json__
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 8, in __unpack_ServerMessage__dfdf45fabe2d4dfaaa6a72d5101d132d
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 11, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]: mashumaro.exceptions.InvalidFieldValue: Field "payload" of type ServerStatePayload in ServerStateMessage has invalid value {'controller': {'supported_commands': ['unshuffle', 'repeat_all', 'seek_relative', 'repeat_off', 'volume', 'next', 'previous', 'mute', 'repeat_one', 'pause', 'stop', 'switch', 'play', 'shuffle'], 'volume': 86, 'muted': False, 'repeat': 'off', 'shuffle': False}}
Dominant language
Python
Stars
190
Forks
36
Avg merge
11d 19h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Sendspin/sendspin-python-cli

All issues in Sendspin/sendspin-python-cli

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.