Not able to connect to Azure SQL

Hello Everyone,

I had created a chatbot using rasa nlu and ras core. Chatbot has been published to GCP Ubuntu server using docker compose file and nginx. This chatbot is connecting to Azure SQL database for DB operations.

Attached is the my docker file (of action server), docker-compose file & nginx

docker compose → nginx → requirement-actions → pytablewriter requests pyodbc mysql-connector-python pymysql ruamel.yaml

Issue → My bot is running fine and is able to talk to the front end however when there is azure sql communication involved bot is unable to connect to Azure Sql. I had added the IP to the firewall of DB as well and added all required packages to docker file. When i see the logs using command “sudo docker logs -f --details action_server” it is showing following error.

Any pointers on how to resolve this issue ?

Note - When I run rasa bot without docker, on my local machine, am able to connect to azure sql without any issues.

This is a database you’re connecting to your action server, right? It’s not the database for the tracker store?

@Tobias_Wochinger - That’s correct. Iam connecting this database (Azure Sql) to fetch some information using action server.

@JiteshGaikwad @vishnupriyavr

Hello all, can you please help me in this regard ? Am kind of stuck in this, have been struggling from so many days.

Thanks in advance !

Hi @analyticalgagan, on first look, It seems like the user as which the container is running exists on your local machine, but not on the Ubuntu server. Adding the $uid of the user to the passwd file when the container starts up might solve the issue. Please check the link below and let us know if the suggested solution works: https://stackoverflow.com/a/55915387/5343140

@vishnupriyavr - Thank you so much for your reply !

I had already gone thru this post earlier and followed some part of it. You can also see there are few commands already present in my docker file as well. These statements threw me an error when i included them in my docker file ->
ENTRYPOINT entrypoint.sh. & ADD entrypoint.sh . So i removed them from my docker file.

Alternatively it would also be great if you can refer me to any rasa project which connects to Azure SQL from Docker, which i can refer and correct the files at my end.

Thanks in Advance !

If add the entrypoint.sh in my actions directory, i get this error while building docker-compose file

and actions server stops responding at all, while my bot is up.