Please send minimal/reproducible codes and steps to reproduce this issue. Only 
stack trace doesn’t help. 

> On Dec 7, 2023, at 11:37, 何于豪 <heyu...@wisecotech.com> wrote:
> 
> 
> hello there:
> python version 3.8.17
> pymysql version  1.0.0
> platform:both linux and windows can reproduce
> error stack 
> Traceback (most recent call last):
>   File "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\flask\app.py", 
> line 2091, in __call__
>     return self.wsgi_app(environ, start_response)
>   File "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\flask\app.py", 
> line 2076, in wsgi_app
>     response = self.handle_exception(e)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\skywalking\plugins\sw_flask.py",
>  line 87, in _sw_handle_exception
>     return _handle_exception(this, e)
>   File "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\flask\app.py", 
> line 2073, in wsgi_app
>     response = self.full_dispatch_request()
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\skywalking\plugins\sw_flask.py",
>  line 65, in _sw_full_dispatch_request
>     resp = _full_dispatch_request(this)
>   File "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\flask\app.py", 
> line 1519, in full_dispatch_request
>     rv = self.handle_user_exception(e)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\skywalking\plugins\sw_flask.py",
>  line 79, in _sw_handle_user_exception
>     return _handle_user_exception(this, e)
>   File "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\flask\app.py", 
> line 1517, in full_dispatch_request
>     rv = self.dispatch_request()
>   File "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\flask\app.py", 
> line 1503, in dispatch_request
>     return 
> self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
>   File "D:\code\model_algo\api\controller\job.py", line 53, in job_result
>     if result.status == "FAILURE":
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\celery\result.py", line 
> 473, in state
>     return self._get_task_meta()['status']
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\celery\result.py", line 
> 412, in _get_task_meta
>     return self._maybe_set_cache(self.backend.get_task_meta(self.id))
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\celery\backends\base.py",
>  line 386, in get_task_meta
>     meta = self._get_task_meta_for(task_id)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\celery\backends\database\__init__.py",
>  line 53, in _inner
>     return fun(*args, **kwargs)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\celery\backends\database\__init__.py",
>  line 122, in _get_task_meta_for
>     session = self.ResultSession()
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\celery\backends\database\__init__.py",
>  line 96, in ResultSession
>     return session_manager.session_factory(
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\celery\backends\database\session.py",
>  line 59, in session_factory
>     self.prepare_models(engine)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\celery\backends\database\session.py",
>  line 54, in prepare_models
>     ResultModelBase.metadata.create_all(engine)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\sql\schema.py",
>  line 4917, in create_all
>     bind._run_ddl_visitor(
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\engine\base.py",
>  line 3227, in _run_ddl_visitor
>     with self.begin() as conn:
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\engine\base.py",
>  line 3143, in begin
>     conn = self.connect(close_with_result=close_with_result)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\engine\base.py",
>  line 3315, in connect
>     return self._connection_cls(self, close_with_result=close_with_result)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\engine\base.py",
>  line 96, in __init__
>     else engine.raw_connection()
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\engine\base.py",
>  line 3394, in raw_connection
>     return self._wrap_pool_connect(self.pool.connect, _connection)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\engine\base.py",
>  line 3361, in _wrap_pool_connect
>     return fn()
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\pool\base.py",
>  line 320, in connect
>     return _ConnectionFairy._checkout(self)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\pool\base.py",
>  line 884, in _checkout
>     fairy = _ConnectionRecord.checkout(pool)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\pool\base.py",
>  line 486, in checkout
>     rec = pool._do_get()
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\pool\impl.py",
>  line 256, in _do_get
>     return self._create_connection()
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\pool\base.py",
>  line 266, in _create_connection
>     return _ConnectionRecord(self)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\pool\base.py",
>  line 381, in __init__
>     self.__connect()
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\pool\base.py",
>  line 689, in __connect
>     pool.dispatch.connect.for_modify(
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\event\attr.py",
>  line 320, in _exec_w_sync_on_first_run
>     self(*args, **kw)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\event\attr.py",
>  line 334, in __call__
>     fn(*args, **kw)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\engine\create.py",
>  line 658, in on_connect
>     do_on_connect(dbapi_connection)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\sqlalchemy\dialects\mysql\mysqldb.py",
>  line 176, in on_connect
>     cursor.execute("SET NAMES %s" % charset_name)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\skywalking\plugins\sw_mysqlclient.py",
>  line 70, in execute
>     return self._self_cur.execute(query, args)
>   File 
> "C:\Users\heyuhao\.conda\envs\algo\lib\site-packages\skywalking\plugins\sw_pymysql.py",
>  line 45, in _sw_execute
>     span.tag(TagDbInstance((this.connection.db or b'').decode('utf-8')))
> AttributeError: 'str' object has no attribute 'decode'
> 
>    TKS.

Reply via email to