Rasa core unable to connect to SSL enabled MySQL tracker store db

I’m getting following error: [ERROR] Could not create tables: (pymysql.err.OperationalError) (1045, “Access denied for user ‘username’@‘dbserver’ (using password: YES)”) (Background on this error at: http://sqlalche.me/e/13/e3q8)

Following is tracker store configurations in endpoints.yml.

tracker_store:
    type: SQL
    dialect: "mysql+pymysql"
    url: "<url>"
    username: "<username>"
    password: "<password>"
    db: "<dbname>"

I am using rasa==1.10.0 and our Linux CentOS rasa client fails to connect to SSL enabled MySQL tracker db. Can someone look in to this ? Thankyou.

You need to specify your certs. You can find info on this in the sqlalchemy docs.

One approach is to set these i the url option. Here’s an example postgres URL with SSL:

'postgresql://user:pass@host/dbname?alt_host=host1&alt_host=host2&ssl_cipher=%2Fpath%2Fto%2Fcrt'

Greg

Hi @stephens I’ve rasa open source running as a pod in my cluster deployment. I’ve created a secret which contains my ca.pem server-side mysql certificate and it has been successfully mounted in a directory in my rasa pod. Now, I need to use this certificate for establishing this ssl connection so that the table gets created in my mysql database. For this, I followed your suggestion of using ssl_cipher= parameter in the connection URL, but that doesn’t seem to work. Any other suggestion?

@Sunita my current configuration is -

tracker_store: type: SQL dialect: “mysql+pymysql” url: “xoxoxoxo.mysql.database.azure.com:3306?useSSL=true?ssl_cipher=mysql/ca.pem” db: “mydb” username: “xoxo@xoxo” password: “xoxoxoxo”

The path mysql/ca.pem is inside my pod i.e. there’s a mysql folder created which holds my ca.pem file.

Still I’m getting the error - 2022-07-08 07:51:02 DEBUG rasa.core.tracker_store - Attempting to connect to database via ‘mysql+pymysql://xoxoxo%40xoxoxo:***xoxoxo.mysql.database.azure.com:3306/xoxoxo’. 2022-07-08 07:51:02 ERROR rasa.core.tracker_store - Could not create tables: (pymysql.err.OperationalError) (9002, ‘SSL connection is required. Please specify SSL options and retry.\x00’) (Background on this error at: Error Messages — SQLAlchemy 1.4 Documentation) 2022-07-08 07:51:02 DEBUG rasa.core.tracker_store - Connection to SQL database ‘xoxoxo’ successful. 2022-07-08 07:51:02 DEBUG rasa.core.tracker_store - Connected to SQLTrackerStore.

1 Like