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

MySQL DB not creating on start – JSON column types only supported from MySQL 5.7 and onwards #299

Closed
waynerobinson opened this issue Oct 25, 2016 · 8 comments
Labels
bug Something is not working.

Comments

@waynerobinson
Copy link

Getting the below log when I try to start Hydra for the first time with a MySQL DB on the current master:

09:10:33 hydra.1    | started with pid 27550
09:10:33 hydra.1    | time="2016-10-26T09:10:33+11:00" level=info msg="Connecting with mysql://root:@tcp(127.0.0.1:3306)/hydra?parseTime=true"
09:10:33 hydra.1    | time="2016-10-26T09:10:33+11:00" level=info msg="Connected to SQL!"
09:10:34 hydra.1    | time="2016-10-26T09:10:34+11:00" level=info msg="Key pair for signing hydra.openid.id-token is missing. Creating new one."
09:10:35 hydra.1    | time="2016-10-26T09:10:35+11:00" level=info msg="Key pair for signing hydra.consent.response is missing. Creating new one."
09:10:41 hydra.1    | time="2016-10-26T09:10:41+11:00" level=info msg="Key pair for signing hydra.consent.challenge is missing. Creating new one."
09:10:44 hydra.1    | time="2016-10-26T09:10:44+11:00" level=warning msg="No clients were found. Creating a temporary root client..."
09:10:45 hydra.1    | Could not create admin policy because : Error 1146: Table 'hydra.ladon_policy' doesn't exist
09:10:45 hydra.1    | exited with code 1
09:10:45 system     | sending SIGTERM to all processes

Start command:

ACCESS_TOKEN_LIFESPAN=20m LOG_LEVEL=debug PORT=4444 SYSTEM_SECRET=redacted DATABASE_URL=mysql://root:@tcp\(127.0.0.1:3306\)/hydra?parseTime=true CONSENT_URL=http://aver.dev/consents/new hydra host --dangerous-auto-logon --dangerous-force-http
@waynerobinson
Copy link
Author

Discovered this has to do with the JSON column type only being supported in MySQL 5.7.

5.5 & 5.6 are by far the most popular versions of MySQL in production. I thought you were going to steer away from using JSON column-types (at least in MySQL) because of this.

@waynerobinson
Copy link
Author

Also, the error is a little bit weird as it doesn't seem to raise anything when the CREATE TABLE script runs, only when it tries to insert data into a non-existent table.

@waynerobinson
Copy link
Author

Had a brief look through your queries too… you don't seem to be using anything JSON-specific in your SQL, so a LONGTEXT (or MEDIUM or TEXT) field should be fine for storing this data.

@waynerobinson waynerobinson changed the title MySQL DB not creating on load MySQL DB not creating on start – JSON column types only supported from MySQL 5.7 and onwards Oct 26, 2016
@aeneasr
Copy link
Member

aeneasr commented Oct 26, 2016

Thanks for reporting, I will investigate.

@aeneasr aeneasr added the bug Something is not working. label Oct 26, 2016
@aeneasr
Copy link
Member

aeneasr commented Oct 26, 2016

found the culprit, it's ladon. patch due soon

aeneasr pushed a commit that referenced this issue Oct 26, 2016
…y supported from MySQL 5.7 and onwards - closes #299
@waynerobinson
Copy link
Author

Does this change the requirement for JSON columns too that are only supported in MySQL 5.7+?

@aeneasr
Copy link
Member

aeneasr commented Oct 26, 2016

Yes, no more JSON fields

@waynerobinson
Copy link
Author

👌

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