home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.57k stars 30.74k forks source link

Amazon polly integration broken on 0.115.04 #40732

Closed mondomx closed 4 years ago

mondomx commented 4 years ago

The problem

Error when calling service: tts.amazon_polly_say

ValueError: Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Miguel'])

Environment

Problem-relevant configuration.yaml


  - platform: amazon_polly
    aws_access_key_id: (REDACTED)
    aws_secret_access_key: (REDACTED)
    voice: Miguel
    sample_rate: 24000 
    engine: standard

Traceback/Error logs


2020-09-28 17:10:31 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140658621668560] Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Miguel'])
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 124, in setter
    frame = id3[frameid]
  File "/usr/local/lib/python3.8/site-packages/mutagen/_util.py", line 537, in __getitem__
    return self.__dict[key]
KeyError: 'TPE1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 137, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1315, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1350, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 168, in async_say_handle
    url = await tts.async_get_url(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 341, in async_get_url
    filename = await self.async_get_tts_audio(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 368, in async_get_tts_audio
    data = self.write_tags(filename, data, provider, message, language, options)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 471, in write_tags
    tts_file["artist"] = ID3Text(encoding=3, text=artist)
  File "/usr/local/lib/python3.8/site-packages/mutagen/_file.py", line 74, in __setitem__
    self.tags[key] = value
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 222, in __setitem__
    return func(self.__id3, key, value)
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 126, in setter
    id3.add(mutagen.id3.Frames[frameid](encoding=3, text=value))
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_frames.py", line 65, in __init__
    setattr(self, checker.name,
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_frames.py", line 76, in __setattr__
    self._setattr(name, checker.validate(self, value))
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_specs.py", line 533, in validate
    raise ValueError('Invalid MultiSpec data: %r' % value)
ValueError: Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Miguel'])
2020-09-28 17:10:56 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140658621668560] Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Miguel'])
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 124, in setter
    frame = id3[frameid]
  File "/usr/local/lib/python3.8/site-packages/mutagen/_util.py", line 537, in __getitem__
    return self.__dict[key]
KeyError: 'TPE1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 137, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1315, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1350, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 168, in async_say_handle
    url = await tts.async_get_url(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 341, in async_get_url
    filename = await self.async_get_tts_audio(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 368, in async_get_tts_audio
    data = self.write_tags(filename, data, provider, message, language, options)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 471, in write_tags
    tts_file["artist"] = ID3Text(encoding=3, text=artist)
  File "/usr/local/lib/python3.8/site-packages/mutagen/_file.py", line 74, in __setitem__
    self.tags[key] = value
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 222, in __setitem__
    return func(self.__id3, key, value)
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 126, in setter
    id3.add(mutagen.id3.Frames[frameid](encoding=3, text=value))
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_frames.py", line 65, in __init__
    setattr(self, checker.name,
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_frames.py", line 76, in __setattr__
    self._setattr(name, checker.validate(self, value))
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_specs.py", line 533, in validate
    raise ValueError('Invalid MultiSpec data: %r' % value)
ValueError: Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Miguel'])
2020-09-28 17:11:01 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140658621668560] Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Miguel'])
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 124, in setter
    frame = id3[frameid]
  File "/usr/local/lib/python3.8/site-packages/mutagen/_util.py", line 537, in __getitem__
    return self.__dict[key]
KeyError: 'TPE1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 137, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1315, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1350, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 168, in async_say_handle
    url = await tts.async_get_url(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 341, in async_get_url
    filename = await self.async_get_tts_audio(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 368, in async_get_tts_audio
    data = self.write_tags(filename, data, provider, message, language, options)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 471, in write_tags
    tts_file["artist"] = ID3Text(encoding=3, text=artist)
  File "/usr/local/lib/python3.8/site-packages/mutagen/_file.py", line 74, in __setitem__
    self.tags[key] = value
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 222, in __setitem__
    return func(self.__id3, key, value)
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 126, in setter
    id3.add(mutagen.id3.Frames[frameid](encoding=3, text=value))
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_frames.py", line 65, in __init__
    setattr(self, checker.name,
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_frames.py", line 76, in __setattr__
    self._setattr(name, checker.validate(self, value))
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_specs.py", line 533, in validate
    raise ValueError('Invalid MultiSpec data: %r' % value)
ValueError: Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Miguel'])
2020-09-28 17:11:13 WARNING (MainThread) [homeassistant.components.automation.upstairs_hallway_light_timer_reset] Upstairs hallway light timer reset: Already running
2020-09-28 17:11:32 WARNING (MainThread) [homeassistant.components.automation.forced_sensor_updates_ticker_every_1_seconds] Forced Sensor Updates_ticker every 1 seconds: Already running
2020-09-28 17:15:30 WARNING (MainThread) [homeassistant.components.automation.forced_sensor_updates_ticker_every_1_seconds] Forced Sensor Updates_ticker every 1 seconds: Already running
2020-09-28 17:18:33 WARNING (MainThread) [homeassistant.components.automation.forced_sensor_updates_ticker_every_1_seconds] Forced Sensor Updates_ticker every 1 seconds: Already running
2020-09-28 17:20:32 WARNING (MainThread) [homeassistant.components.automation.forced_sensor_updates_ticker_every_1_seconds] Forced Sensor Updates_ticker every 1 seconds: Already running
2020-09-28 17:22:35 WARNING (MainThread) [homeassistant.helpers.entity] Update of image_processing.deepstack_object_front_yard_camera_static is taking over 10 seconds
2020-09-28 17:22:50 WARNING (MainThread) [homeassistant.components.automation.upstairs_hallway_light_timer_reset] Upstairs hallway light timer reset: Already running
2020-09-28 17:26:12 ERROR (MainThread) [snitun.multiplexer.core] Ping fails, no response from peer
2020-09-28 17:27:08 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140658621668560] Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Miguel'])
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 124, in setter
    frame = id3[frameid]
  File "/usr/local/lib/python3.8/site-packages/mutagen/_util.py", line 537, in __getitem__
    return self.__dict[key]
KeyError: 'TPE1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 137, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1315, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1350, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 168, in async_say_handle
    url = await tts.async_get_url(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 341, in async_get_url
    filename = await self.async_get_tts_audio(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 368, in async_get_tts_audio
    data = self.write_tags(filename, data, provider, message, language, options)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 471, in write_tags
    tts_file["artist"] = ID3Text(encoding=3, text=artist)
  File "/usr/local/lib/python3.8/site-packages/mutagen/_file.py", line 74, in __setitem__
    self.tags[key] = value
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 222, in __setitem__
    return func(self.__id3, key, value)
  File "/usr/local/lib/python3.8/site-packages/mutagen/easyid3.py", line 126, in setter
    id3.add(mutagen.id3.Frames[frameid](encoding=3, text=value))
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_frames.py", line 65, in __init__
    setattr(self, checker.name,
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_frames.py", line 76, in __setattr__
    self._setattr(name, checker.validate(self, value))
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_specs.py", line 533, in validate
    raise ValueError('Invalid MultiSpec data: %r' % value)
ValueError: Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Miguel'])

Additional information

None

mondomx commented 4 years ago

Duplicated with https://github.com/home-assistant/core/issues/40731