Quick update on what is going on with the 0.29 release

The 0.29 release includes an upgraded core for Home Assistant based on asyncio instead of threads+locks. This however seems to cause segfaults in certain Linux-based scenario’s. Segfault means that the Python interpreter crashes, which is out of Home Assistants control to recover from. The GitHub issue about this can be found here.

The good news is that @lwis managed to get a repro in Docker. So we can now debug it. However even if we’re able to find the root cause, the odds are small that we’re able to get this resolved by changing the way the Home Assistant core runs but hopefully we can get it fixed for a future version of Python.

We’ve also started looking at avoiding the problem for now. Ben suggested we try to use Python package txaio to allow running on different async engines. This is still being explored.

If all of this fails, we’ll have to add our old core back to Home Assistant. This will increase the maintenance burden moving forward and is something we really really don’t want. That’s why we are still exploring all the other options.

For now, I expect the release to be delayed at least till the next weekend. If you haven’t gotten a response yet on your PR - it’s because a lot of us are focussing on the segfault issue.

We’ll keep you updated.

Paulus

22 Likes

Been following the hard work you’ve been doing on this issue on GitHub. I want to extend my thanks to the entire team for their tireless efforts. I know how badly you wanted the anniversary edition to be out on time but the wait to sort out the asynchronous I/O seg faults is well worth it.

3 Likes

Thanks for keeping us updated. I’m sure I wasn’t the only one wondering why the usual cadence seemed off!

If there is any testing that needs to be done and I can be of assistance, let me know how I can help. I can spin up another test instance to help out.

0.29 has been released, thanks for your patience! https://home-assistant.io/blog/2016/09/29/async-sleepiq-emoncms-stocks/

3 Likes

Very nice! It’d be very interested to know what turned out to be the ultimate reason for the segfaults. I didn’t find any specific commit that seemed related, maybe I’m just blind :slight_smile:

Take a look at this thread:

I see there is a couple of posts in that thread that there are still some segfaults occurring. Are those unique to that user? Should we, the regular non-dev users, go ahead with this update?

YMMV. I upgraded and I have had one or two minor issues so far. Not sure if they are segfaults but I did lose access to the GUI while HA appeared to still be running. But to be fair, I have a lot of templates and that was part of the issue. I’ll have to do more testing.

I also noticed a breaking change that wasn’t mentioned for Wink users; the config use to include the access token and the refresh token but now leaving the refresh token in the config causes Wink to not load. I just commented it out and restarted and now Wink is fine and my GoControl motion sensors are now showing the temp readings as a separate sensor, so win.

1 Like

I guess I’ll give it a go and throw in a prayer to boot. :slight_smile: My setup is still really simple at this point, so hopefully it all works as expected.

One more thing…Restart from the GUI appears to be broken.

That’s a non-issue for me. I always have a term window open with an ssh session going to my server so I just issue the cli command.

Hi,

Just a quick question. Home Assistent keeps crashing one and a while after updating it to 0.29.x (I believe I’m on 1.29.5). My configuration isn’t changed and the previous version (0.28.x) run smoothly. The configuration passed the configuration check. I’m running on a rpi 3.

If I look at the logs (even in debug mode) it shows no error relevant to the crash (not even using debug logging), so I’m not quite sure what’s going on. Any ideas where to look next?

Also, is there an easy way to downgrade (if just for the time being)?

I’m also getting segmentation faults with no config change since upgrading to v0.29.x. I am running a pi2. I’d also like to downgrade if possible as I have this running several important automation tasks.

To downgrade to preferred version;
pip3 install homeassistant==0.XX.X

3 Likes

Thank you!

The seg fault issue has been resolved in 0.29.6!

I would have to agree! Been running 0.29.6 for several hours now- no SEGVs, where previously I would see them in just a few minutes. Great job to HA devs for working so hard to fix this!

Yep - been chugging away for over four hours now without an issue. I did get the following error on startup, though it doesn’t appear to be affecting anything I can see directly. I can’t tell what is referring to, but I am a bit concerned that it mentions async.py:

16-10-01 17:02:01 asyncio: Exception in callback run_callback_threadsafe.<locals>.run_callback() at /srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/async.py:144
handle: <Handle run_callback_threadsafe.<locals>.run_callback() at /srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/async.py:144>
Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/template.py", line 99, in async_render
    return self._compiled.render(kwargs).strip()
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/jinja2/sandbox.py", line 329, in getattr
    value = getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'None' has no attribute 'attributes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run
    self._callback(*self._args)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/async.py", line 147, in run_callback
    future.set_result(callback(*args))
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/template.py", line 101, in async_render
    raise TemplateError(err)
homeassistant.exceptions.TemplateError: UndefinedError: 'None' has no attribute 'attributes'
16-10-01 17:02:01 homeassistant.components.sensor.template: UndefinedError: 'None' has no attribute 'attributes'

Any ideas what might be causing this? I didn’t see this until the 0.29.x update.

No expert, but from the stack trace this looks like a pure template issue to me.

1 Like