Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version v4.13.3 is making HA fail #2579

Closed
CancunManny opened this issue Oct 3, 2024 · 154 comments · Fixed by #2589
Closed

Version v4.13.3 is making HA fail #2579

CancunManny opened this issue Oct 3, 2024 · 154 comments · Fixed by #2589

Comments

@CancunManny
Copy link

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

I installed v4.13.3 and shortly after my HA kept loosing connection. I would re boot, it would work fine for a few minutes, then it would disconect.

To Reproduce

I used a full backup for HA for Sept 30th. Before the Alexa update I did a core update, assumed that caused the issue. Once I restored I didn't do the core update but did do the Alexa update. Few minutes later issue of disconnect started again.

Restored the Sept 30th backup again. This time I did the HA core update, but skipped the v4.13.3 update for Alexa. My HA has been stable for over 30 minutes now.

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

I would expect to install v4.13.3 and not have my HA system crash.

Screenshots

No screen shots

System details

  • Home Assistant version: Running HA via proxmox server. Updated to the last version
  • alexa_media version (from const.py or HA startup log): Stable version 4.13.2
  • alexapy version (from pip show alexapy in homeasssistant container or HA startup log):
  • Is Amazon 2FA/2SV enabled <!---We will not debug login issues if unanswered---> (y/n):
  • Amazon Domain:

Debug Logs (alexa_media & alexapy)
Please provide logs.

Additional context

@synologyy
Copy link

yes this updates make my system ERROR dont install this update!!!

@JackTalisker
Copy link

JackTalisker commented Oct 3, 2024

I have the same big issue.
HA goes to 100% CPU and begins to eat all the RAM.
System unusable after few seconds. No time enough to downgrade AMP.

Screenshot 2024-10-03 083906

@ocean90
Copy link

ocean90 commented Oct 3, 2024

Having the same issue! Had to reboot in safe mode (which took a few trials) and deactivate the integration.

It seems like then installing the old version makes HA stable again.

@LeoeLeoeL
Copy link

OUT OF MEMORY error and HA reboots every 5 minutes.
Now I disabled the integration; I hope is enough.

@drRobertDev
Copy link

after last update

