I get this warning message after installing 2024.8.3.
However when I run
sudo apt install sqlite3
It says
sqlite3 is already the newest version (3.37.2-2ubuntu0.3)
Does anyone know what I should do?
I get this warning message after installing 2024.8.3.
However when I run
sudo apt install sqlite3
It says
sqlite3 is already the newest version (3.37.2-2ubuntu0.3)
Does anyone know what I should do?
Update Ubuntu first?
I have Linux Mint 21.3, which is based on Ubuntu 22.04.
Many users will be on a 22.04 based system, which receives LTS (Long-Term Support) until 2027. One wonders why this wasnāt good enough, it includes v3.37.2 of sqlite
Iāve set the āCritical Repair promptā to ignored for now.
@bdraco , as you seem to be involved in the upcoming SQLite dependency version bump, could you provide insights?
Iām surprised about this warning in general. The SQLite client is pulled in via pip, not as an OS-provided client, right? (e.g., I donāt have any sqlite apt packages installed in my operating system).
If thatās so, then it is out-of-scope for the Home Assistant administrator to take care of updating SQLite. Instead, it will take place via an upcoming Home Assistant update.
We would need someone to make a long term commitment to testing and maintaining older versions until 2027, and dealing with writing any manual migrations that canāt be done on all versions to realistically be able to support old versions to make that happen.
SQLite is provided by the operating system in almost all cases. Python is generally linked against the SQLite provided by the operating system unless youāve compiled your own custom python, with its statically linked to a different version
I didnāt know that. Thank you for this clarification.
My Home Assistant Core installation runs on Ubuntu 22.04.4 LTS jammy (Raspberry Pi 4B).
Because Ubuntu 22.04ās apt package archives only provide Python 3.10, and because previous HA upgrades bumped the minimum Python version requirements to Python 3.12 currently (2024.8.x), I leverage Python3.12 from the deadsnakes PPA.
Assuming I understand the deadsnakes Python3.12 build process correctly, it uses Ubuntu 22.04ās āoriginalā libsqlite3-dev
, which will probably stay at version 3.37.2
.
Confirming command:
$ python3.12 -c 'import sqlite3;print(sqlite3.sqlite_version)'
3.37.2
# learned from https://discuss.python.org/t/will-sqlite3-be-updated-in-the-standard-library-to-address-fixed-cvss-vulnerabilities/48629
So in case the proposed amendment doesnāt make it, us Ubuntu 22.04 homelab users will have a long weekend in February 2025, or just shrug it off and peak/sunset at Home Assistant 2025.01.
Iāve realized I made a mistake to choose an LTS OS for my Home Assistant. Iām going to be migrating off of Ubuntu LTS personally. HA bumps dependencies way too quickly to work with an LTS OS properly. If you have to make it work with Deadsnakes (as I currently am as well) it defeats the purpose of LTS entirely.
Does anyone know which is the ācanonicalā linux distro the devs are chasing with these version upgrades?
I have been running Raspbian (on RPi 3B+), but this seems like a futile attempt for past several years.
Is there a way to set which sqlite is used? Iāve got sqlite 3.47 installed in /usr/local/bin
, and this is the default one on the command line:
>sudo su - homeassistant
$ sqlite3 -version
3.47.2 2024-12-07 20:39:59 2aabe05e2e8cae4847a802ee2daddc1d7413d8fc560254d93ee3e72c14685b6c (64-bit)
However, the Recorder code seems to use the 3.37 version installed at /usr/bin/sqlite3
. Iād much rather point HA at the local version than change my system sqlite. I canāt see any way to do this in the Recorder docs (Recorder - Home Assistant) - they only allow specifying a DB via the url schema.
Small update on this - Iāve managed to get the installed python to work with sqlite3:
(homeassistant) homeassistant@xxx:/srv/homeassistant$ python3
Python 3.13.1 (main, Dec 4 2024, 08:54:14) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import _sqlite3
>>> _sqlite3.sqlite_version
'3.47.2'
However, this isnāt picked up by homeassistant - anything I would need to do?
(for anyone else trying to do this, Iāve installed from source (SQLite Download Page) into /usr/local, and then added this to the bin/activate
script in /srv/homeassistant
:
...
export LD_LIBRARY_PATH=/usr/local/lib
OK, I now have things working!
Procedure:
compile && make && sudo make install
, it puts the new sqlite in /usr/local
.LD_LIBRARY_PATH=/usr/local/lib
, it should work OK. So:
export LD_LIBRARY_PATH=/usr/local/lib
and then run hass
bin/activate
script, but that doesnāt seem to be picked up by my current systemd setup, so Iāve added it to the systemd service definition as suggested here: https://www.sobyte.net/post/2023-02/systemd-binary-service-dynamic-linking/:...
Environment="LD_LIBRARY_PATH=/usr/local/lib"
Now, Iāve got HA running happily on Ubuntu 22.04.5 LTS.
Thank you for pulling this write up together! Iām up and running on SQLite 3.48 on Ubuntu 20.04 LTS!
Another big THANK YOU! Had tried many ways and quit until it had to happen. Up and running!
This did not work for me. Python ignores LD_LIBRARY_PATH for security reasons. I am surprised it worked on your system if you use HA core.
To make it work on core, I had to compile a local recent version of sqlite3, like you did. Then, I had to recompile my python executable used for the HA virtual environment and tweak the Makefile after configuration to add this flag to the link: -Wl,-rpath=/usr/local/lib
. Add this to the MODULE__SQLITE3_LDFLAGS= line in the makefile. This will instruct the python executable to look in your /usr/local/lib directory for the sqlite3 .so library. Thatās it.
In the file site-packages/homeassistant/components/recorder/util.py I changed the line
MIN_VERSION_SQLITE = _simple_version(ā3.40.1ā)
into
MIN_VERSION_SQLITE = _simple_version(ā3.37.2ā)
Thats it. No idea why they think they need 3.40
While the current code doesnāt rely on any features from newer versions yet, part of our process is to give everyone advance notice before making such changes. Once we start using newer features, as we plan to, you could risk ending up with a broken database if youāre not aligned with the supported version.
The minimum version 3.40 was introduced before it was necessary and without recognizing that for many systems 3.40 is not available.