Channels
  • Esteban

    Esteban

    11 months ago
    Hello, I've updated to the last version. I've changed the old env variables (KOLIDE_ format) to new format. But when doing the migration it gives me this error:
    2021/07/01 11:29:41 FAIL 20210601000001_CreateTeamsTables.go (alter hosts: Error 1005: Can't create table `fleet`.`hosts` (errno: 121 "Duplicate key on write or update")), quitting migration.
  • zwass

    zwass

    11 months ago
    Which version are you upgrading from? What version of MySQL are you running?
  • Esteban

    Esteban

    11 months ago
    I don't remember, previous to 4.0.0
    I was still using KOLIDE_ env variables
    MySQL Version: 5.7
  • zwass

    zwass

    11 months ago
    I can see now that the identifier we use in this migration violates the global uniqueness requirement as mentioned in the MySQL docs (https://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html)
    The CONSTRAINT symbol value, if defined, must be unique in the database. A duplicate symbol results in an error similar to: ERROR 1005 (HY000): Can't create table 'test.fk1' (errno: 121). I am not sure why this migration works in our development and testing environments.
    Let us think about how to best address this and make a 4.0.1 release.
    Can you give me any more information about your MySQL database? It would be helpful if we could understand what configuration causes this issue so that we can reproduce it locally.
  • Esteban

    Esteban

    11 months ago
    I'm using a Docker Container with MariaDB. I've tried to use a plain new database and i've got the same error
  • zwass

    zwass

    11 months ago
    Ah, maybe MariaDB enforces it and plain MySQL doesn't. Let me see if that helps me reproduce.
  • Esteban

    Esteban

    11 months ago
    I'll try with a mysql container in the same machine
    With mysql container it's working with the last version.
  • zwass

    zwass

    11 months ago
    Super helpful, thank you. I was able to reproduce it locally and fix the issue. Going to cut a 4.0.1 when this is merged https://github.com/fleetdm/fleet/pull/1280
  • Esteban

    Esteban

    11 months ago
    Your welcome, glad to help!
  • zwass

    zwass

    11 months ago
    We published 4.0.1, please give it a try now 🙂
  • Esteban

    Esteban

    11 months ago
    Did you publish the docker image? I'm using the fleetdm/fleet image
    Hello, now there's another error
    2021/07/02 11:26:08 FAIL 20210601000002_AddRolesToInvites.go (create invite_teams: Error 1005: Can't create table `fleet`.`invite_teams` (errno: 121 "Duplicate key on write or update")), quitting migration.
  • r

    Ricardo Santos

    11 months ago
    Same error here.. using binary. Database: mysql Ver 15.1 Distrib 10.3.28-MariaDB, for Linux (x86_64) using readline 5.1
    {"component":"service","err":"list users: missing destination name global_role in *[]*kolide.User","level":"info","method":"ListUsers","took":"698.826µs","ts":"2021-07-02T14:26:11.197380836Z","user":"none"}
    Error fetching setup requirement: list users: missing destination name global_role in *[]*kolide.User

    This error is when I start the old version...
  • Esteban

    Esteban

    11 months ago
    Maybe it's happening before 4.0?
  • r

    Ricardo Santos

    11 months ago
    I tried to upgrade from previous version, with 4.0.0 same error as yours.. with 4.0.1 same error as yours, but now fleet (previous version) can't start... seems like it is between versions.
  • zwass

    zwass

    11 months ago
    My apologies. It looks like you both ended up in a state that is only possible after hitting the error in v4.0.0 and then upgrading to v4.0.1. Things should be fixed in v4.0.1 for any MariaDB users that did not try v4.0.0. To fix your current issue, please run the following query in your database and then run the v4.0.1 migrations again.
    ALTER TABLE user_teams DROP FOREIGN KEY fk_team_id, ADD FOREIGN KEY fk_user_teams_team_id (team_id) REFERENCES teams (id) ON DELETE CASCADE ON UPDATE CASCADE;
  • r

    Ricardo Santos

    11 months ago
    No problem. Thank you for this product. It solved my problem. It worked for me... just having an error with the auth_jwt_key on the new version...
    Started successfully without the auth_jwt_key option. Haven't tried to enroll a new agent still.