Problem: v2.14.12 seems to ignore MySQL configuration
Issue
When upgrading from v2.14.11 to v2.14.12, semaphore seems to ignore my MySQL configuration:
Loading config
Validating config
Executing migration v2.14.12 (at 2025-06-06 11:02:30.995324699 +0000 UTC)...
time="2025-06-06T13:02:31+02:00" level=warning msg="\n ERR! Query: create index task__output_time_idx on task__output (time);\n\n"
time="2025-06-06T13:02:31+02:00" level=fatal msg="Error 1 (HY000): Can't create/write to file '/var/lib/mysql/mysql-tmp/ibr2JWrh' (Errcode: 2 \"No such file or directory\")"
I have the config set through SEMAPHORE_DB_* settings and it works with this configuration on v2.14.11, also if I roll back to that release.
At the very start of the log it says:
Pinging database on sql.mydomain.com port 3306...
So it does seem to pick it up first, but later falls back to trying localhost.
Impact
Configuration
Installation method
Docker
Database
MySQL
Browser
Firefox
Semaphore Version
v2.14.12
Ansible Version
Logs & errors
No response
Manual installation - system information
No response
Configuration
No response
Additional information
No response
It looks like some migration issue.
Still having the same problem with v2.15.0
There was a comment by @als5 that suggested manually deleting an index, but the comment is gone now, was it removed because it is not a good solution?
@jeroenrnl
There was a comment by @als5 that suggested manually deleting an index, but the comment is gone now, was it removed because it is not a good solution?
I didn't see it.
Do you have index task__output_time_idx in your database?
I tested this migration many times and it works fine.
How many records do you have in task__output? I tested on 9M records and it works fine.
MariaDB [semaphore]> show index from task__output;
+--------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |
+--------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
| task__output | 0 | PRIMARY | 1 | id | A | 128618 | NULL | NULL | | BTREE | | | NO |
| task__output | 1 | task_id | 1 | task_id | A | 198 | NULL | NULL | | BTREE | | | NO |
+--------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+
2 rows in set (0.000 sec)
MariaDB [semaphore]> select count(*) from task__output;
+----------+
| count(*) |
+----------+
| 120090 |
+----------+
1 row in set (0.028 sec)
@jeroenrnl so, the index wasn't created.
Just for test, can you create it manually?
create index task__output_time_idx on task__output (time);
I have no idea what the problem is this. May it be disk space issue?
MariaDB [semaphore]> create index task__output_time_idx on task__output (time);
ERROR 1 (HY000): Can't create/write to file '/var/lib/mysql/mysql-tmp/ib3Wtv79' (Errcode: 2 "No such file or directory")
Turns out, that my mysql-tmp dir was missing and apparently MariaDB doesn't recreate it... I recreated it, restarted the container (v2.15.4 now) and now it created the index by itself.
Thanks for pointing me in the right direction! It's fixed now!