Version 0.29 sudden crash

Ever since I have updated to 0.92, my HA running on Raspberry Pi 3 experienced sudden crash few times. I have to SSH into the Pi to do reboot to make it run again. But then it will crash again few minutes or hours later.

The home-assistant.log file is around 9MB and contain so much notices/warnings/errors that I don’t even know what to look for.

Anyone else experience this?

I have the same thing when i look in to the error log there is a ssl-tls error or something that seems to come from the forecast.io api

i wonder if that is the problem or something else is happening

Error posted below
EDIT: http://pastebin.com/TVcaXxu3

Thanks, but I am not using forecast.io component.

In my log file, large chuck of the error is caused by homeassistant.components.sensor.imap. Underneath it contain extremely large chuck of NUL with black background (as seen in Notepad++). Here is the screenshot…

I am going to temporary remove the imap sensor and see how.

This is a problem with asyncio and 0.29, the devs are aware of it, in fact, it was mentioned that perhaps 0.29 should have been released as a beta instead of a public release due to the constant crashes.

I believe they have narrowed it down to automations that use templates as well as components that are not yet upgraded to use asyncio, but the only temporary resolution that was suggested is to disable automations that use templates, which obviously is not feasible for most people’s setup, so the only other option is to downgrade to 0.28.2 until the issues are resolved.

Mine was crashing every 15 minutes or so, but then I got it to run for almost a full 24 hours before it crashed, but it is simply random. At bootup, if you watch the logs, you should see errors referencing “template”, but again, there are a lot of things that are causing issues due to the drastic change from threaded to asynchronous

I downgraded yesterday and I have been running smoothly ever since. I am sure it will be resolved as quickly as possible as it seems to be the primary thing the devs are working on right now.

How can i downgrade? Is there a command or so?

I’d also like to downgrade. Getting segfaults even without templates in automation.

it ssems so that a quick search gave this to downgrade:

sudo pip3 install homeassistant==0.XX.X --upgrade

And if you installed with the “Raspberry Pi All-In-One Installer”

sudo su -s /bin/bash hass
source /srv/hass/hass_venv/bin/activate
pip3 install homeassistant==0.XX.X--upgrade 

Edit: It needed --upgrade flag

3 Likes

Did you have any success running the above command?

Yes, alive and kicking… downgraded to 0.28.2, that was my last

Those commands do work, but you may have to change it to reflect your install, as these commands assume you are running on a Raspberry Pi with the All-In-One installer

Here is what I run:

Stop HASS (just in case)

sudo systemctl stop home-assistant

Then copy and paste ALL of the following at once in the terminal:

sudo su -s /bin/bash hass <<‘EOF’
source /srv/hass/hass_venv/bin/activate
pip3 install --upgrade homeassistant==0.28.2
exit
EOF

It works well to put all of this into a bash script, with a variable input for the version number so that you can use this in future if you need to downgrade. I also have a script for this to upgrade easily as well:

The Upgrade Script:

Create a file called ha_upgrade:

sudo nano /usr/local/bin/ha_upgrade

Then paste the following:

#!/bin/bash

# Stop HASS
sudo systemctl stop home-assistant
# Become user 'hass'
sudo su -s /bin/bash hass <<'EOF'
# Activate the virtualenv
source /srv/hass/hass_venv/bin/activate
# Upgrade Home Assistant
pip3 install --upgrade homeassistant
exit
EOF
# Restart HASS
sudo systemctl start home-assistant

Then type CTRL-X, then Y and then Return

Then make it executable:

sudo chmod +x /usr/local/bin/ha_upgrade

Now you should be able to run the following from anywhere to upgrade:

ha_upgrade

The Downgrade Script:

Create a file called ha_downgrade:

sudo nano /usr/local/bin/ha_downgrade

Then paste the following:

#!/bin/bash

# Stop HASS
sudo systemctl stop home-assistant
# Become user 'hass'
sudo su -s /bin/bash hass <<'EOF'
# Activate the virtualenv
source /srv/hass/hass_venv/bin/activate
# Downgrade Home Assistant
pip3 install --upgrade homeassistant==$1
exit
EOF
# Restart HASS
sudo systemctl start home-assistant

(even though you are downgrading, you still need to include the --upgrade line. Its weird, but the install is going to “upgrade” all the dependencies, which in this case is actually upgrading to a previous version, so it seems counter intuitive, but it is necessary)

Then type CTRL-X, then Y and then Return

Then make it executable:

sudo chmod +x /usr/local/bin/ha_downgrade

Now you should be able to run the following from anywhere to downgrade:

ha_downgrade “0.28.2”

6 Likes

Thanks! Was having intermittent crashes since upgrading to 29.3. Downgraded to 28.2 and all is stable again.

Thanks everyone for your input. Glad to know I’m not alone. I really like the progress made in version 0.29. Unfortunately it is not working for me. I guess temporary solution for me is to downgrade back to 0.28. I really hope this issue will be ironed out in future versions.

Seeing this too FWIW, I am also downgrading for now.

We have just released 0.29.6 which should fix all the seg faults.

2 Likes

Sweet! I’ll give it a try and report back!

Before upgrading to 0.29.6, if you are on Raspberry Pi and tried to downgrade before to 0.28.2 and had problems with the downgrade, you may have not changed to the virtual environment before attempting a downgrade or installing as the root user using sudo, which may have installed into your systems copy of python3 dist-packages instead of the virtual environment site-packages. This is not good if you don’t fix it.

First, stop home-assistant from running, then using sudo, make sure you try an uninstall of home-assistant to ensure it is not in the system copy of python3’s dist-packages:

sudo pip3 uninstall homeassistant

Once it either tells you it is uninstalled, or tells you that there is nothing to uninstall, then you can feel confident that you can upgrade to 0.29.6 the correct way, by either using fabric or the instructions above in this thread.

So far 0.29.6 has been up for an hour. 0.29.5 crashed twice within just a few minutes for me, so things are looking promising.

Yay: now been running with installation updated to 0.29.6 for longer than any time previously today. The quick attention to this is very much appreciated. Thank you.

Yeah, I’ve only been upgraded now for maybe 15-20 minutes, but 0.29 - 0.29.5 was crashing for me at least once by now, so hoping this is finally fixed.

I am AMAZED by the speed difference. The boot up alone for my setup is 60% faster on my Raspberry Pi 2. It went from an average of 10 minutes to boot up to just about 4 minutes. That is absolutely shocking to me :smiley:

BTW, the HOT FIX listed on the 0.29 blog release says 0.29.5 for both 0.29.5 and 0.29.6… just a typo, but still should be fixed.

HOTFIX 0.29.5 - SEPTEMBER 30

   • Fix Climate Nest platform (@tchellomello, @jawilson)

HOTFIX 0.29.5 - OCTOBER 1

   • Fix segmentation fault (@bbangert, fixes #3453) 🎉
   • Fix nested templates in data_template would incorrectly get cached (@balloob)

With people reporting that segmentation faults seem to be a thing of the past with the release of 0.29.6 I finally upgraded too (from 0.28.2). Just like @jbardi, I am impressed! Things I’ve noticed so far:

  • when restarting HASS (from the command line), it seems to take about half as long for HASS to be up and running than it did with 0.28.2 (on a RPi 3)
  • the same goes for loading the history card of an entity by clicking on it in the UI
  • all the WorkerPool spam (especially at startup) in the HASS log is gone
  • CPU-load seems to be at least 30% lower

I was hoping it would also fix the slow performance I had noticed when using the Bluetooth LE tracker, but unfortunately that is not the case. I took it out of my config again for now and may open a seperate topic or issue to see if anyone’s noticed the same thing.

All in all: definitely a big step forward :smile: :clap:

1 Like