startechnica / apps

Community apps catalog for Kubernetes
Apache License 2.0
7 stars 5 forks source link

FreeRADIUS: MariaDB/MySQL Database not initalizing #67

Open ChristopherEdwardsNTC opened 5 months ago

ChristopherEdwardsNTC commented 5 months ago

Using the embedded MariaDB helm chart the Database won't initialize and allow FreeRADIUS to start.

MariaDB comes up clean and has the freeradius_db is created however no tables are created.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| freeradius_db      |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+
6 rows in set (0.004 sec)

MariaDB [(none)]> use freeradius_db;
Database changed
MariaDB [freeradius_db]> show tables;
Empty set (0.001 sec)

MariaDB [freeradius_db]>

command line used to deploy the helm chart:

helm install freeradius startechnica/freeradius --set mariadb.enabled=true --set mariadb.auth.password="radius" --set modsEnabled.sql.enabled=true

FreeRADIUS Logs:

FreeRADIUS Version 3.2.3
Copyright (C) 1999-2022 The FreeRADIUS server project and contributors
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License
For more information about these matters, see the file named COPYRIGHT
Starting - reading configuration files ...
Debug state unknown (cap_sys_ptrace capability not set)
systemd watchdog is disabled
Creating attribute Unix-Group
rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
Creating attribute SQL-Group
tls: Using cached TLS configuration from previous invocation
tls: Using cached TLS configuration from previous invocation
rlm_detail (auth_log): 'User-Password' suppressed, will not appear in detail output
rlm_mschap (mschap): using internal authentication
rlm_sql_mysql: libmysql version: 8.0.33
rlm_sql (sql): Attempting to connect to database "freeradius_db"
rlm_sql (sql): Initialising connection pool
rlm_sql (sql): Opening additional connection (0), 1 of 32 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql (sql): Opening additional connection (1), 1 of 31 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql (sql): Opening additional connection (2), 1 of 30 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql (sql): Opening additional connection (3), 1 of 29 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql (sql): Opening additional connection (4), 1 of 28 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql (sql): Processing generate_sql_clients
rlm_sql (sql) in generate_sql_clients: query is SELECT id, nasname, shortname, type, secret, server FROM nas
rlm_sql (sql): Reserved connection (0)
rlm_sql (sql): rlm_sql_mysql: ERROR 1146 (Table 'freeradius_db.nas' doesn't exist): 42S02
Failed to load clients from SQL
/etc/freeradius/mods-enabled/sql[27]: Instantiation failed for module "sql"

Please advise on how to initialize the database.

firmansyahn commented 5 months ago

This FreeRADIUS helm chart not yet capable to auto create required database dan tables. You need manually create those using this schema.