-
Notifications
You must be signed in to change notification settings - Fork 349
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
Add example for GitHub Actions + Proxy #2117
Comments
Making this a feature request since this comes up now and then. Until we document this properly, try the approach shown here: #1989 (comment). |
Note that's using Workload Identify Federation 1, but if you want to use a credential file, the approach is comparable. |
Thank you for the suggestion! I added the commands in "Enable cloud SQL proxy to temp instance" to a new makefile command that I'm running in my workflow now, which appears to be running correctly and not erroring out, but Mysql is now giving me "unexpected EOF" errors in my migration step:
|
Have you looked at the Proxy's logs at all to confirm it's working as intended? |
How would I do that in a GH action runner, is there some kind of verbose logging option I can use? |
@pidgezero-one We now support debug logging as of v2.9.0 and beyond. You can add the flag |
Question
I can't get my Github Actions runner to properly connect to my MySQL Cloud SQL instance using the cloud-sql-proxy Docker container.
These are the relevant steps of my GHA YML:
I can see in the action runner logs that
${{ secrets.AUTH_KEY }}
and${{ env.PROJECT_ID }}
are being parsed correctly.These are the definitions of
make proxy_db
andmake migration
in my makefile:The contents of
main.go
are as follows:From action runner logs, I can see that my environment variables (including those which are references to Google Secret Manager secrets and are processed by envconfig) are being processed correctly, so I don't believe there is a problem with my
GOOGLE_APPLICATION_CREDENTIALS
. MymigrationsPath
variable in main.go pointing to where my migrations live also doesn't contain any typos.When this action runs in Github Actions, it downloads the container, outputs a digest message, outputs a status message, and then outputs a hash. It does not output any error messages.
It then tries to run migrations. After about a minute, the Github Action exits with these error logs:
I've also tried this with a
wait
script between the two commands of my GHA step, but that didn't make a difference, it says the DB is ready after 0 seconds. I think that the container is being created, but that is not running.I've also tried using a v1 container:
but this doesn't work either, same error.
Port 3306 is open in my project's firewall settings.
What do I need to do to get it to work? On previous projects I've collaborated on, this approach works without issue for Postgres databases, but I can't get it to actually work on my own GCS project.
Code
No response
Additional Details
No response
The text was updated successfully, but these errors were encountered: