cloud proxy - in cloud build, connection?

129 views
Skip to first unread message

rcdh

unread,
Mar 4, 2021, 10:53:01 AM3/4/21
to Google Cloud SQL discuss
Hi there,

recently started evaluating gcp for tooling and have a question regarding the cloud-proxy that starts automatically.

I dont seem to be able to connect to it in the documented manner on 127.0.0.1:3307 

Anyone have any experience with this?

```
Step #2 - "migrate": ---------- CONNECT CLOUDSQL ----------
Step #2 - "migrate": cloud_sql_proxy is running.
Step #2 - "migrate": Connections: hardy-clover-******:europe-west3:db-dev-mccmsdemo.
Step #2 - "migrate":
Step #2 - "migrate": ---------- EXECUTE COMMAND ----------
Step #2 - "migrate": sh .cloudbuild/django_migrate.sh
Step #2 - "migrate": 🎸 migrate postgres://*******:***********@127.0.0.1:3307/dbname
Step #2 - "migrate": Traceback (most recent call last):
Step #2 - "migrate": File "/usr/local/lib/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
Step #2 - "migrate": self.connect()
Step #2 - "migrate": File "/usr/local/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
Step #2 - "migrate": return func(*args, **kwargs)
Step #2 - "migrate": File "/usr/local/lib/python3.8/site-packages/django/db/backends/base/base.py", line 200, in connect
Step #2 - "migrate": self.connection = self.get_new_connection(conn_params)
Step #2 - "migrate": File "/usr/local/lib/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
Step #2 - "migrate": return func(*args, **kwargs)
Step #2 - "migrate": File "/usr/local/lib/python3.8/site-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
Step #2 - "migrate": connection = Database.connect(**conn_params)
Step #2 - "migrate": File "/usr/local/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect
Step #2 - "migrate": conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
Step #2 - "migrate": psycopg2.OperationalError: could not connect to server: Connection refused
Step #2 - "migrate": Is the server running on host "127.0.0.1" and accepting
Step #2 - "migrate": TCP/IP connections on port 3307?
Step #2 - "migrate":
Step #2 - "migrate":
Step #2 - "migrate": The above exception was the direct cause of the following exception:
```

Aref Amiri (Cloud Platform Support)

unread,
Mar 4, 2021, 12:37:21 PM3/4/21
to Google Cloud SQL discuss
Hi,

Is there and outbound firewall policy? If yes, you'd have to make sure it allows connections to port 3307 per this public doc.

Ross

unread,
Mar 4, 2021, 3:36:50 PM3/4/21
to google-cloud...@googlegroups.com
hey thanks for the response, this is actually running on the code build servers.. not locally

the proxy seems to just "be there" I did not configure it and it seems to be part of the build image

--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-sql-discuss/V5rNXCL4os0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/356b52f5-304b-43ea-b865-c1a03293d178n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages