Panic: runtime error: HAOS RPI4

When i try go to terminal i get this error.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1f1e54]

goroutine 1 [running]:
crypto/tls.init()
	/opt/hostedtoolcache/go/1.19.13/x64/src/crypto/tls/alert.go:53 +0x4
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1f1e54]

goroutine 1 [running]:
crypto/tls.init()
	/opt/hostedtoolcache/go/1.19.13/x64/src/crypto/tls/alert.go:53 +0x4

I think this i related to the error of the stream error i have got for a while.
The system im using is a Raspberry Pi 4 with HAOS it also has a 64gb storage addon.

Looks like the go written HA CLI crashes. Could be some disk corruption or similar.

1 Like

Agree. Smells of disk or memory access problems. Both can be caused by lo power on the Pi bus or by a disk flaking out?

Id start with the usual suspects for Pi4
Does the supervisor or host log have any undervolt warning? (if so attack the power first)

Are you using an SD card with more than a few months on it as main storage - look there first.

Either way the community is here to help, troubleshooting pi is common enough the community made a cookbook item:

1 Like

thank you for the replies. My power supply is ok stated by the home assistant but what you said in this quote

Are you using an SD card with more than a few months on it as main storage - look there first.

got me to speculate that the 64GB sd card plugged to to an adapter to act as a storage.
It did have to go to safe mode because the config.yaml was filled with unknown characters. I used the google Drive Backup Addon to get a earlier state and it was working fine until i added the Ring addon. From that date i have been getting the panic error and also in the system the invalid config.

Invalid config

The following integrations and platforms could not be set up:

* [stream](https://www.home-assistant.io/integrations/stream) ([Show logs](https://MyFakeInstanceURL:8123/config/logs?filter=stream))
* [default_config](https://www.home-assistant.io/integrations/default_config) ([Show logs](https://MyFakeInstanceURL:8123/config/logs?filter=default_config))

Please check your config and [logs](https://MyFakeInstanceURL:8123/config/logs).

Obviously i masked my URL by typing https://MyFakeInstanceURL:8123. If your also wondering my config will be undereath here with masked stuff aswell.

# Loads default set of integrations. Do not remove.
default_config:


# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24

device_tracker:
  - platform: bt_smarthub
    host: 192.168.1.254
    new_device_defaults:
      track_new_devices: true



automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

switch:
  - platform: rpi_gpio
    switches:
      - port: 14
        name: "RPI Cooling Fan"
        unique_id: "rpi_cooling_fan"

climate:
  - platform: generic_thermostat
    name: RPI Cooling Fan Controller
    unique_id: rpi_cooling_fan_controller
    heater: switch.rpi_cooling_fan
    target_sensor: sensor.cpu_temperature
    min_temp: 40
    max_temp: 80
    ac_mode: true
    target_temp: 50
    cold_tolerance: 0.5
    hot_tolerance: 0.5
    min_cycle_duration:
      seconds: 120
    keep_alive:
      minutes: 5
    initial_hvac_mode: "cool"
    
alexa_media:
  accounts:
    - email: !secret amazon_user
      password: !secret amazon_password
      url: amazon.co.uk

recorder:
  db_url: mysql://USERNAME:PASSWORD@core-mariadb/homeassistant?charset=utf8mb4

I dont know if this is related also but my local URL is on HTTPS instead of HTTP. I use Duckdns and NGINX. I get this following error in the network settings aswell

Invalid local network URL
You have configured an HTTPS certificate in Home Assistant. This means that your internal URL needs to be set to a domain covered by the certificate.

This is usually indicative of a disk corruption. I wouldn’t trust anything on this box unless you restored to a backup before this happened… …to new storage.

Id also be replacing that SD card (with SSD)

Ok! thank you so much! Im wondering, could i use a hard disk instead of a ssd? Im trying to do a low budget hub.

Yes.

The reason I don’t recommend SD is the tech. The way SDs write to the card there is a shelf life. (yes even the class 10 extended wear cards - extended wear not NO wear) It’s incredibly long and for most normal humans they never hit the end. But HA at its core is a transactional database. It’s ALWAYS writing. (how much depends on how aggressively you manage your recorder database) all that constant write wears out an SD. Fact. How long,? Dunno-Complex combination of quality of card and your install. Personally I simply prefer to avoid it entirely. No SD card.

SSD and HDD are completely different tech and do not have that limit. (they fail for r completely different reasons :joy:)

With an HDD you’ll likely run into power issues. And with both of those options I’d probably run the from a POWERED external USB hub (not the same hub you run your coordinator sticks on yo isolate interference)

Thank you! Will be much appreciated.