简体   繁体   English

无法从 GCP Dataflow python 环境连接到云 sql 实例(sql server)

[英]Can't connect to cloud sql instance (sql server) from GCP Dataflow python environment

I'm running a Python Jupyter Notebook in a GCP Dataflow environment.我在 GCP Dataflow 环境中运行 Python Jupyter Notebook。 From there, I need to connect to a SQL sever database that's also hosted on GCP Cloud SQL.从那里,我需要连接到同样托管在 GCP Cloud SQL 上的 SQL 服务器数据库。 Both, the Dataflow environment and the Cloud SQL database belong to the same project and the database is in the same region as the Dataflow environment. Dataflow 环境和 Cloud SQL 数据库属于同一个项目,并且数据库与 Dataflow 环境在同一区域。 In the notebook I import pymssql and I try to connect:在笔记本中,我导入pymssql并尝试连接:

import pymssql
conn = pymssql.connect(private_IP_address,  'sqlserver', my_password, my_database, port=1433)

And then I'm getting this error_log from the database log:然后我从数据库日志中得到这个 error_log :

{
textPayload: "
2020-11-05 22:32:11.39 Logon       Login failed for user '0b6ac33c6f3ffac\0b6ac33c6f3ffac$'. Reason: Token-based server access validation failed with an infrastructure error. Login lacks connect endpoint permission. [CLIENT: 127.0.0.1]
"
insertId: "s=78a0260e8570497095a8a31a7c378bb3;i=1f23ae;b=0539ace45f6f4b56b03c745b0479107b;m=10a6f7f8e7e;t=5b363aac03490;x=9030d75bb0dadd2-0@a1"
resource: {2}
timestamp: "2020-11-05T22:32:11.410576Z"
severity: "INFO"
labels: {23}
logName: "projects/shapiro-metals/logs/cloudsql.googleapis.com%2Fsqlserver.err"
receiveTimestamp: "2020-11-05T22:32:12.582961041Z"
}

I've been searching around and I couldn't find any simple explanation of exactly what I'm missing;我一直在四处寻找,但找不到任何关于我所缺少的东西的简单解释; hoping someone can help?希望有人能帮忙?

Facing the same error after changing to Public IP address and other troubleshooting, this issue is the same with this public tracker and Google Cloud SQL Engineering Team is working on solving this issue.在更改为公共 IP 地址和其他故障排除后面临同样的错误,此问题与此公共跟踪器相同,Google Cloud SQL 工程团队正在努力解决此问题。

You can star the public issue tracker feature requests and add comment in the thread that you are also affected to ensure that you will receive updates about it.您可以为公共问题跟踪器功能请求加星标,并在您也受到影响的线程中添加评论,以确保您将收到有关它的更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM