You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/12/22 20:30:29 UTC
[GitHub] [superset] mike-pt opened a new issue #17858: Can't connect to CloudSQL using docker image (cloud_sql_proxy in host)
mike-pt opened a new issue #17858:
URL: https://github.com/apache/superset/issues/17858
I'm trying to connect to a CloudSQL (Google) instance using unix sockets.
Superset is running via latest docker image
I suspect something is missing the docker config to allow it to reach unix socket on the host.
But I am mounting the path where the sockets are created by cloud_sql_proxy on docker run:
```
docker run -d -p 8080:8088 --name superset -v /tmp/cloud_sql_proxy:/tmp/cloud_sql_proxy apache/superset
```
#### How to reproduce the bug
1. Add a new database connection
2. Select SQLALCHAMY URL
3. mysql+mysqldb://user@/db?unix_socket=/tmp/cloud_sql_proxy/project:region:instanceID
4. Test connection
URL is based on https://docs.sqlalchemy.org/en/13/dialects/mysql.html?highlight=cloudsql#module-sqlalchemy.dialects.mysql.gaerdbms
### Expected results
Test Connection should work
### Actual results
Test conneciton fails with:
```
ERROR: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to local MySQL server through socket '/tmp/cloud_sql_proxy/project:us-central1:instanceIDr' (111)")
(Background on this error at: http://sqlalche.me/e/13/e3q8)
```
As noted above I am mounting the volume for cloudsql_proxy on docker run, and I've confirm the socket files are present in the docker container
#### Screenshots
### Environment
(please complete the following information):
- browser type and version: Firefox
- Docker "latest" image tag
```
docker exec -it superset superset shell
logging was configured successfully
2021-12-22 20:23:54,558:INFO:superset.utils.logging_configurator:logging was configured successfully
2021-12-22 20:23:54,565:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
/usr/local/lib/python3.8/site-packages/flask_caching/__init__.py:201: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
warnings.warn(
Python 3.8.12 (default, Dec 21 2021, 10:45:09)
docker exec -it superset /bin/bash [
superset@5f7c8c87c893:/app$ superset --version
Python 3.8.12
Flask 1.1.4
Werkzeug 1.0.1
```
### Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version of superset.
- [x] I have checked the issue tracker for the same issue and I haven't found one similar.
### Additional context
Add any other context about the problem here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org