-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Receiving SMS is causing crash of HomeAssistant #54876
Comments
Hey there @ocalvo, mind taking a look at this issue as it has been labeled with an integration ( sms documentation |
I'm using a "Teltonika TRM240" as a modem if that information can be of any use, and it has been working fine in both receiving and sending SMS in Core 2021.6.6. ( https://teltonika-networks.com/product/trm240/ ) After sending an SMS I usually get the balance of the account back as an SMS from the service provider and it causes Home Assistant to crash. |
Can you paste the debug logs? |
Maybe silly question.. But how do I do that? "logger: However.. It deleted everything up until the restart. couldnt see anything before that. |
Did these: and tail -f homeassistant.log And nothing is logged before the Core reboot when it receives the SMS. |
The supervisor log is writing this right after the crash.. Maybe normal at reboot? |
Any progress in reproducing this? |
I think I have. But very hard to tell without logs. |
Upgraded to core-2021.9.2 and the problem persists. |
Still same problem with core-2021.9.5 Is there anything I can do to assist? The logs are purged at each crash. |
The fix is submitted but you need to wait until October |
This should be closed by #54237 |
Running 2021.9.7 (which includes #54237) in Docker on Ubuntu 18.04 using a Huawei USB Modem E220 (sim unlocked) this continues to be an issue. Note: I have the GSM signal strength indicator enabled via the integration.
Logged before crash:
Logged after crash / restart:
As can be seen in the logs, the SMS is retrieved and processed correctly on restart. |
None of this suggests a problem with the SMS integration. |
I have an automation using the incoming sms event:
it runs after the SMS is collected by polling after the crash / restart occurs. I'm aware that nothing in the logs indicates the core issue , however the only time that I have this issue is when an SMS is received in any version after 2021.6.6 (which I remained on until today). I can replicate this at will simply by sending my system an SMS message, which is obviously less than ideal. |
What is in the action? Do you see any of the actions getting executed? |
I've just quickly tested after :
I should have some time available to run some further tests tomorrow if there's anything in particular to look for with my limited knowledge. I wonder whether @glith is also seeing this on 2021.9.7 and whether there's some common hardware at play?. |
I've run one last final test using debug as the logger default and checked the log.1 file.
Initial head entries from log after restart show that it was a crash:
The unfinished recorder session was from the startup prior to the message (after enabling debugging) - section from that log:
I'm out of my depth here - this feels like it must be related to the docker change between 2021.6.6 and 2021.7.x but it is clearly tied to the receipt of an SMS. |
I suspect that the gammu worker thread is crashing and then tearing down the entire python process. |
@TazUk just to clarify:
|
|
Should not. Maybe a function from the external library calls exit(0) on an error or misleading handling. Maybe the dmesg will show you why it got killed |
core-2021.9.7 is still having the problem. Sending works. Receiving crashes. |
Can you try running |
That command isn't recognised when I run it within the container - I'm using HA Container in docker. Should I be running it within a particular path? |
I have updated the docs to reflect that modem SIM800C does not work at the moment. |
A positive change in 2021.9.7... I do now receive the SMS.. But core keeps crashing. ha host logs from it happens: [347953.331691] audit: type=1334 audit(1632299899.683:579): prog-id=205 op=LOAD [347953.331738] audit: type=1334 audit(1632299899.683:580): prog-id=206 op=LOAD [347953.524072] audit: type=1334 audit(1632299899.879:581): prog-id=206 op=UNLOAD [347953.524084] audit: type=1334 audit(1632299899.879:582): prog-id=205 op=UNLOAD` |
|
@pvizeli It seems the core does not enable the python fault handler. Is there a reason why not? @glith Can you set the environment variable |
I was able to repro this in my development environment. As suspected the ReadDevice() call is crashing the process. This is a bug in gammu. I will be following up with a new issue against gammu.
|
Good new, I have a fix and it is very simple. Please review the change. |
The problem
When I receive a SMS, HomeAssistant crashes and restarts.
What is version of Home Assistant Core has the issue?
core-2021.8.8
What was the last working version of Home Assistant Core?
core-2021.6.6
What type of installation are you running?
Home Assistant OS
Integration causing the issue
SMS notifications via GSM-modem
Link to integration documentation on our website
https://www.home-assistant.io/integrations/sms/
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: