CD2: is the dap tool working reliably for you?

Jump to solution
ColinMurtaugh
Community Champion

After upgrading to version 0.3.2 of the instructure-dap-client python library, I'm trying to use the dap tool to fetch some tables. Most of the time I'm getting errors like this: 

 dap syncdb --table accounts
2023-03-29 16:08:39,614 - INFO - Query started with job ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXX
2023-03-29 16:08:39,614 - INFO - Query job still in status: waiting. Checking again in 5 seconds...
2023-03-29 16:08:45,040 - INFO - Query job still in status: running. Checking again in 5 seconds...
2023-03-29 16:08:50,403 - INFO - Query job still in status: running. Checking again in 5 seconds...
2023-03-29 16:08:56,918 - WARNING - Received error in response:
Traceback (most recent call last):
File "/Users/cmurtaugh/.pyenv/versions/canvas-data-2/bin/dap", line 8, in <module>
sys.exit(console_entry())
^^^^^^^^^^^^^^^
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/__main__.py", line 121, in console_entry
main()
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/__main__.py", line 115, in main
asyncio.run(dapCommand.execute(args))
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/commands/commands.py", line 33, in execute
executed = await super().execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/commands/base.py", line 55, in execute
if await subcommand.execute(args):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/commands/base.py", line 51, in execute
await self._execute_impl(args, session)
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/commands/syncdb_command.py", line 67, in _execute_impl
await self._save_resources(
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/commands/syncdb_command.py", line 123, in _save_resources
await self._download_and_save(context_aware_object, table_def, session, db)
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/commands/syncdb_command.py", line 140, in _download_and_save
resource_array = await session.get_resources([object])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/api.py", line 421, in get_resources
response = await self._post("/dap/object/url", objects, ResourceResult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/api.py", line 247, in _post
return await self._process(response, response_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cmurtaugh/.pyenv/versions/3.11.2/envs/canvas-data-2/lib/python3.11/site-packages/dap/api.py", line 292, in _process
raise error_object
dap.dap_error.ProcessingError

Anyone else seeing this? I've tried both initdb and syncdb with a few different tables. Occasionally it works, but most of the time I get the error above. 

--Colin

Labels (4)
1 Solution

Thanks for calling attention to these issues (lack of synchronization/locking on database client objects, time-out when replicating large tables, and improper serialization of JSON type), they have been addressed in version 0.3.4. Feel free to reach out if any of these issues persist with the latest version of the DAP client library and CLI.

View solution in original post