home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.73k stars 28.88k forks source link

<jemalloc>: Unsupported systeom page size on raspberry pi 5 with container image 2023.12.2 #105768

Closed lethargosapatheia closed 6 months ago

lethargosapatheia commented 6 months ago

The problem

Hi,

I've come across this error:

s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
Fatal Python error: _PyRuntimeState_Init: memory allocation failed
Python runtime state: unknown

When running Home Assistant 2023.12.2 on a Raspberry Pi 5 (4GB RAM). The error seems to be identical to this here: https://github.com/home-assistant/core/issues/34162, which has apparently been solved.

I'm running Raspberry Pi OS based on Debian 12 with docker version 20.10.24+dfsg1.

Linux raspberrypi 6.1.0-rpi7-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

This is how I'm starting the container:

version: '3'
services:
  homeassistant:
    image: ghcr.io/home-assistant/home-assistant:2023.12.2
    container_name: homeassistant
    restart: always
    volumes:
      - home-assistant-config:/config
    devices:
      - /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_b83b51746245ed119f0fca8f0a86e0b4-if00-port0:/dev/zigbeeDongle
    environment:
      - TZ=Europe/London
    networks:
      - iot
volumes:
  home-assistant-config:
    name: "home-assistant-config"
networks:
  iot:
    driver: bridge

Any ideas are welcome.

What version of Home Assistant Core has the issue?

2023.12.2

What was the last working version of Home Assistant Core?

n/a

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

lbineau commented 6 months ago

I've got the same issue, fresh Raspbian install following the official way to install HomeAssistant on RPi 5 with Docker.

lethargosapatheia commented 6 months ago

Funnily enough it works if I install Ubuntu 23.10 (with raspi imager). But I do want to be able to use rasp pi os, as it's lighter.

lbineau commented 6 months ago

I've found the solution here https://www.home-assistant.io/installation/alternative#optimizations Jemalloc is not available on raspbian it seems so it is possible to deactivate it when installing it with docker

lethargosapatheia commented 6 months ago

I forgot to mention that I did come across this too after installing Ubuntu. I would like to have it enabled though, if it's supposed to preserve RAM memory. Even on podman (which runs fedora core os in the background) on Mac OS it works.

lbineau commented 6 months ago

Yeah I completely agree it would be better to have it working than deactivate the optimization functionality. I hope someone will have the answer, please keep me posted if you find the solution :-)

frenck commented 6 months ago

Fixed in: https://github.com/home-assistant/docker-base/pull/248

Workaround available by disabling optimizations as documented: https://www.home-assistant.io/installation/alternative#optimizations

../Frenck

kitopopo commented 6 months ago

Dear friends,

Today i have installed hoome assistant docker version in a raspberry pi 5 8gb, the container restarts every 5 secons. I found the alternative solution and have added in docker-compose.yaml: " DISABLE_JEMALLOC=true " ... under of environment. Now the container starts correctly and home assistant works correctly. I can read in this post that it was in Fixed in: home-assistant/docker-base#248, maybe i must wait a new home assistan version 2023.4 in order to be able can use jemalloc?

Thanks in advanced.

Best regards

lethargosapatheia commented 6 months ago

Fixed in: home-assistant/docker-base#248

Workaround available by disabling optimizations as documented: https://www.home-assistant.io/installation/alternative#optimizations

../Frenck

@frenck I'm not very clear here, but what image will this change be part of?

@kitopopo disabling jemalloc, yes, works, but the point is to profit from better memory management.

kitopopo commented 6 months ago

Fixed in: home-assistant/docker-base#248

Workaround available by disabling optimizations as documented: https://www.home-assistant.io/installation/alternative#optimizations

../Frenck

@frenck I'm not very clear here, but what image will this change be part of?

@kitopopo disabling jemalloc, yes, works, but the point is to profit from better memory management.

Thanks for your answer. Yes, i have readed that is better use Jemalloc for memory management but i think that at the moment isn't possible. Maybe @frenck can solve the problem in new docker versions? Thanks in advanced.

kitopopo commented 6 months ago

Dear @frenck @lethargosapatheia ,

I just tested the new version of home assistant 2024.1.0 and we still have the same problem, it is still necessary to disable jemalloc so that the container does not constantly restart. Should we reopen the issue since the problem is not resolved?

Thanks in advanced,

Best regards

lethargosapatheia commented 6 months ago

I've no idea, I'm not clear at all about @frenck's reply. There is no information about the container images in the link related to the MR. So, yeah, I'm not sure why he closed the issue when it's clearly not solved.

kitopopo commented 5 months ago

Dear friend @lethargosapatheia, After upgrade yesterday home assistant core container to 2024.1.3 the jemalloc problem has not yet been solved, it is still necessary to disable jemalloc inside docker-compose.yaml. Due to we have no news from @frenck , and this issue is not reopened, I am going to proceed to open a new issue so that the problem is resolved since more than 1 month has passed and we do not have a solution for raspberry pi 5. Best regards

frenck commented 5 months ago

As per above: https://github.com/home-assistant/core/issues/105768#issuecomment-1858205767

Fixed in: https://github.com/home-assistant/docker-base/pull/248

Workaround available by disabling optimizations as documented: https://www.home-assistant.io/installation/alternative#optimizations

It is expected to become generally available in the 2024.2 release.

and this issue is not reopened

This issue doesn't need to be re-opened, as the issue has been fixed.

resolved since more than 1 month has passed and we do not have a solution for raspberry pi 5

The Raspberry Pi 5 is not yet officially supported by the Home Assistant project. Please look at our blogs for more information and updates.

../Frenck

kitopopo commented 5 months ago

As per above: https://github.com/home-assistant/core/issues/105768#issuecomment-1858205767

Fixed in: https://github.com/home-assistant/docker-base/pull/248

Workaround available by disabling optimizations as documented: https://www.home-assistant.io/installation/alternative#optimizations

It is expected to become generally available in the 2024.2 release.

and this issue is not reopened

This issue doesn't need to be re-opened, as the issue has been fixed.

resolved since more than 1 month has passed and we do not have a solution for raspberry pi 5

The Raspberry Pi 5 is not yet officially supported by the Home Assistant project. Please look at our blogs for more information and updates.

../Frenck

Dear friend, thanks for your answer. We will then wait for version 2024.2. thanks in advance, best regards