dap CLI tool only throws "not all arguments converted during string formatting" error with MySQL 5.7

daniel_powers
Community Explorer

 When running dap syncdb using our MySQL 5.7 database we get the error shown below for several tables. When dap syncdb is run for the same tables using our development MySQL 8.0 database we do not get these errors. What minimum MySQL release is required by the dap CLI tool.

A sample error and stack trace when running with MySQL 5.7.

dap syncdb --table assignments
2023-10-18 11:47:14,815 - WARNING - ⚠️Warning: aiomysql is classified as being in alpha development status. Instructure cannot assume responsibility for any potential changes or consequences resulting from its usage.
2023-10-18 11:47:15,510 - INFO - Query started with job ID: 5c28b70c-d680-4265-8f4f-50330f63300a
...
2023-10-18 11:47:31,198 - INFO - Data has been successfully retrieved:
{"id": "5c28b70c-d680-4265-8f4f-50330f63300a", "status": "complete", "expires_at": "2023-10-19T15:47:15Z", "objects": [{"id": "5c28b70c-d680-4265-8f4f-50330f63300a/part-00000-794bedd7-b4da-4de3-be9d-3fe29a6f8890-c000.json.gz"}], "schema_version": 2, "since": "2023-10-12T12:41:14Z", "until": "2023-10-18T14:01:35Z"}
2023-10-18 11:47:31,663 - ERROR - not all arguments converted during string formatting
Traceback (most recent call last):
File "...\dap\__main__.py", line 133, in console_entry
main()
File "...\dap\__main__.py", line 125, in main
asyncio.run(dapCommand.execute(args))
File "C:\Users\dpowers\AppData\Local\anaconda3\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\dpowers\AppData\Local\anaconda3\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "...\dap\commands\commands.py", line 31, in execute
executed = await super().execute(args)
File "...\dap\commands\base.py", line 49, in execute
if await subcommand.execute(args):
File "...\dap\commands\base.py", line 45, in execute
await self._execute_impl(args)
File "...\dap\commands\syncdb_command.py", line 42, in _execute_impl
await sync_db(
File "...\dap\actions\sync_db.py", line 16, in sync_db
await SQLReplicator(session, db_connection).synchronize(
File "...\dap\replicator\sql.py", line 120, in synchronize
await client.download(
File "...\dap\downloader.py", line 171, in download
await self._download_and_save(db_lock, context_aware_object, processor)
File "...\dap\downloader.py", line 195, in _download_and_save
await processor.process(obj, records)
File "...\dap\integration\base_processor.py", line 19, in process
await self.process_impl(obj, self._convert(records))
File "...\dap\plugins\mysql\sync_processor.py", line 78, in process_impl
await self._db_connection.execute(
File "...\dap\integration\base_connection.py", line 41, in execute
return await query(self._raw_connection)
File "...\dap\plugins\sqlalchemy\queries.py", line 46, in __call__
return await conn.execute(self._statement, self._parameters)
File "...\sqlalchemy\ext\asyncio\engine.py", line 652, in execute
result = await greenlet_spawn(
File "...\sqlalchemy\util\_concurrency_py3k.py", line 190, in greenlet_spawn
result = context.throw(*sys.exc_info())
File "...\sqlalchemy\engine\base.py", line 1412, in execute
return meth(
File "...\sqlalchemy\sql\elements.py", line 516, in _execute_on_connection
return connection._execute_clauseelement(
File "...\sqlalchemy\engine\base.py", line 1635, in _execute_clauseelement
ret = self._execute_context(
File "...\sqlalchemy\engine\base.py", line 1844, in _execute_context
return self._exec_single_context(
File "...\sqlalchemy\engine\base.py", line 1984, in _exec_single_context
self._handle_dbapi_exception(
File "...\sqlalchemy\engine\base.py", line 2342, in _handle_dbapi_exception
raise exc_info[1].with_traceback(exc_info[2])
File "...\sqlalchemy\engine\base.py", line 1934, in _exec_single_context
self.dialect.do_executemany(
File "...\sqlalchemy\dialects\mysql\mysqldb.py", line 175, in do_executemany
rowcount = cursor.executemany(statement, parameters)
File "...\sqlalchemy\dialects\mysql\aiomysql.py", line 94, in executemany
return self.await_(
File "...\sqlalchemy\util\_concurrency_py3k.py", line 125, in await_only
return current.driver.switch(awaitable) # type: ignore[no-any-return]
File "...\sqlalchemy\util\_concurrency_py3k.py", line 185, in greenlet_spawn
value = await result
File "...\sqlalchemy\dialects\mysql\aiomysql.py", line 112, in _executemany_async
return await self._cursor.executemany(operation, seq_of_parameters)
File "...\aiomysql\cursors.py", line 281, in executemany
return (await self._do_execute_many(
File "...\aiomysql\cursors.py", line 302, in _do_execute_many
v = values % escape(next(args), conn)
TypeError: not all arguments converted during string formatting

Labels (1)