Title
#fleet
t

Tor Houghton

12/16/2021, 9:25 AM
A question about upgrading to 4.7.0; I get the following when I did docker-compose run fleetdm fleet prepare db Missing migrations: tables=[20211116184030 20211202092042 20211202181033 20211207161856], data=[]. 2021/12/16 09:23:34 FAIL 20211202092042_RemovePolicyHistory.go (create policy membership table: Error 1005: Can't create table
fleet
.
policy_membership
(errno: 121 "Duplicate key on write or update")), quitting migration.
Lucas Rodriguez

Lucas Rodriguez

12/16/2021, 11:27 AM
Hi Tor! I don't think it's related to file carving, let me take a look.
11:49 AM
Q: Did you upgrade from v4.6.2?
11:56 AM
When you ran
prepare db
did you get a prompt after the
Missing migrations: tables=...
text?
Press Enter to continue, or Control-c to exit.
If so the WARNING message with the missing migrations is expected, now checking what might have caused the
FAIL
.
11:57 AM
Also, what MySQL database are you using and which version?
t

Tor Houghton

12/16/2021, 5:01 PM
Hoi Lucas! Yes, upgrading from 4.6.2; and yep, I got a prompt (and didn't press ctrl c 😃).
5:03 PM
The version is mysqld 10.3.31-MariaDB-0+deb10u1
Lucas Rodriguez

Lucas Rodriguez

12/16/2021, 5:05 PM
OK, thanks for the info, I'll create an issue right away. It could be an incompatibility issue with MariaDB.
t

Tor Houghton

12/16/2021, 5:07 PM
at this point i have no idea if i can attempt to start fleet or not (i left it on the floor in case there were things you wanted me to manually do in the db). is it ok to attempt a start? or should i just hold fast.
Lucas Rodriguez

Lucas Rodriguez

12/16/2021, 5:08 PM
No, a start will cause issue due to the failed migrations.
5:11 PM
The team will try to reproduce and will respond on the issue as soon as we can.
t

Tor Houghton

12/16/2021, 5:12 PM
Cool beans. Thanks!
w

wkleinhenz

12/18/2021, 4:06 AM
Im seeing this same issue, running with docker, im using Mariadb:10.6, the official container, upgrading from the last latest version to the most current one
t

Tor Houghton

12/20/2021, 5:59 PM
Can confirm that doing MariaDB [fleet]> ALTER TABLE policy_membership_history DROP FOREIGN KEY fk_policy_membership_policy_id, DROP FOREIGN KEY fk_policy_membership_host_id; then $ docker-compose run fleetdm fleet prepare db results in "Migrations completed." (but does report

Missing migrations: tables=[20211202092042 20211202181033 20211207161856], data=[].

). fleetdm appears to start normally after this.