Closed yorb closed 1 week ago
File "/config/custom_components/alexa_media/init.py", line 18, in
from alexapy import ( File "/usr/local/lib/python3.12/site-packages/alexapy/init.py", line 16, in from .alexaapi import AlexaAPI File "/usr/local/lib/python3.12/site-packages/alexapy/alexaapi.py", line 23, in from .alexalogin import AlexaLogin File "/usr/local/lib/python3.12/site-packages/alexapy/alexalogin.py", line 35, in from bs4 import BeautifulSoup File "/usr/local/lib/python3.12/site-packages/bs4/init.py", line 37, in from .builder import ( File "/usr/local/lib/python3.12/site-packages/bs4/builder/init.py", line 626, in from . import _html5lib File "/usr/local/lib/python3.12/site-packages/bs4/builder/_html5lib.py", line 21, in import html5lib File "/usr/local/lib/python3.12/site-packages/html5lib/init.py", line 25, in from .html5parser import HTMLParser, parse, parseFragment
AMP is trying to import from the alexapy
library and that seems to be where it's going south on you.
Check pip show alexapy
in the HA container. From SSH session to homeassisstant
you can sudo docker exec -it homeassistant bash
to get into the main container environment and that's where alexapy
lives.
The alexapy
python package resides in /usr/local/lib/python/3.12/site-packages/alexapy
and I suspect it's somehow messed up or missing. If it's there and pip
shows the correct version then maybe deleting __pycache__
in that folder and restarting HA will resolve it...
@danielbrunt57 Thanks for the reply, that makes sense but so far I've only used the Terminal & SSH add-on which doesn't have docker, so from some googling it looks like I need to go a level deeper. Are these the instructions I should follow? I'm running HA OS on a pi, if it matters.
I'm using the Terminal & SSH add-on and I'm running Home Assistant OS on HA "Blue" ODROID N2+ and I have the docker
command. Have you tried the command via SSH and it failed?
The instructions you reference allow you to access the host via external SSH on port 22222 thus bypassing the need to run sudo docker exec -t homeassistant bash
from the standard SSH connection that takes you inside the Advanced SSH & Web Terminal
add-on docker container which only exposes the config
directory from the homeassistant
container.
Same exact issue. I just did an upgrade to Alexapy (sudo pip install alexapy --upgrade), and restarted HA. Solved the issue, in case any others are running into this.
Finally getting back to this. Thanks @danielbrunt57, yes, I had tried docker
and even just sudo
and they weren't available, but that's because I was using Terminal & SSH, and not Advanced Terminal & SSH. The commands you provided worked fine in the second one. I imagine the external SSH instructions I found would have worked too, but just swapping one add-on for another was easy.
pip show alexapy
indeed returned nothing, so I installed it as @pappaloo did and then re-added AMP and everything is working again. It seems like uninstalling AMP must have removed alexapy, and then reinstalling it for some reason did not reinstall alexapy. Not sure what happened there.
Thanks for your help!
Always happy to help when I can!
IMPORTANT: Please search the issues, including closed issues, and the FAQ before opening a new issue. The template is mandatory; failure to use it will result in issue closure.
Describe the bug
After downloading from HACS and attempting to install the integration, the following error is shown:
To Reproduce
.storage
(pickle, config files), and restartExpected behavior
The setup config flow starts.
Screenshots
System details
const.py
or HA startup log): N/A (can't install) but observed with v4.13.7 and v4.13.8 from HACSpip show alexapy
in homeasssistant container or HA startup log): N/ADebug Logs (alexa_media & alexapy) Please provide logs.
Note the logs above are without any AMP-specific logging added. If I add the
logger
config entry as per the link above, no errors are output at all since this is ERROR-level and comes from HA, not AMP. The FAQ should probably be updated to help users add logging for setup errors.Additional context
I don't know when this started, but AMP was previously working just fine and one day I noticed it stopped (my devices were unavailable). I deleted and attempted to reinstall the integration and this started. I've tried removing all traces of AMP including deleting from HACS and redownloading (with several reboots in between), but the error is the same. So either there is some kind of critical bug in AMP setup (unlikely since this has been going on for weeks and no one else has reported it) or there is some leftover file in my installation that I don't know about. The "bad marshal data" seems like a generic python issue that is usually resolved by clearing out
__pycache__
, but since I've tried deleting AMP and redownloading it I'm not really sure where else it could be storing these binaries.The UI error is the same as #2293, but the cause looks different so I'm creating a new issue.