You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice the MYSQL_OPTIONS does have the SSL settings, so that looks good. However, when the migrate job runs, it fails to establish a secure connection with the MySQL database:
my-database.mysql.database.azure.com (4.208.78.XXX:3306) open
/usr/local/lib/python3.12/site-packages/telegram/utils/request.py:49: UserWarning: python-telegram-bot is using upstream urllib3. This is allowed but not supported by python-telegram-bot maintainers.
warnings.warn(
source=engine:app google_trace_id=none logger=django_dbconn_retry.apps Database connection failed. Refreshing...
source=engine:app google_trace_id=none logger=django_dbconn_retry.apps Reconnecting to the database didn't help (3159, 'Connections using insecure transport are prohibited while --require_secure_transport=ON.')
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/django_dbconn_retry/apps.py", line 51, in ensure_connection_with_retries
self.connect()
File "/usr/local/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/base/base.py", line 270, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 247, in get_new_connection
connection = Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 361, in __init__
self.connect()
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 669, in connect
self._request_authentication()
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 957, in _request_authentication
auth_packet = self._read_packet()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 775, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.12/site-packages/pymysql/protocol.py", line 219, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.12/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (3159, 'Connections using insecure transport are prohibited while --require_secure_transport=ON.')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/django_dbconn_retry/apps.py", line 51, in ensure_connection_with_retries
self.connect()
File "/usr/local/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/base/base.py", line 270, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 247, in get_new_connection
connection = Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 361, in __init__
self.connect()
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 669, in connect
self._request_authentication()
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 957, in _request_authentication
auth_packet = self._read_packet()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 775, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.12/site-packages/pymysql/protocol.py", line 219, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.12/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (3159, 'Connections using insecure transport are prohibited while --require_secure_transport=ON.')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/etc/app/manage.py", line 34, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 106, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 100, in handle
self.check(databases=[database])
File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 485, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/core/checks/database.py", line 13, in check_database_backends
issues.extend(conn.validation.check(**kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/mysql/validation.py", line 9, in check
issues.extend(self._check_sql_mode(**kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/mysql/validation.py", line 14, in _check_sql_mode
self.connection.sql_mode & {"STRICT_TRANS_TABLES", "STRICT_ALL_TABLES"}
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 443, in sql_mode
sql_mode = self.mysql_server_data["sql_mode"]
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 399, in mysql_server_data
with self.temporary_connection() as cursor:
File "/usr/local/lib/python3.12/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/base/base.py", line 705, in temporary_connection
with self.cursor() as cursor:
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/base/base.py", line 330, in cursor
return self._cursor()
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/base/base.py", line 306, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.12/site-packages/django_dbconn_retry/apps.py", line 69, in ensure_connection_with_retries
self.ensure_connection()
File "/usr/local/lib/python3.12/site-packages/django_dbconn_retry/apps.py", line 48, in ensure_connection_with_retries
with self.wrap_database_errors:
File "/usr/local/lib/python3.12/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.12/site-packages/django_dbconn_retry/apps.py", line 51, in ensure_connection_with_retries
self.connect()
File "/usr/local/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/base/base.py", line 270, in connect
self.connection = self.get_new_connection(conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/django/db/backends/mysql/base.py", line 247, in get_new_connection
connection = Database.connect(**conn_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 361, in __init__
self.connect()
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 669, in connect
self._request_authentication()
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 957, in _request_authentication
auth_packet = self._read_packet()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymysql/connections.py", line 775, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.12/site-packages/pymysql/protocol.py", line 219, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.12/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
raise errorclass(errno, errval)
django.db.utils.OperationalError: (3159, 'Connections using insecure transport are prohibited while --require_secure_transport=ON.')
What did you expect to happen:
I expected that the connection to MySQL would use SSL, since I provided the ca.crt and specified that it should validate the SSL options.
How do we reproduce it?
To reproduce it you need to try connecting to an Azure MySQL database. I expect that you would be able to reproduce this with just the helm chart, and trying to get it to work with an Azure MySQL database that requires SSL.
Grafana OnCall Version
1.9.25
Product Area
Helm/Kubernetes/Docker, CI/CD
Grafana OnCall Platform?
Kubernetes
User's Browser?
No response
Anything else to add?
No response
The text was updated successfully, but these errors were encountered:
What went wrong?
What happened:
I set up the CA certificate (which I downloaded from here) as a secret, and I verified that mounting it works fine.
If I inspect the migrate job, it looks like this:
Notice the
MYSQL_OPTIONS
does have the SSL settings, so that looks good. However, when the migrate job runs, it fails to establish a secure connection with the MySQL database:What did you expect to happen:
How do we reproduce it?
To reproduce it you need to try connecting to an Azure MySQL database. I expect that you would be able to reproduce this with just the helm chart, and trying to get it to work with an Azure MySQL database that requires SSL.
Grafana OnCall Version
1.9.25
Product Area
Helm/Kubernetes/Docker, CI/CD
Grafana OnCall Platform?
Kubernetes
User's Browser?
No response
Anything else to add?
No response
The text was updated successfully, but these errors were encountered: