gce-cloudsql-proxy-action icon indicating copy to clipboard operation
gce-cloudsql-proxy-action copied to clipboard

Error when trying to connect

Open naorye opened this issue 3 years ago • 0 comments

This is my action and it doesn't work. Getting:

Run psql "host=127.0.0.1 port=5432 sslmode=disable dbname=testdb user=postgres"
psql: error: connection to server at "127.0.0.1", port 5432 failed: server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
Error: Process completed with exit code 2.

What am I missing?

name: proxy-test

on:
  workflow_dispatch:

jobs:
  scheduled-job:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v2
        with:
          node-version: "16"

      - uses: mattes/gce-cloudsql-proxy-action@v1
        with:
          creds: ${{ secrets.GCP_CREDENTIALS }}
          instance: myproj-1234:europe-west1:instance_name

      - name: Install postgresql-client
        run: sudo apt-get install -y postgresql-client

      - run: psql "host=127.0.0.1 port=5432 sslmode=disable dbname=testdb user=postgres"

naorye avatar Aug 28 '22 22:08 naorye