2024-10-03 08:58:18.551 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7effb6ae7b50>, '/usr/local/lib/python3.12/site-packages/certifi/cacert.pem', None, None) inside the event loop by custom integration 'alexa_media' at custom_components/alexa_media/init.py, line 341: AlexaLogin( (offender: /usr/local/lib/python3.12/ssl.py, line 708: context.load_verify_locations(cafile, capath, cadata)), please create a bug report at https://github.com/alandtse/alexa_media_player/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/main.py", line 223, in
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component
result = await _async_setup_component(hass, domain, config)
File "/usr/src/homeassistant/homeassistant/setup.py", line 461, in async_setup_component
await asyncio.gather(
File "/usr/src/homeassistant/homeassistant/setup.py", line 463, in
create_eager_task(
File "/usr/src/homeassistant/homeassistant/util/async
.py", line 45, in create_eager_task
return Task(coro, loop=loop, name=name, eager_start=True)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 742, in async_setup_locked
await self.async_setup(hass, integration=integration)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/alexa_media/init.py", line 341, in async_setup_entry
AlexaLogin(

@AlexW75
Copy link

AlexW75 commented Oct 3, 2024

Same problem here HA restarts every 5min or when you give any commands to HA.

Rollback to 4.13.2 solves the issue.

The issue is NOT related to 2024.10.0 I am still on 2024.09.03 and have the problem.

I highly recommend to completely restart (including OS) after the rollback to version 4.13.2.
Otherwise you will still have a higher cpu and memory load than normal.

@DJBenson
Copy link

DJBenson commented Oct 3, 2024

I wondered why my HA was rebooting every couple of minutes :D

Rebooted the host and managed to get HACS to download 4.13.2 before it had chance to load the integration.

@dgoodman036
Copy link

Same here, HA kept rebooting. Managed to disable the integration, now running stable. I have not downgraded the integration yet, see how long a fix takes.

@Stepfal
Copy link

Stepfal commented Oct 3, 2024

Same Issue - had to restore HA - will skip that version for now ;)

@BertrumUK
Copy link

Same issue for me. Just rolled back to the previous version. Let’s see how stable it remains after.

@ProximusAl
Copy link

+1. 4.13.3 kills my HA also. Rolled back to 4.13.2

@adamlc
Copy link

adamlc commented Oct 3, 2024

Same issue here. Its so bad I can't even SSH into my server now to kill home assistant :(

@gunnarbeutner
Copy link

HA seems to hang as soon as this integration receives an event from Alexa. With debug logging enabled one of the last log messages is:

2024-10-03 09:53:23.680 DEBUG (MainThread) [alexapy.alexahttp2] Received raw message: Content-Type: application/json

{"directive":{"header":{"namespace":"Alexa.Mobile.Push","name":"RenderUpdate","messageId":"df03efc2-4369-46b3-b7c6-32407db0bf1e"},"payload":{"renderingUpdates":[{"route":"EventBus:tcomm::message","resourceId":"PUSH_VOLUME_CHANGE","resourceMetadata":"{\"command\":\"PUSH_VOLUME_CHANGE\",\"timeStamp\":1727942003611,\"payload\":\"{\\\"dopplerId\\\":{\\\"deviceSerialNumber\\\":\\\"523316EAF02E455EA280802DDFD3C6DB\\\",\\\"deviceType\\\":\\\"A2IVLV5VM2W81\\\"},\\\"volumeSetting\\\":25,\\\"isMuted\\\":false,\\\"destinationUserId\\\":\\\"ABLUB65K429CX\\\"}\"}"}]}}}
--------abcde123

I'm able to reproduce this either by opening the Alexa app or by saying "Alexa, what's the time?"

@C0rish
Copy link

C0rish commented Oct 3, 2024

Same issue! HA 2024.9.3 with v4.13.3 is killing my HA setup. CPU and memory usage explodes and HA reboots every few minutes!

@ChristophCaina
Copy link
Contributor

thanks for that information.
Seems that this is still ongoing and caused issues with 2024.10.0

Alexa MediaPlayer is now deactivated...

@CancunManny
Copy link
Author

@ChristophCaina The update just came out a few hours ago. One solution for now is to "deactivate" Alexa Media Player, but other solution would be to roll back to the previous version of AMP which is still working fine.

@Nisbo
Copy link

Nisbo commented Oct 3, 2024

Had the same issue with

    Core 2024.9.3
    Supervisor 2024.09.1
    Operating System 12.4
    Frontend 20240909.1

I got this from the supervisor, but not sure if it is related.

future: <Task finished name='Task-4474' coro=<HomeAssistantWebSocket.async_supervisor_event() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:322> exception=AttributeError("'NoneType' object has no attribute 'close'")>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 267, in async_send_message
    await self._client.async_send_command(message)
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
    return await self._futures[message["id"]]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 327, in async_supervisor_event
    await self.async_send_message(
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 269, in async_send_message
    await self._client.close()
          ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2024-10-03 10:01:32.573 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-4524' coro=<HomeAssistantWebSocket.async_send_message() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:254> exception=AttributeError("'NoneType' object has no attribute 'close'")>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 267, in async_send_message
    await self._client.async_send_command(message)
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
    return await self._futures[message["id"]]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 269, in async_send_message
    await self._client.close()
          ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2024-10-03 10:01:32.579 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-4525' coro=<HomeAssistantWebSocket.async_supervisor_event() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:322> exception=AttributeError("'NoneType' object has no attribute 'close'")>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 267, in async_send_message
    await self._client.async_send_command(message)
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
    return await self._futures[message["id"]]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 327, in async_supervisor_event
    await self.async_send_message(
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 269, in async_send_message
    await self._client.close()
          ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2024-10-03 10:01:32.582 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-4527' coro=<HomeAssistantWebSocket.async_supervisor_event() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:322> exception=AttributeError("'NoneType' object has no attribute 'close'")>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 267, in async_send_message
    await self._client.async_send_command(message)
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
    return await self._futures[message["id"]]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 327, in async_supervisor_event
    await self.async_send_message(
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 269, in async_send_message
    await self._client.close()
          ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2024-10-03 10:01:32.587 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-4528' coro=<HomeAssistantWebSocket.async_supervisor_event() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:322> exception=AttributeError("'NoneType' object has no attribute 'close'")>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 267, in async_send_message
    await self._client.async_send_command(message)
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 95, in async_send_command
    return await self._futures[message["id"]]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
supervisor.exceptions.HomeAssistantWSConnectionError: Connection was closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 327, in async_supervisor_event
    await self.async_send_message(
  File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 269, in async_send_message
    await self._client.close()
          ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
2024-10-03 10:01:32.823 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
2024-10-03 10:01:44.388 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2024-10-03 10:01:45.277 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-10-03 10:01:47.949 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to APIState(core_state='NOT_RUNNING', offline_db_migration=False)
2024-10-03 10:03:11.680 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to APIState(core_state='RUNNING', offline_db_migration=False)
2024-10-03 10:03:11.681 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance

@suprra
Copy link

suprra commented Oct 3, 2024

Can confirm, do not pull the trigger on this update : o

Core 2024.10.0
Supervisor 2024.09.1
Operating System 13.1
Frontend 20241002.2

@npa-homeassistant
Copy link

+1. 4.13.3 kills my HA also. Rolled back to 4.13.2

Silly newbie question: how did you roll back, please? Did you do it from HACS and simply select the earlier version? I get a warning if I do that, but I assume that I ignore that?

@Nisbo
Copy link

Nisbo commented Oct 3, 2024

+1. 4.13.3 kills my HA also. Rolled back to 4.13.2

Silly newbie question: how did you roll back, please? Did you do it from HACS and simply select the earlier version? I get a warning if I do that, but I assume that I ignore that?

Yes in HACS, click on the 3 dots --> download again and then select the old version.
grafik

Dont forget to restart HA afterwards.

@florianmulatz
Copy link

florianmulatz commented Oct 3, 2024

also successfully rolled back to 14.3.2 - did the trick perfectly!
Cheers

PS: This is the issue in ha-core since many guys thought the problem was related to the latest 2024.10.0 Update:

home-assistant/core#127395

@Leen15
Copy link

Leen15 commented Oct 3, 2024

Spent last hour looking why my HA keep crashing every 20 minutes after updated it to 2024.10...
I found then this issue!

@CancunManny
Copy link
Author

CancunManny commented Oct 3, 2024

@npa-homeassistant The tricky part can be to rollback before your HA stops responding. Seems it starts using up all the CPU and memory. I would guess those running on a raspberry pi would have less time to do the roll back than those that have a more robust system.

Being that you are a newbie like myself, my suggestion would be to do backups often. You don't need 20 different backups. I usually always have two backups. If I do a new backup today, i keep the one I had done before, but delete the rest.

@florianmulatz
Copy link

florianmulatz commented Oct 3, 2024

This is b

@npa-homeassistant The tricky part can be to rollback before your HA stops responding. Seems it starts using up all the CPU and memory. I would guess those running on a raspberry pi would have less time to do the roll back than those that have a more robust system

I suggest to just immediately disable the alexa-media-player integration so you've time to roll back to the older version

image

Cheers mate

@nephrotranz
Copy link

Seems it starts using up all the CPU and memory. I would guess those running on a raspberry pi would have less time to do the roll back than those that have a more robust system

Same here. CPU temperature went over 70 degrees Celsius.

@C0rish
Copy link

C0rish commented Oct 3, 2024

I assume to just immediately disable the alexa-media-player integration so you've time to roll back to the older version

This is definitely true, I can confirm this. Running HA as a virtual machine on a Synology NAS I had to ramp up the VMs memory to be fast enough to react inside HA.

@npa-homeassistant
Copy link

+1. 4.13.3 kills my HA also. Rolled back to 4.13.2

Silly newbie question: how did you roll back, please? Did you do it from HACS and simply select the earlier version? I get a warning if I do that, but I assume that I ignore that?

Yes in HACS, click on the 3 dots --> download again and then select the old version. grafik

Dont forget to restart HA afterwards.

Great - thank you very much. I'm doing it now.

@CancunManny
Copy link
Author

CancunManny commented Oct 3, 2024

@florianmulatz I am a newbie, and I keep learning from comments like yours. My 2 cents to your last comment is that once you do roll back to the correct version, the Alexa Meida player integration will still be disabled, and it won't show up on the regular devices and services page. Well it does show up, but it would be hidden on the right side where you have to click to show disabled integrations. I had disabled AMP for other reasons earlier on the day, and I couldn't seem to figure where to find it.

image

On the top right it shows "1 disabled show", for newbies like me it is easy to miss

@AlexW75
Copy link

AlexW75 commented Oct 3, 2024

@florianmulatz I am a newbie, and I keep learning from comments like yours. My 2 cents to your last comment is that once you do roll back to the correct version, the Alexa Meida player integration will still be disabled, and it won't show up on the regular devices and services page. Well it does show up, but it would be hidden on the right side where you have to click to show disabled integrations. I had disabled AMP for other reasons earlier on the day, and I couldn't seem to figure where to find it.

image

On the top right it shows "1 disabled show", for newbies like me it is easy to miss

on the button right top on you screenshot "SHOW"

@cash83
Copy link

cash83 commented Oct 4, 2024

Ciao.

Hi... Solarflow...Zendure😆😆😆

@sphinxlady
Copy link

14.3.3 appears to have been yanked to avoid anymore problems with it.

Little excitement in our others smooth smart home life.

@Kiwistream
Copy link

Thanks Team. Disabling Alexa worked for me.

@Chompy80
Copy link

Chompy80 commented Oct 5, 2024

Ended up having to delete this integration to get HASS to boot. Hopefully this will be fixed soon.

@nickrout
Copy link

nickrout commented Oct 5, 2024

Not likely is it?

@dpwood
Copy link
Contributor

dpwood commented Oct 5, 2024

Not likely is it?

There's already a PR which fixes it.

One line code change:

https://github.com/alandtse/alexa_media_player/pull/2589/files

Would be helpful if others would try it, and confirm this resolves it for them too.

@sambeetm
Copy link

sambeetm commented Oct 5, 2024

+1
Disabled for now.

@danielbrunt57
Copy link
Collaborator

Same Issue - had to full restore HAS and wasted 2 hours of my life. Alan & the Alexa Media team... Thank you for all you do BUT.... DO BETTER!

@lviciedo HOW DARE YOU!
FYI, there is no longer a developer, or a team!
And poor you that you wasted 2 hours! That's only 1/100 of the time I've devoted in the last 4 months trying to keep this integration alive. That's $10,000 of my time that I've given back, for free! If you can't afford to waste 2 hours, why are you using free software. Invest in a commercial product where you have a right to complain!

@RedDaveNY
Copy link

RedDaveNY commented Oct 5, 2024

same here. HA reload constant and out of memory:

2024-10-05 10:38:35.618 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args (PosixPath('/config/.storage/[email protected]'),) inside the event loop by custom integration 'alexa_media' at custom_components/alexa_media/__init__.py, line 361: await login.login(cookies=await login.load_cookie()) (offender: /usr/local/lib/python3.12/site-packages/aiohttp/cookiejar.py, line 118: with file_path.open(mode="rb") as f:), please create a bug report at https://github.com/alandtse/alexa_media_player/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 752, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/alexa_media/__init__.py", line 361, in async_setup_entry
    await login.login(cookies=await login.load_cookie())

@davidrule1969
Copy link

Same Issue - had to full restore HAS and wasted 2 hours of my life. Alan & the Alexa Media team... Thank you for all you do BUT.... DO BETTER!

@lviciedo HOW DARE YOU! FYI, there is no longer a developer, or a team! And poor you that you wasted 2 hours! That's only 1/100 of the time I've devoted in the last 4 months trying to keep this integration alive. That's $10,000 of my time that I've given back, for free! If you can't afford to waste 2 hours, why are you using free software. Invest in a commercial product where you have a right to complain!

After reading this I just wanted to stop by and say a BIG THANK YOU to @danielbrunt57! I appreciate every single second of the time you've put in working on this integration. You are an absolute gentlemen sir! This integration is wonderful and a much enjoyed part of my Home Assistant setup.

@dpwood
Copy link
Contributor

dpwood commented Oct 5, 2024

If you've come here to say "ME TOO":

There is a proposed fix, it is a simple change to one file. This integration is maintained by volunteers, so please help them by trying the fix rather than just disabling the integration. I can tell you it has worked for me.

https://github.com/alandtse/alexa_media_player/pull/2589/files

It appears to be specific to certain devices, so a community effort here would get the fix verified more quickly. The code maintainers obviously don't have the affected devices.

@lxffm
Copy link

lxffm commented Oct 5, 2024

Same Issue - had to full restore HAS and wasted 2 hours of my life. Alan & the Alexa Media team... Thank you for all you do BUT.... DO BETTER!

@lviciedo HOW DARE YOU! FYI, there is no longer a developer, or a team! And poor you that you wasted 2 hours! That's only 1/100 of the time I've devoted in the last 4 months trying to keep this integration alive. That's $10,000 of my time that I've given back, for free! If you can't afford to waste 2 hours, why are you using free software. Invest in a commercial product where you have a right to complain!

You are absolutely right, in every single word. I really appreciate your work and dedication. Please feel encouraged to further keep this integration alive. Don‘t give a cent on comments of this ungrateful fools which don‘t understand volunteership. It also took me some time to figure out which integration messes up, but thats not your fault but rather mine or the not to easy to read logs from homeassistant.

@Petro31
Copy link
Contributor

Petro31 commented Oct 5, 2024

Not likely is it?

There's already a PR which fixes it.

One line code change:

https://github.com/alandtse/alexa_media_player/pull/2589/files

Would be helpful if others would try it, and confirm this resolves it for them too.

I do not see how that PR would fix the infinite loop. Adding [:] to a list keeps the list identical and that's the only change in the PR.

e.g.

items = ['a','b']
for item in items:
  ...

is identical to

items = ['a','b']
for item in items[:]:
  ...

I think we have too many people relying on AI to submit PRs on this.

Although it is a way to keep the list static during the for loop. Looking at the comments it may actually fix it. However the original PR is still misusing the HA API.

@dpwood
Copy link
Contributor

dpwood commented Oct 5, 2024

Not likely is it?

There's already a PR which fixes it.
One line code change:
https://github.com/alandtse/alexa_media_player/pull/2589/files
Would be helpful if others would try it, and confirm this resolves it for them too.

I do not see how that PR would fix the infinite loop. Adding [:] to a list keeps the list identical and that's the only change in the PR.

e.g.

items = ['a','b']
for item in items:
  ...

is identical to

items = ['a','b']
for item in items[:]:
  ...

I think we have too many people relying on AI to submit PRs on this.

It's not the same. The [:] means it's going to be iterating over a copy of the list and that's the critical difference.

This is not an AI fix. I found it myself by analysis and testing. I do however share your wider concern.

If you mean the original code is misusing HA by doing blocking calls then you're right, but that's a separate issue, or have I misunderstood what you meant?

@realcanadrian
Copy link

I, too, found my HA crashing repeatedly due to the bug. But I’m not here complaining at the devs who put in their hard work for free. Especially for a HACS integration, which explicitly comes with a level of potential instability or risk that you must accept when installing it. I installed the latest version without waiting, without seeing how other people fared with it, and predictably that made me a Guinea pig. If you don’t want to be a Guinea pig, if you don’t want to be subject to these sorts of bugs, don’t install updates right away. In fact, maybe HACS just isn’t for you. Don’t come here bitching at the devs that put their metaphorical blood, sweat, and tears into free software for you.

@Petro31
Copy link
Contributor

Petro31 commented Oct 5, 2024

Not likely is it?

There's already a PR which fixes it.

One line code change:

https://github.com/alandtse/alexa_media_player/pull/2589/files

Would be helpful if others would try it, and confirm this resolves it for them too.

I do not see how that PR would fix the infinite loop. Adding [:] to a list keeps the list identical and that's the only change in the PR.

e.g.

items = ['a','b']

for item in items:

...

is identical to

items = ['a','b']

for item in items[:]:

...

I think we have too many people relying on AI to submit PRs on this.

It's not the same. The [:] means it's going to be iterating over a copy of the list and that's the critical difference.

This is not an AI fix. I found it myself by analysis and testing. I do however share your wider concern.

If you mean the original code is misusing HA by doing blocking calls then you're right, but that's a separate issue, or have I misunderstood what you meant?

Yes I meant the original PR. And yes I amended my comment about it being the same.

@fitoule
Copy link

fitoule commented Oct 5, 2024

same here reboot automatically every minutes ....
024-10-05 21:18:08.113 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f36073302d0>, '/usr/local/lib/python3.12/site-packages/certifi/cacert.pem', None, None) inside the event loop by custom integration 'alexa_media' at custom_components/alexa_media/init.py, line 341: AlexaLogin( (offender: /usr/local/lib/python3.12/ssl.py, line 708: context.load_verify_locations(cafile, capath, cadata)), please create a bug report at https://github.com/alandtse/alexa_media_player/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/main.py", line 223, in
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component
result = await _async_setup_component(hass, domain, config)
File "/usr/src/homeassistant/homeassistant/setup.py", line 461, in async_setup_component
await asyncio.gather(
File "/usr/src/homeassistant/homeassistant/setup.py", line 463, in
create_eager_task(
File "/usr/src/homeassistant/homeassistant/util/async
.py", line 45, in create_eager_task
return Task(coro, loop=loop, name=name, eager_start=True)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 742, in async_setup_locked
await self.async_setup(hass, integration=integration)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/alexa_media/init.py", line 341, in async_setup_entry
AlexaLogin(

@dpwood
Copy link
Contributor

dpwood commented Oct 5, 2024

same here reboot automatically every minutes ....

024-10-05 21:18:08.113 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f36073302d0>, '/usr/local/lib/python3.12/site-packages/certifi/cacert.pem', None, None) inside the event loop by custom integration 'alexa_media' at custom_components/alexa_media/init.py, line 341: AlexaLogin( (offender: /usr/local/lib/python3.12/ssl.py, line 708: context.load_verify_locations(cafile, capath, cadata)), please create a bug report at https://github.com/alandtse/alexa_media_player/issues

For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations

Traceback (most recent call last):

File "", line 198, in _run_module_as_main

File "", line 88, in _run_code

File "/usr/src/homeassistant/homeassistant/main.py", line 223, in

sys.exit(main())

File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main

exit_code = runner.run(runtime_conf)

File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run

return loop.run_until_complete(setup_and_run_hass(runtime_config))

File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete

self.run_forever()

File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever

self._run_once()

File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once

handle._run()

File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run

self._context.run(self._callback, *self._args)

File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component

result = await _async_setup_component(hass, domain, config)

File "/usr/src/homeassistant/homeassistant/setup.py", line 461, in _async_setup_component

await asyncio.gather(

File "/usr/src/homeassistant/homeassistant/setup.py", line 463, in

create_eager_task(

File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task

return Task(coro, loop=loop, name=name, eager_start=True)

File "/usr/src/homeassistant/homeassistant/config_entries.py", line 742, in async_setup_locked

await self.async_setup(hass, integration=integration)

File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup

result = await component.async_setup_entry(hass, self)

File "/config/custom_components/alexa_media/init.py", line 341, in async_setup_entry

AlexaLogin(

https://github.com/alandtse/alexa_media_player/pull/2589/files

@alandtse alandtse reopened this Oct 5, 2024
@sambeetm
Copy link

sambeetm commented Oct 5, 2024 via email

@jkfranks9
Copy link

I had some mixed results earlier today, but I just rebooted again with the one line change and all seems well.

I also added a log within the loop to output the device variable, and I get just 1 log for each of my devices each time the loop is executed. So it seems to be a good fix, at least for me.

@LJSand
Copy link

LJSand commented Oct 5, 2024

Some feedback on this : I have HA 2024.9.3 with v4.13.3. Same problem, one reboot every 15 minutes.

I applied the one line fix #2589. Seems stable again, no reboot since.

@snigehere
Copy link

I am happy to give it a test (I have 13 different alexa devices) but have already rolled back so don't have the updated version available to make the change. I am not a coder but have studio code server installed. Is there a package I could download that includes the fixed file for testing?

@simphide
Copy link

simphide commented Oct 5, 2024

Some feedback on this : I have HA 2024.9.3 with v4.13.3. Same problem, one reboot every 15 minutes.

I applied the one line fix #2589. Seems stable again, no reboot since.

Same for me - seems to be stable for at least an hour

@z-master42
Copy link
Contributor

@snigehere All custom integrations that you have downloaded are available as they are in their GitHub repository on your HA under config/custom_components. HACS is only a download vehicle.

@meute
Copy link

meute commented Oct 6, 2024

Some feedback on this : I have HA 2024.9.3 with v4.13.3. Same problem, one reboot every 15 minutes.

I applied the one line fix #2589. Seems stable again, no reboot since.

Same here, this fix seems to correctly solve the problem

@alandtse alandtse closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.