home-assistant / supervisor

:house_with_garden: Home Assistant Supervisor
https://home-assistant.io/hassio/
Apache License 2.0
1.75k stars 639 forks source link

PyMySQL Package missing for MariaDB Database Connection #1328

Closed Veldkornet closed 5 years ago

Veldkornet commented 5 years ago

Home Assistant release with the issue:

0.100.2

Operating environment (HassOS/Generic):

Hass.io 64-bit on a RaspberryPi 3

Supervisor logs:

19-10-13 09:57:46 INFO (MainThread) [hassio.updater] Fetch update data from https://version.home-assistant.io/stable.json
19-10-13 10:24:41 INFO (MainThread) [hassio.homeassistant] Update Home Assistant to version 0.100.2
19-10-13 10:24:41 INFO (SyncWorker_5) [hassio.docker.interface] Update image homeassistant/raspberrypi3-64-homeassistant:0.100.1 to homeassistant/raspberrypi3-64-homeassistant:0.100.2
19-10-13 10:24:41 INFO (SyncWorker_5) [hassio.docker.interface] Pull image homeassistant/raspberrypi3-64-homeassistant tag 0.100.2.
19-10-13 10:27:48 INFO (SyncWorker_5) [hassio.docker.interface] Stop homeassistant application
19-10-13 10:28:49 INFO (SyncWorker_5) [hassio.docker.interface] Clean homeassistant application
19-10-13 10:28:50 INFO (SyncWorker_8) [hassio.docker.homeassistant] Start homeassistant homeassistant/raspberrypi3-64-homeassistant with version 0.100.2
19-10-13 10:29:51 INFO (MainThread) [hassio.homeassistant] Home Assistant pip installation in progress
19-10-13 10:32:41 INFO (MainThread) [hassio.homeassistant] Home Assistant pip installation done
19-10-13 10:32:51 INFO (MainThread) [hassio.homeassistant] Home Assistant pip installation in progress
19-10-13 10:34:27 INFO (MainThread) [hassio.homeassistant] Home Assistant pip installation done
19-10-13 10:34:32 INFO (MainThread) [hassio.homeassistant] Home Assistant pip installation in progress
19-10-13 10:35:32 INFO (MainThread) [hassio.homeassistant] Home Assistant pip installation done
19-10-13 10:35:42 INFO (MainThread) [hassio.homeassistant] Detect a running Home Assistant instance
19-10-13 10:35:42 INFO (MainThread) [hassio.homeassistant] Successful run Home Assistant 0.100.2
19-10-13 10:35:42 INFO (SyncWorker_6) [hassio.docker.interface] Cleanup images: ['homeassistant/raspberrypi3-64-homeassistant:0.100.1']
19-10-13 10:37:46 INFO (MainThread) [hassio.host.info] Update local host information
19-10-13 10:37:46 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/hostname1
19-10-13 10:37:46 INFO (MainThread) [hassio.host.services] Update service information
19-10-13 10:37:46 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.systemd1.Manager.ListUnits on /org/freedesktop/systemd1
19-10-13 10:37:47 INFO (MainThread) [hassio.host.network] Update local network DNS information
19-10-13 10:37:47 INFO (MainThread) [hassio.utils.gdbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/NetworkManager/DnsManager
19-10-13 10:37:56 INFO (SyncWorker_5) [hassio.docker.interface] Restart homeassistant/raspberrypi3-64-homeassistant
19-10-13 10:39:15 INFO (MainThread) [hassio.homeassistant] Detect a running Home Assistant instance

Description of problem: When setting up the recorder to use an external MariaDB database as per documentation with the below connection url: mysql+pymysql://user:password@SERVER_IP:PORT/DB_NAME?charset=utf8

Home Assistant fails to connect to the database because it cannot initiate pymysql.

When checking for the package with the below command, it’s noted that the package is already installed: pip3 install pymysql

However, if you install the package PyMySQL, the integration works correctly: pip3 install PyMySQL

Problem is that because the package is not included in the image, I need to install it each time HomeAssistant has an update.

pvizeli commented 5 years ago

We use the C implementation. Look into documentation of the add-on

Veldkornet commented 5 years ago

I was following the HomeAssistant documentation. So if the documentation is incorrect, then fine, but then that should be fixed.

omegacore commented 4 years ago

Similar issue. Not sure where to turn. Documentation doesn't say anything about setting up the Recorder component to use MariaDB on an external server with hassio. Assumes you have access to the same python env as homeassistant.