HA never restarts with pyscript activated
See original GitHub issueI’m running HA 0.116.3 in a python3.8 venv on Ubuntu 18.04.
Installed pyscript via HASS and tried both options, UI Integration and pyscript
in configuration.yaml.
First script runs very well and i like it. BUT I cannot restart HA anymore. It looks like HA stops because there are no more new lines in home-assistant.log but my screen session where the hass process runs shows tons of tracebacks and i have to kill the process.
After removing from integration or in configuration.yaml, HA restart works normal.
...
Update for sensor.memory_use_percent fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for sensor.swap_use_percent fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for sensor.processor_use fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for media_player.mpd fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for media_player.mpd fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for weather.dark_sky fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for media_player.mpd fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for switch.433_keller fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for switch.lueften_keller fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for switch.playstation4 fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for switch.easyvdr_sound fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for switch.beaglebone fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for switch.e3dc fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
Update for switch.terra_nas fails
Traceback (most recent call last):
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/srv/ha/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/srv/ha/lib/python3.8/site-packages/homeassistant/core.py", line 350, in async_add_executor_job
task = self.loop.run_in_executor(None, target, *args)
File "/usr/lib/python3.8/asyncio/base_events.py", line 783, in run_in_executor
executor.submit(func, *args), loop=self)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 179, in submit
raise RuntimeError('cannot schedule new futures after shutdown')
RuntimeError: cannot schedule new futures after shutdown
...
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Pyscript - new integration for easy and powerful Python ...
Pyscript is a new integration that allows you to write Python functions and scripts that can implement a wide range of automation, logic...
Read more >python - How to make a script automatically restart itself?
It depends on what you mean by "restart itself." If you just want to continuously execute the same code, you can wrap it...
Read more >Upgrading vCenter Server 7.0 fails during precheck with " ...
ESXi hosts running 7.0 U2c/U2d outside of a vLCM image-enabled ... In this case, please restart the upgrade and the precheck will pass...
Read more >Manage device restarts after updates (Windows 10)
Use this policy to configure active hours, during which the device will not be restarted. This policy has no effect if the No...
Read more >Systemd Restart=always is not honored
systemd won't attempt any more automatic restarts ever for units with Restart ... from which point on, the restart logic is again activated....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, thanks, now I understand what the issue is. I thought it was not correctly restarting from the command-line (ie, quit and re-start
hass
manually), but you mean is doing a restart from the web interface. Yes, ^C not exiting the first time looks like a symptom of the same problem.I can recreate this now. Thanks - now off to debugging…
Issue is fixed, HA restarts. Thanks for this component and the fast fix.
But it works. 😄
EDIT: You’re right. It didn’t raise an error, but it didn’t work.