The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December.
Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
We've been cloning Canvas data successfully for months using DAP2, but recently noticed this sync failure, which looks to be coming from DAP code. When I run this directly in a query editor it balks at the newline separators and the quotes as well as the comma separating the two add value clauses.
File \"/var/task/pysqlsync/base.py\", line 851, in execute\n raise QueryException(statement) from e\npysqlsync.base.QueryException: error executing query:\nALTER TYPE \"canvas\".\"assignments__workflow_state\"\nADD VALUE 'outcome_alignment_cloning',\nADD VALUE 'failed_to_clone_outcome_alignment';", "exception_name": "QueryException", "stack_trace": { "type": "QueryException", "value": "error executing query:\nALTER TYPE \"canvas\".\"assignments__workflow_state\"\nADD VALUE 'outcome_alignment_cloning',\nADD VALUE 'failed_to_clone_outcome_alignment';", "module": "pysqlsync.base", "frames": [ { "file": "/var/task/app.py", "line": 60, "function": "lambda_handler", "statement": "asyncio.get_event_loop().run_until_complete(" }, { "file": "/var/lang/lib/python3.11/asyncio/base_events.py", "line": 654, "function": "run_until_complete", "statement": "return future.result()" }, { "file": "/var/task/app.py", "line": 105, "function": "sync_table", "statement": "await SQLReplicator(session, db_connection).synchronize(namespace, table_name)" }, { "file": "/var/task/dap/replicator/sql.py", "line": 77, "function": "synchronize", "statement": "await sync_op.run()" }, { "file": "/var/task/dap/replicator/sql_op_sync.py", "line": 39, "function": "run", "statement": "await self.explorer.synchronize(modules=[meta_schema, self.namespace_module])" }, { "file": "/var/task/pysqlsync/base.py", "line": 1442, "function": "synchronize", "statement": "await self.conn.execute(stmt)" }, { "file": "/var/task/pysqlsync/base.py", "line": 851, "function": "execute", "statement": "raise QueryException(statement) from e" } ]
Anyone know how to resolve this?
Solved! Go to Solution.
I've just created an issue on pysqlsync's repository in advance, but the issue still exists as-is.
We're seeing similar behavior, it seems to affect several tables as a result of a recent update which requires migrations. This update: https://community.canvaslms.com/t5/Canvas-Change-Log/2025-API-and-CLI-Change-Log/ta-p/626858
Specifically, the following tables are giving similar errors:
- submission_comments
- submissions
- learning_outcomes
- assignments
- conversation_messages
We think pysqlsync used by Instructure's DAP client corresponds to https://github.com/hunyadi/pysqlsync/ and the migration is failing due to invalid SQL generated by this library. Observable in code here.
`ALTER TYPE` does not support having multiple `ADD VALUE` components simply comma separated and appended together like below:
ALTER TYPE "canvas"."submissions__media_comment_type"
ADD VALUE 'audio/aac',
ADD VALUE 'audio/amr',
ADD VALUE 'audio/flac',
ADD VALUE 'audio/mp4',
ADD VALUE 'audio/mpeg',
ADD VALUE 'audio/ogg',
ADD VALUE 'audio/vnd.dlna.adts',
ADD VALUE 'audio/wav',
ADD VALUE 'audio/webm',
ADD VALUE 'audio/x-m4a',
ADD VALUE 'audio/x-ms-wma',
ADD VALUE 'audio/x-wav',
ADD VALUE 'video/3gpp',
ADD VALUE 'video/avi',
ADD VALUE 'video/mp4',
ADD VALUE 'video/mpeg',
ADD VALUE 'video/ogg',
ADD VALUE 'video/quicktime',
ADD VALUE 'video/webm',
ADD VALUE 'video/x-m4v',
ADD VALUE 'video/x-matroska',
ADD VALUE 'video/x-ms-asf',
ADD VALUE 'video/x-ms-wmv',
ADD VALUE 'video/x-msvideo';
I've just created an issue on pysqlsync's repository in advance, but the issue still exists as-is.
@CodyStephenson I saw the response from hunyadi. I guess we need Instructure to update the DAP client application now.
We just started experiencing the same issue. Thank you for creating the issue report. We emailed canvasdatahelp@instructure.com as it looks like the issue is tied to the release referenced above but they were unable to help and referred us to the DAP Client Library page.
@CodyStephenson @marco_divittori Thank you -- applying hunyadi's changes fixed the issue for me. All I had to do was:
pip uninstall pysqlsync
pip install pysqlsync@git+https://github.com/hunyadi/pysqlsync.git
Then I re-built / re-deployed my scripts and re-ran. It's working now.
Looks like Instructure rolled the fix into a new DAP client release.
https://community.canvaslms.com/t5/The-Product-Blog/DAP-CLI-1-3-1-Released-Fix-for-PostgreSQL-Sync-I...
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in