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

Connection Fails in GitHub Actions #162

Closed
mountaindog opened this issue Feb 21, 2024 · 3 comments
Closed

Connection Fails in GitHub Actions #162

mountaindog opened this issue Feb 21, 2024 · 3 comments

Comments

@mountaindog
Copy link

I have noticed this a couple of times. Installing the Trilogy Gem locally and connecting to MySQL (8.3.0) works without issues. However, when used in GitHub Actions, it generates this error:

ActiveRecord::ConnectionNotEstablished: trilogy_auth_recv: TRILOGY_UNEXPECTED_PACKET (ActiveRecord::ConnectionNotEstablished)

A little further down the stack, this:

Caused by:
Trilogy::QueryError: trilogy_auth_recv: TRILOGY_UNEXPECTED_PACKET (Trilogy::QueryError)

My GitHub actions are using the latest MySQL. I am happy to provide more information if needed. Hopefully, I just needed to include a setting or config option.

Rails 7.1
Ruby: 3.2.2
MySQL (8.3.0)

@bensheldon
Copy link
Contributor

I think you are running into Trilogy's current non-support with caching_sha2_password. You'll need to put MySQL into mysql_native_password mode.

Here's many examples you might look at for doing so:

https://github.com/search?type=code&q=path%3A.github%2Fworkflows%2F*+%22--default-authentication-plugin%3Dmysql_native_password%22

@kmcphillips
Copy link

I got hung up on this for hours. I think I had an issue with loading the wrong MySQL config a second time and stomping the guidance above.

Anyway, there's my ci.yml for a pretty standard Rails app using Trilogy, if that helps:
https://gist.github.com/kmcphillips/55043742fcf6e882a7e2eb90611a4910

@eileencodes
Copy link
Member

I'm going to close this because we already have an open issue for caching_sha2_password.

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

No branches or pull requests

4 participants