Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not migrate from os10-os12 #1502

Closed
singlewind opened this issue Jul 29, 2019 · 8 comments
Closed

Could not migrate from os10-os12 #1502

singlewind opened this issue Jul 29, 2019 · 8 comments
Labels
bug Something is not working.

Comments

@singlewind
Copy link

singlewind commented Jul 29, 2019

Describe the bug

Run hydra migrate sql -e --yes failed in the middle

Reproducing the bug

Steps to reproduce the behavior:

  1. Existing database from os10.rc6
  2. Download hydra v1.0.0 os12
  3. Run following command
hydra migrate sql -e
INFO[0000] No tracer configured - skipping tracing setup
INFO[0000] Connecting with mysql://*:*@tcp(192.168.10.10:3306)/hydra?
INFO[0000] Connected to SQL!
The following migration is planned:

| DRIVER |      MODULE       |   ID   | # |                                       QUERY                                        |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | JSON Web Keys     | 13.sql | 0 | ALTER TABLE hydra_client ADD                                                       |
|        |                   |        |    | frontchannel_logout_uri TEXT                                                       |
|        |                   |        |    | NULL; ALTER TABLE hydra_client                                                     |
|        |                   |        |    | ADD frontchannel_logout_uri                                                        |
|        |                   |        |    | TEXT NULL;                                                                         |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | OAuth 2.0 Clients | 13.sql | 1 | ALTER TABLE hydra_client ADD                                                       |
|        |                   |        |    | frontchannel_logout_session_required                                               |
|        |                   |        |    | BOOL NOT NULL DEFAULT FALSE;                                                       |
|        |                   |        |    | ALTER TABLE hydra_client ADD                                                       |
|        |                   |        |    | frontchannel_logout_session_required                                               |
|        |                   |        |    | BOOL NOT NULL DEFAULT FALSE;                                                       |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | Login &Consent    | 13.sql | 2 | ALTER TABLE hydra_client ADD                                                       |
|        |                   |        |    | post_logout_redirect_uris TEXT                                                     |
|        |                   |        |    | NULL; ALTER TABLE hydra_client                                                     |
|        |                   |        |    | ADD post_logout_redirect_uris                                                      |
|        |                   |        |    | TEXT NULL;                                                                         |
|        |-------------------|        |---|------------------------------------------------------------------------------------|
|        | OAuth 2.0         |        | 3 | ALTER TABLE hydra_client ADD                                                       |
|        |                   |        |    | backchannel_logout_uri TEXT                                                        |
|        |                   |        |    | NULL; ALTER TABLE hydra_client                                                     |
|        |                   |        |    | ADD backchannel_logout_uri                                                         |
|        |                   |        |    | TEXT NULL;                                                                         |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  |                   | 13.sql | 4 | ALTER TABLE hydra_client ADD                                                       |
|        |                   |        |    | backchannel_logout_session_required                                                |
|        |                   |        |    | BOOL NOT NULL DEFAULT FALSE;                                                       |
|        |                   |        |    | ALTER TABLE hydra_client ADD                                                       |
|        |                   |        |    | backchannel_logout_session_required                                                |
|        |                   |        |    | BOOL NOT NULL DEFAULT FALSE;                                                       |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  |                   | 13.sql | 5 | UPDATE hydra_client SET                                                            |
|        |                   |        |    | frontchannel_logout_uri='',post_logout_redirect_uris='',backchannel_logout_uri=''; |
|        |                   |        |    | UPDATE hydra_client SET                                                            |
|        |                   |        |    | frontchannel_logout_uri='',post_logout_redirect_uris='',backchannel_logout_uri=''; |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  |                   | 13.sql | 6 | ALTER TABLE hydra_client                                                           |
|        |                   |        |    | MODIFY frontchannel_logout_uri                                                     |
|        |                   |        |    | TEXT NOT NULL; ALTER                                                               |
|        |                   |        |    | TABLE hydra_client MODIFY                                                          |
|        |                   |        |    | frontchannel_logout_uri TEXT                                                       |
|        |                   |        |    | NOT NULL;                                                                          |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  |                   | 13.sql | 7 | ALTER TABLE                                                                        |
|        |                   |        |    | hydra_client MODIFY                                                                |
|        |                   |        |    | post_logout_redirect_uris                                                          |
|        |                   |        |    | TEXT NOT NULL; ALTER                                                               |
|        |                   |        |    | TABLE hydra_client MODIFY                                                          |
|        |                   |        |    | post_logout_redirect_uris TEXT                                                     |
|        |                   |        |    | NOT NULL;                                                                          |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  |                   | 13.sql | 8 | ALTER TABLE hydra_client                                                           |
|        |                   |        |    | MODIFY backchannel_logout_uri                                                      |
|        |                   |        |    | TEXT NOT NULL; ALTER                                                               |
|        |                   |        |    | TABLE hydra_client MODIFY                                                          |
|        |                   |        |    | backchannel_logout_uri TEXT                                                        |
|        |                   |        |    | NOT NULL;                                                                          |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | JSON Web Keys     | 8.sql  | 0 | ALTER TABLE                                                                        |
|        |                   |        |    | hydra_oauth2_authentication_request_handled                                        |
|        |                   |        |    | ADD context TEXT NULL; ALTER TABLE                                                 |
|        |                   |        |    | hydra_oauth2_authentication_request_handled                                        |
|        |                   |        |    | ADD context TEXT NULL;                                                             |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | OAuth 2.0 Clients | 8.sql  | 1 | ALTER TABLE                                                                        |
|        |                   |        |    | hydra_oauth2_consent_request                                                       |
|        |                   |        |    | ADD context TEXT                                                                   |
|        |                   |        |    | NULL; ALTER TABLE                                                                  |
|        |                   |        |    | hydra_oauth2_consent_request                                                       |
|        |                   |        |    | ADD context TEXT NULL;                                                             |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | Login &Consent    | 8.sql  | 2 | UPDATE                                                                             |
|        |                   |        |    | hydra_oauth2_authentication_request_handled                                        |
|        |                   |        |    | SET context='{}'; UPDATE                                                           |
|        |                   |        |    | hydra_oauth2_authentication_request_handled                                        |
|        |                   |        |    | SET context='{}';                                                                  |
|        |-------------------|        |---|------------------------------------------------------------------------------------|
|        | OAuth 2.0         |        | 3 | UPDATE                                                                             |
|        |                   |        |    | hydra_oauth2_consent_request                                                       |
|        |                   |        |    | SET context='{}'; UPDATE                                                           |
|        |                   |        |    | hydra_oauth2_consent_request                                                       |
|        |                   |        |    | SET context='{}';                                                                  |
|        |-------------------|        |---|------------------------------------------------------------------------------------|
|        |                   |        | 4 | ALTER TABLE                                                                        |
|        |                   |        |    | hydra_oauth2_authentication_request_handled                                        |
|        |                   |        |    | MODIFY context TEXT NOT NULL; ALTER TABLE                                          |
|        |                   |        |    | hydra_oauth2_authentication_request_handled                                        |
|        |                   |        |    | MODIFY context TEXT NOT NULL;                                                      |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  |                   | 8.sql  | 5 | ALTER TABLE                                                                        |
|        |                   |        |    | hydra_oauth2_consent_request                                                       |
|        |                   |        |    | MODIFY context TEXT                                                                |
|        |                   |        |    | NOT NULL; ALTER TABLE                                                              |
|        |                   |        |    | hydra_oauth2_consent_request                                                       |
|        |                   |        |    | MODIFY context TEXT NOT NULL;                                                      |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | JSON Web Keys     | 9.sql  | 0 | CREATE TABLE                                                                       |
|        |                   |        |    | hydra_oauth2_logout_request                                                        |
|        |                   |        |    | ( challenge varchar(36) NOT                                                        |
|        |                   |        |    | NULL PRIMARY KEY, verifier                                                         |
|        |                   |        |    | varchar(36) NOT NULL, subject                                                      |
|        |                   |        |    | varchar(255) NOT NULL,                                                             |
|        |                   |        |    | sid varchar(36) NOT NULL,                                                          |
|        |                   |        |    | client_id varchar(255) NOT                                                         |
|        |                   |        |    | NULL, request_url text NOT                                                         |
|        |                   |        |    | NULL, redir_url text NOT NULL,                                                     |
|        |                   |        |    | was_used bool NOT NULL default                                                     |
|        |                   |        |    | false, accepted bool NOT                                                           |
|        |                   |        |    | NULL default false, rejected                                                       |
|        |                   |        |    | bool NOT NULL default false,                                                       |
|        |                   |        |    | rp_initiated bool NOT NULL                                                         |
|        |                   |        |    | default false ); CREATE TABLE                                                      |
|        |                   |        |    | hydra_oauth2_logout_request                                                        |
|        |                   |        |    | ( challenge varchar(36) NOT                                                        |
|        |                   |        |    | NULL PRIMARY KEY, verifier                                                         |
|        |                   |        |    | varchar(36) NOT NULL, subject                                                      |
|        |                   |        |    | varchar(255) NOT NULL,                                                             |
|        |                   |        |    | sid varchar(36) NOT NULL,                                                          |
|        |                   |        |    | client_id varchar(255) NOT                                                         |
|        |                   |        |    | NULL, request_url text NOT                                                         |
|        |                   |        |    | NULL, redir_url text NOT NULL,                                                     |
|        |                   |        |    | was_used bool NOT NULL default                                                     |
|        |                   |        |    | false, accepted bool NOT                                                           |
|        |                   |        |    | NULL default false, rejected                                                       |
|        |                   |        |    | bool NOT NULL default false,                                                       |
|        |                   |        |    | rp_initiated bool NOT NULL                                                         |
|        |                   |        |    | default false );                                                                   |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | JSON Web Keys     | 10.sql | 0 | CREATE UNIQUE INDEX                                                                |
|        |                   |        |    | hydra_oauth2_logout_request_veri_idx                                               |
|        |                   |        |    | ON hydra_oauth2_logout_request                                                     |
|        |                   |        |    | (verifier); CREATE UNIQUE INDEX                                                    |
|        |                   |        |    | hydra_oauth2_logout_request_veri_idx                                               |
|        |                   |        |    | ON hydra_oauth2_logout_request                                                     |
|        |                   |        |    | (verifier);                                                                        |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | OAuth 2.0 Clients | 10.sql | 1 | ALTER TABLE hydra_oauth2_logout_request                                            |
|        |                   |        |    | ADD CONSTRAINT                                                                     |
|        |                   |        |    | hydra_oauth2_logout_request_client_id_fk                                           |
|        |                   |        |    | FOREIGN KEY (client_id) REFERENCES                                                 |
|        |                   |        |    | hydra_client(id) ON DELETE CASCADE;                                                |
|        |                   |        |    | ALTER TABLE hydra_oauth2_logout_request                                            |
|        |                   |        |    | ADD CONSTRAINT                                                                     |
|        |                   |        |    | hydra_oauth2_logout_request_client_id_fk                                           |
|        |                   |        |    | FOREIGN KEY (client_id) REFERENCES                                                 |
|        |                   |        |    | hydra_client(id) ON DELETE CASCADE;                                                |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | JSON Web Keys     | 11.sql | 0 | ALTER TABLE                                                                        |
|        |                   |        |    | hydra_oauth2_authentication_session                                                |
|        |                   |        |    | ADD remember bool NOT NULL                                                         |
|        |                   |        |    | DEFAULT FALSE; ALTER TABLE                                                         |
|        |                   |        |    | hydra_oauth2_authentication_session                                                |
|        |                   |        |    | ADD remember bool NOT NULL DEFAULT                                                 |
|        |                   |        |    | FALSE;                                                                             |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | OAuth 2.0 Clients | 11.sql | 1 | UPDATE                                                                             |
|        |                   |        |    | hydra_oauth2_authentication_session                                                |
|        |                   |        |    | SET remember=TRUE; UPDATE                                                          |
|        |                   |        |    | hydra_oauth2_authentication_session                                                |
|        |                   |        |    | SET remember=TRUE;                                                                 |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | JSON Web Keys     | 12.sql | 0 | ALTER TABLE                                                                        |
|        |                   |        |    | hydra_oauth2_logout_request                                                        |
|        |                   |        |    | MODIFY client_id varchar(255)                                                      |
|        |                   |        |    | NULL DEFAULT NULL; ALTER TABLE                                                     |
|        |                   |        |    | hydra_oauth2_logout_request                                                        |
|        |                   |        |    | MODIFY client_id varchar(255)                                                      |
|        |                   |        |    | NULL DEFAULT NULL;                                                                 |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|

To skip the next question use flag --yes (at your own risk).
Do you wish to execute this migration plan? [y/n]: y
An error occurred while connecting to SQL: Could not migrate sql schema, applied 2 migrations: Error 1215: Cannot add foreign key constraint handling 10

Server logs

Error 1215: Cannot add foreign key constraint handling 10

Server configuration

Expected behavior

Can be migrated successfully.

Environment

  • Version: v1.0.0
  • Environment: Mac, Docker, ...
@aeneasr aeneasr added the bug Something is not working. label Jul 30, 2019
@aeneasr
Copy link
Member

aeneasr commented Jul 30, 2019

Interesting, it appears that one migration is being executed twice:

|--------|-------------------|--------|---|------------------------------------------------------------------------------------|
| mysql  | OAuth 2.0 Clients | 10.sql | 1 | ALTER TABLE hydra_oauth2_logout_request                                            |
|        |                   |        |    | ADD CONSTRAINT                                                                     |
|        |                   |        |    | hydra_oauth2_logout_request_client_id_fk                                           |
|        |                   |        |    | FOREIGN KEY (client_id) REFERENCES                                                 |
|        |                   |        |    | hydra_client(id) ON DELETE CASCADE;                                                |
|        |                   |        |    | ALTER TABLE hydra_oauth2_logout_request                                            |
|        |                   |        |    | ADD CONSTRAINT                                                                     |
|        |                   |        |    | hydra_oauth2_logout_request_client_id_fk                                           |
|        |                   |        |    | FOREIGN KEY (client_id) REFERENCES                                                 |
|        |                   |        |    | hydra_client(id) ON DELETE CASCADE;                                                |
|--------|-------------------|--------|---|------------------------------------------------------------------------------------|

I will investigate this.

@aeneasr
Copy link
Member

aeneasr commented Jul 30, 2019

It appears that ALL statements are duplicated. I have to investigate if that's an issue with the formatter of the table or a code issue.

@aeneasr
Copy link
Member

aeneasr commented Jul 30, 2019

#1502 (comment) will be addressed with: #1504

Regarding your issue, please paste the output of

SELECT client_id from hydra_oauth2_logout_request;
SELECT id from client_id;

If you have too many rows there please let me know. This will remove all sensitive data so you can run it as-is.

BEFORE YOU GO TO THE NEXT SECTION, MAKE A BACK UP AND RUN THIS COMMAND AGAINST THAT DATABASE. DO NOT RUN THIS AGAINST YOUR PRODUCTION DATABASE.

Run this command against a backup:

ALTER TABLE hydra_oauth2_logout_request ADD CONSTRAINT  hydra_oauth2_logout_request_client_id_fk FOREIGN KEY (client_id) REFERENCES hydra_client(id) ON DELETE CASCADE;  

And print the resulting error message here please.

@singlewind
Copy link
Author

Hi @aeneasr, I finished my work at the old place yesterday which means I could not access their database to debug through anymore. However, I like Hydra you have built I'm more than happy to debug this. Give me some time to recreate the situation.

@aeneasr
Copy link
Member

aeneasr commented Aug 6, 2019

Thank you @singlewind :) I'll keep this open in the meanwhile :)

@singlewind
Copy link
Author

Hi @aeneasr, have you fixed the bug already. I try to recreate the issue today. Looks like it has been fixed. The index has been migrated successfully although it still displays duplicates in the plan. What I will do is keep trying to populate more data before migrations.

hydra-migrate_1  | |--------|-------------------|--------|---|------------------------------------------------------------------------------------|
hydra-migrate_1  | | mysql  | JSON Web Keys     | 9.sql  | 0 | CREATE TABLE                                                                       |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_logout_request                                                        |
hydra-migrate_1  | |        |                   |        |    | ( challenge varchar(36) NOT                                                        |
hydra-migrate_1  | |        |                   |        |    | NULL PRIMARY KEY, verifier                                                         |
hydra-migrate_1  | |        |                   |        |    | varchar(36) NOT NULL, subject                                                      |
hydra-migrate_1  | |        |                   |        |    | varchar(255) NOT NULL,                                                             |
hydra-migrate_1  | |        |                   |        |    | sid varchar(36) NOT NULL,                                                          |
hydra-migrate_1  | |        |                   |        |    | client_id varchar(255) NOT                                                         |
hydra-migrate_1  | |        |                   |        |    | NULL, request_url text NOT                                                         |
hydra-migrate_1  | |        |                   |        |    | NULL, redir_url text NOT NULL,                                                     |
hydra-migrate_1  | |        |                   |        |    | was_used bool NOT NULL default                                                     |
hydra-migrate_1  | |        |                   |        |    | false, accepted bool NOT                                                           |
hydra-migrate_1  | |        |                   |        |    | NULL default false, rejected                                                       |
hydra-migrate_1  | |        |                   |        |    | bool NOT NULL default false,                                                       |
hydra-migrate_1  | |        |                   |        |    | rp_initiated bool NOT NULL                                                         |
hydra-migrate_1  | |        |                   |        |    | default false ); CREATE TABLE                                                      |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_logout_request                                                        |
hydra-migrate_1  | |        |                   |        |    | ( challenge varchar(36) NOT                                                        |
hydra-migrate_1  | |        |                   |        |    | NULL PRIMARY KEY, verifier                                                         |
hydra-migrate_1  | |        |                   |        |    | varchar(36) NOT NULL, subject                                                      |
hydra-migrate_1  | |        |                   |        |    | varchar(255) NOT NULL,                                                             |
hydra-migrate_1  | |        |                   |        |    | sid varchar(36) NOT NULL,                                                          |
hydra-migrate_1  | |        |                   |        |    | client_id varchar(255) NOT                                                         |
hydra-migrate_1  | |        |                   |        |    | NULL, request_url text NOT                                                         |
hydra-migrate_1  | |        |                   |        |    | NULL, redir_url text NOT NULL,                                                     |
hydra-migrate_1  | |        |                   |        |    | was_used bool NOT NULL default                                                     |
hydra-migrate_1  | |        |                   |        |    | false, accepted bool NOT                                                           |
hydra-migrate_1  | |        |                   |        |    | NULL default false, rejected                                                       |
hydra-migrate_1  | |        |                   |        |    | bool NOT NULL default false,                                                       |
hydra-migrate_1  | |        |                   |        |    | rp_initiated bool NOT NULL                                                         |
hydra-migrate_1  | |        |                   |        |    | default false );                                                                   |
hydra-migrate_1  | |--------|-------------------|--------|---|------------------------------------------------------------------------------------|
hydra-migrate_1  | | mysql  | JSON Web Keys     | 10.sql | 0 | CREATE UNIQUE INDEX                                                                |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_logout_request_veri_idx                                               |
hydra-migrate_1  | |        |                   |        |    | ON hydra_oauth2_logout_request                                                     |
hydra-migrate_1  | |        |                   |        |    | (verifier); CREATE UNIQUE INDEX                                                    |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_logout_request_veri_idx                                               |
hydra-migrate_1  | |        |                   |        |    | ON hydra_oauth2_logout_request                                                     |
hydra-migrate_1  | |        |                   |        |    | (verifier);                                                                        |
hydra-migrate_1  | |--------|-------------------|--------|---|------------------------------------------------------------------------------------|
hydra-migrate_1  | | mysql  | OAuth 2.0 Clients | 10.sql | 1 | ALTER TABLE hydra_oauth2_logout_request                                            |
hydra-migrate_1  | |        |                   |        |    | ADD CONSTRAINT                                                                     |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_logout_request_client_id_fk                                           |
hydra-migrate_1  | |        |                   |        |    | FOREIGN KEY (client_id) REFERENCES                                                 |
hydra-migrate_1  | |        |                   |        |    | hydra_client(id) ON DELETE CASCADE;                                                |
hydra-migrate_1  | |        |                   |        |    | ALTER TABLE hydra_oauth2_logout_request                                            |
hydra-migrate_1  | |        |                   |        |    | ADD CONSTRAINT                                                                     |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_logout_request_client_id_fk                                           |
hydra-migrate_1  | |        |                   |        |    | FOREIGN KEY (client_id) REFERENCES                                                 |
hydra-migrate_1  | |        |                   |        |    | hydra_client(id) ON DELETE CASCADE;                                                |
hydra-migrate_1  | |--------|-------------------|--------|---|------------------------------------------------------------------------------------|
hydra-migrate_1  | | mysql  | JSON Web Keys     | 11.sql | 0 | ALTER TABLE                                                                        |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_authentication_session                                                |
hydra-migrate_1  | |        |                   |        |    | ADD remember bool NOT NULL                                                         |
hydra-migrate_1  | |        |                   |        |    | DEFAULT FALSE; ALTER TABLE                                                         |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_authentication_session                                                |
hydra-migrate_1  | |        |                   |        |    | ADD remember bool NOT NULL DEFAULT                                                 |
hydra-migrate_1  | |        |                   |        |    | FALSE;                                                                             |
hydra-migrate_1  | |--------|-------------------|--------|---|------------------------------------------------------------------------------------|
hydra-migrate_1  | | mysql  | OAuth 2.0 Clients | 11.sql | 1 | UPDATE                                                                             |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_authentication_session                                                |
hydra-migrate_1  | |        |                   |        |    | SET remember=TRUE; UPDATE                                                          |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_authentication_session                                                |
hydra-migrate_1  | |        |                   |        |    | SET remember=TRUE;                                                                 |
hydra-migrate_1  | time="2019-08-09T01:51:57Z" level=debug msg="Applying mysql SQL migrations..."
hydra-migrate_1  | |--------|-------------------|--------|---|------------------------------------------------------------------------------------|
hydra-migrate_1  | | mysql  | JSON Web Keys     | 12.sql | 0 | ALTER TABLE                                                                        |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_logout_request                                                        |
hydra-migrate_1  | |        |                   |        |    | NULL DEFAULT NULL; ALTER TABLE                                                     |
hydra-migrate_1  | |        |                   |        |    | hydra_oauth2_logout_request                                                        |
hydra-migrate_1  | |        |                   |        |    | MODIFY client_id varchar(255)                                                      |
hydra-migrate_1  | |        |                   |        |    | NULL DEFAULT NULL;                                                                 |
hydra-migrate_1  | |--------|-------------------|--------|---|------------------------------------------------------------------------------------|
hydra-migrate_1  | time="2019-08-09T01:51:57Z" level=debug msg="Applying mysql SQL migrations for manager: *jwk.SQLManager (0)"
hydra-migrate_1  | time="2019-08-09T01:51:57Z" level=debug msg="Successfully applied 0 mysql SQL migrations from manager: *jwk.SQLManager (0)"
hydra-migrate_1  | time="2019-08-09T01:51:57Z" level=debug msg="Applying mysql SQL migrations for manager: *client.SQLManager (1)"
hydra-migrate_1  | time="2019-08-09T01:51:59Z" level=debug msg="Successfully applied 1 mysql SQL migrations from manager: *client.SQLManager (1)"
hydra-migrate_1  | time="2019-08-09T01:51:59Z" level=debug msg="Applying mysql SQL migrations for manager: *consent.SQLManager (2)"
hydra-migrate_1  | time="2019-08-09T01:52:01Z" level=debug msg="Successfully applied 5 mysql SQL migrations from manager: *consent.SQLManager (2)"
hydra-migrate_1  | time="2019-08-09T01:52:01Z" level=debug msg="Applying mysql SQL migrations for manager: *oauth2.FositeSQLStore (3)"
hydra-migrate_1  | time="2019-08-09T01:52:01Z" level=debug msg="Successfully applied 0 mysql SQL migrations from manager: *oauth2.FositeSQLStore (3)"
hydra-migrate_1  | time="2019-08-09T01:52:01Z" level=debug msg="Applied 6 mysql SQL migrations"
hydra-migrate_1  | Successfully applied 6 SQL migrations!

@aeneasr
Copy link
Member

aeneasr commented Aug 9, 2019

We haven't fixed anything in that regard, although we fixed the duplicate migration plan issue on master.

It's most likely some flakyness with the foreign keys - I think it could easily be resolved by searching for dupe keys and removing the entries as the rows affected are usually not of great value anyways.

I think it's ok to not figure out what's going on exactly as it seems like this is a rare occurence - this is the first report of this issue.

Would you be ok with closing this?

@singlewind
Copy link
Author

Thanks, @aeneasr for all your help. I'm closing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants