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
We have a client who is having some difficulty connecting from a MariaDB instance on Windows to one of our SkySQL MariaDB instances via the SQLAlchemy async engine (using version 2.0.35). He reports that the synchronous engine works as expected. He's been hitting this error:
sqlalchemy.exc.OperationalError: (asyncmy.errors.OperationalError) (2003, "Can't connect to MySQL server on '[dbpwf37461322.sysp0000.db1.skysql.com](http://dbpwf37461322.sysp0000.db1.skysql.com/)' ([WinError 87] The parameter is incorrect)")
He reports that the error occurs regardless of whether SSL is being used.
Here is how he is connecting:
import ssl
from sqlalchemy import Table, Column, Integer, String, MetaData, TIMESTAMP
from sqlalchemy.sql import func
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine
from sqlalchemy.orm import sessionmaker
# Create an SSL context for the asyncmy connection
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
# Connection string for async engine
connection_string = (
f"mysql+asyncmy://{username}:{password}@{host}:{port}/{database}"
)
# Create async engine with SSL arguments
async_engine = create_async_engine(connection_string, connect_args={'ssl': ssl_context}, echo=True)
# Define metadata and table
metadata = MetaData()
sample_table = Table(
'sample_table', metadata,
Column('id', Integer, primary_key=True, autoincrement=True),
Column('name', String(100), nullable=False),
Column('age', Integer),
Column('created_at', TIMESTAMP, server_default=func.current_timestamp())
)
# Define session maker
AsyncSessionLocal = sessionmaker(
autocommit=False, autoflush=False, bind=async_engine, class_=AsyncSession
)
# Async database access function
async def get_db():
async with AsyncSessionLocal() as session:
yield session
# Async main function to insert data
async def main():
# Create tables if they don't exist
async with async_engine.begin() as conn:
await conn.run_sync(metadata.create_all)
# Insert data
insert_statement = sample_table.insert().values(name='John Doe', age=30)
async with AsyncSessionLocal() as session:
async with session.begin():
await session.execute(insert_statement)
await session.commit()
print("Data inserted successfully.")
# Run the async main function
if __name__ == "__main__":
import asyncio
asyncio.run(main())
And here is the traceback:
`Traceback (most recent call last):
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio[sslproto.py](http://sslproto.py/)", line 560, in do_handshake
self.sslobj.dohandshake()
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib[ssl.py](http://ssl.py/)", line 916, in do_handshake
self.sslobj.do_handshake()
ssl.SSLWantReadError: The operation did not complete (read) (_ssl.c:1000)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "asyncmy\connection.pyx", line 572, in asyncmy.connection.Connection.connect
File "asyncmy\connection.pyx", line 773, in request_authentication
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio[streams.py](http://streams.py/)", line 48, in open_connection
transport, _ = await loop.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\baseevents.py", line 1148, in create_connection
transport, protocol = await self.create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\baseevents.py", line 1181, in create_connection_transport
await waiter
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\proactorevents.py", line 402, in _loop_writing
self._write_fut = self._loop._proactor.send(self.sock, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\windowsevents.py", line 539, in send
self.register_with_iocp(conn)
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\windowsevents.py", line 709, in _register_with_iocp
_overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)
OSError: [WinError 87] The parameter is incorrect
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 146, in init
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 3302, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 449, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 712, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[impl.py](http://impl.py/)", line 179, in _do_get
with util.safe_reraise():
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util[langhelpers.py](http://langhelpers.py/)", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[impl.py](http://impl.py/)", line 177, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 390, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 674, in init
self.__connect()
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 900, in __connect
with util.safe_reraise():
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util[langhelpers.py](http://langhelpers.py/)", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 896, in _connect
self.dbapi_connection = connection = pool.invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[create.py](http://create.py/)", line 643, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[default.py](http://default.py/)", line 621, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\dialects\mysql[asyncmy.py](http://asyncmy.py/)", line 284, in connect
await_only(creator_fn(*arg, **kw)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 132, in await_only
return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 196, in greenlet_spawn
value = await result
^^^^^^^^^^^^
File "asyncmy\connection.pyx", line 1343, in _connect
File "asyncmy\connection.pyx", line 588, in connect
asyncmy.errors.OperationalError: (2003, "Can't connect to MySQL server on 'dbpwf37461322.sysp0000.db1.skysql.com' ([WinError 87] The parameter is incorrect)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector[playground.py](http://playground.py/)", line 124, in asyncio.run(main())
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio[runners.py](http://runners.py/)", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio[runners.py](http://runners.py/)", line 118, in run
return self.loop.rununtil_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\baseevents.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector[playground.py](http://playground.py/)", line 109, in main
async with async_engine.begin() as conn:
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib[contextlib.py](http://contextlib.py/)", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\ext\asyncio[engine.py](http://engine.py/)", line 1063, in begin
async with conn:
^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\ext\asyncio[base.py](http://base.py/)", line 121, in aenter
return await self.start(is_ctxmanager=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\ext\asyncio[engine.py](http://engine.py/)", line 273, in start
await greenlet_spawn(self.sync_engine.connect)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 201, in greenlet_spawn
result = context.throw(*sys.exc_info())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 3278, in connect
return self._connection_cls(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 148, in init
Connection._handle_dbapi_exception_noconnection(
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 2442, in _handle_dbapi_exception_noconnection
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 146, in init
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 3302, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 449, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 712, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[impl.py](http://impl.py/)", line 179, in _do_get
with util.safe_reraise():
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util[langhelpers.py](http://langhelpers.py/)", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[impl.py](http://impl.py/)", line 177, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 390, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 674, in init
self.__connect()
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 900, in __connect
with util.safe_reraise():
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util[langhelpers.py](http://langhelpers.py/)", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 896, in _connect
self.dbapi_connection = connection = pool.invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[create.py](http://create.py/)", line 643, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[default.py](http://default.py/)", line 621, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\dialects\mysql[asyncmy.py](http://asyncmy.py/)", line 284, in connect
await_only(creator_fn(*arg, **kw)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 132, in await_only
return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 196, in greenlet_spawn
value = await result
^^^^^^^^^^^^
File "asyncmy\connection.pyx", line 1343, in _connect
File "asyncmy\connection.pyx", line 588, in connect
sqlalchemy.exc.OperationalError: (asyncmy.errors.OperationalError) (2003, "Can't connect to MySQL server on 'dbpwf37461322.sysp0000.db1.skysql.com' ([WinError 87] The parameter is incorrect)")
(Background on this error at: https://sqlalche.me/e/20/e3q8)`
We have a client who is having some difficulty connecting from a MariaDB instance on Windows to one of our SkySQL MariaDB instances via the SQLAlchemy async engine (using version 2.0.35). He reports that the synchronous engine works as expected. He's been hitting this error:
sqlalchemy.exc.OperationalError: (asyncmy.errors.OperationalError) (2003, "Can't connect to MySQL server on '[dbpwf37461322.sysp0000.db1.skysql.com](http://dbpwf37461322.sysp0000.db1.skysql.com/)' ([WinError 87] The parameter is incorrect)")
He reports that the error occurs regardless of whether SSL is being used.
Here is how he is connecting:
And here is the traceback:
`Traceback (most recent call last):
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio[sslproto.py](http://sslproto.py/)", line 560, in do_handshake
self.sslobj.dohandshake()
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib[ssl.py](http://ssl.py/)", line 916, in do_handshake
self.sslobj.do_handshake()
ssl.SSLWantReadError: The operation did not complete (read) (_ssl.c:1000)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "asyncmy\connection.pyx", line 572, in asyncmy.connection.Connection.connect
File "asyncmy\connection.pyx", line 773, in request_authentication
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio[streams.py](http://streams.py/)", line 48, in open_connection
transport, _ = await loop.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\baseevents.py", line 1148, in create_connection
transport, protocol = await self.create_connection_transport(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\baseevents.py", line 1181, in create_connection_transport
await waiter
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\proactorevents.py", line 402, in _loop_writing
self._write_fut = self._loop._proactor.send(self.sock, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\windowsevents.py", line 539, in send
self.register_with_iocp(conn)
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\windowsevents.py", line 709, in _register_with_iocp
_overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)
OSError: [WinError 87] The parameter is incorrect
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 146, in init
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 3302, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 449, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 712, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[impl.py](http://impl.py/)", line 179, in _do_get
with util.safe_reraise():
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util[langhelpers.py](http://langhelpers.py/)", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[impl.py](http://impl.py/)", line 177, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 390, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 674, in init
self.__connect()
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 900, in __connect
with util.safe_reraise():
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util[langhelpers.py](http://langhelpers.py/)", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 896, in _connect
self.dbapi_connection = connection = pool.invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[create.py](http://create.py/)", line 643, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[default.py](http://default.py/)", line 621, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\dialects\mysql[asyncmy.py](http://asyncmy.py/)", line 284, in connect
await_only(creator_fn(*arg, **kw)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 132, in await_only
return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 196, in greenlet_spawn
value = await result
^^^^^^^^^^^^
File "asyncmy\connection.pyx", line 1343, in _connect
File "asyncmy\connection.pyx", line 588, in connect
asyncmy.errors.OperationalError: (2003, "Can't connect to MySQL server on 'dbpwf37461322.sysp0000.db1.skysql.com' ([WinError 87] The parameter is incorrect)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector[playground.py](http://playground.py/)", line 124, in
asyncio.run(main())
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio[runners.py](http://runners.py/)", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio[runners.py](http://runners.py/)", line 118, in run
return self.loop.rununtil_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib\asyncio\baseevents.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector[playground.py](http://playground.py/)", line 109, in main
async with async_engine.begin() as conn:
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\AppData\Local\Programs\Python\Python312\Lib[contextlib.py](http://contextlib.py/)", line 210, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\ext\asyncio[engine.py](http://engine.py/)", line 1063, in begin
async with conn:
^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\ext\asyncio[base.py](http://base.py/)", line 121, in aenter
return await self.start(is_ctxmanager=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\ext\asyncio[engine.py](http://engine.py/)", line 273, in start
await greenlet_spawn(self.sync_engine.connect)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 201, in greenlet_spawn
result = context.throw(*sys.exc_info())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 3278, in connect
return self._connection_cls(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 148, in init
Connection._handle_dbapi_exception_noconnection(
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 2442, in _handle_dbapi_exception_noconnection
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 146, in init
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[base.py](http://base.py/)", line 3302, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 449, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 712, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[impl.py](http://impl.py/)", line 179, in _do_get
with util.safe_reraise():
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util[langhelpers.py](http://langhelpers.py/)", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[impl.py](http://impl.py/)", line 177, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 390, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 674, in init
self.__connect()
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 900, in __connect
with util.safe_reraise():
^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util[langhelpers.py](http://langhelpers.py/)", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\pool[base.py](http://base.py/)", line 896, in _connect
self.dbapi_connection = connection = pool.invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[create.py](http://create.py/)", line 643, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\engine[default.py](http://default.py/)", line 621, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\dialects\mysql[asyncmy.py](http://asyncmy.py/)", line 284, in connect
await_only(creator_fn(*arg, **kw)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 132, in await_only
return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sarfa\OneDrive\Desktop\dev\platform-connector\venv\Lib\site-packages\sqlalchemy\util_concurrencypy3k.py", line 196, in greenlet_spawn
value = await result
^^^^^^^^^^^^
File "asyncmy\connection.pyx", line 1343, in _connect
File "asyncmy\connection.pyx", line 588, in connect
sqlalchemy.exc.OperationalError: (asyncmy.errors.OperationalError) (2003, "Can't connect to MySQL server on 'dbpwf37461322.sysp0000.db1.skysql.com' ([WinError 87] The parameter is incorrect)")
(Background on this error at: https://sqlalche.me/e/20/e3q8)`
I am copying this from a thread I opened here: sqlalchemy/sqlalchemy#11969
Thank you!
The text was updated successfully, but these errors were encountered: