question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After update Homeassistant to 2021.12 this custom_component stops my configuration validation and ability to restart homeassistant

See original GitHub issue

Describe the bug Directly after updating to homeassistant 2012.12 I get when Itry to restart: image

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/alexa_media/__init__.py:16
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 21:30:06 (2 occurrences)
Last logged: 21:30:13

[140262684471056] function() argument 'code' must be code, not str
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/components/hassio/__init__.py", line 586, in async_handle_core_service
    errors = await conf_util.async_check_ha_config_file(hass)
  File "/usr/src/homeassistant/homeassistant/config.py", line 938, in async_check_ha_config_file
    res = await check_config.async_check_ha_config_file(hass)
  File "/usr/src/homeassistant/homeassistant/helpers/check_config.py", line 218, in async_check_ha_config_file
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 530, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 535, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/alexa_media/__init__.py", line 16, in <module>
    from alexapy import (
  File "/usr/local/lib/python3.9/site-packages/alexapy/__init__.py", line 16, in <module>
    from .alexaapi import AlexaAPI
  File "/usr/local/lib/python3.9/site-packages/alexapy/alexaapi.py", line 21, in <module>
    from alexapy.aiohttp import ClientConnectionError, ClientResponse
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/__init__.py", line 6, in <module>
    from .client import (
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/client.py", line 35, in <module>
    from . import hdrs, http, payload
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/http.py", line 7, in <module>
    from .http_parser import (
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/helpers.py", line 667, in <module>
    class CeilTimeout(async_timeout.timeout):
TypeError: function() argument 'code' must be code, not str

To Reproduce Steps to reproduce the behavior: Update home assistant to 2021.12 try to check config or restart

Expected behavior normal use of home assistant

Screenshots image

System details

  • Home-assistant (version): 2021.12
  • Installed via HACS: Also if I install latest beta via HACS (15) it wont reboot my hass

Logs Please provide logs. We’ll be most likely asking for them anyway.

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
sanderlvcommented, Dec 11, 2021

Complete reboot of the homeassistant OS solved this.

1reaction
ZuluWhiskeycommented, Dec 11, 2021

Related to #1462 by the looks of it - Same error code

Read more comments on GitHub >

github_iconTop Results From Across the Web

2022.12: It does matter!
You can now extend your Bluetooth range using Shelly devices, and a long-requested feature lands: Local Calendar.. For 2022, this is it!
Read more >
2021.12: New configuration menu, the button entity, and ...
The customization UI is the very bottom button on the Configuration page.
Read more >
Can't restart Home Assistant? - Frontend
When I try and restart HA after the 2021.12 update, I get an error: “Failed to call service homeassistant/restart. function() argument ...
Read more >
Troubleshooting your configuration
Whenever an integration or configuration option results in a warning, it will be stored in home-assistant.log in the configuration directory. This file is...
Read more >
2021.12: New configuration menu, the button entity, and ...
Home Assistant Core 2021.12, the final release of the year 2021; ... 10:29:27 WARNING (MainThread) [homeassistant.components.sensor.helpers] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found