Getting aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to https://api-gateway.instructure.com/ids/auth/logind Since 11 Mar 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It occurs intermittently during individual table syncs.
2025-03-11 06:15:19,229 - DEBUG course_account_associations table has been updated
2025-03-11 06:54:49,916 - DEBUG enrollments table has been updated
2025-03-11 07:33:28,644 - DEBUG course_sections table has been updated
2025-03-11 08:12:36,144 - DEBUG courses table has been updated
2025-03-11 08:51:58,219 - DEBUG accounts table has been updated
2025-03-11 09:30:14,639 - DEBUG enrollment_terms table has been updated
aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to https://api-gateway.instructure.com/ids/auth/logind
2025-03-11 10:47:53,488 - DEBUG enrollment_dates_overrides table has been updated
2025-03-11 11:28:44,545 - DEBUG enrollment_states table has been updated
aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to (etc, etc)
I'm running the following (minus a bunch of logging commands):
$tables = 'course_account_associations', 'enrollments', 'course_sections', 'courses', 'accounts', 'enrollment_terms', 'account_users', 'enrollment_dates_overrides', 'enrollment_states', 'roles', 'user_account_associations', 'users', 'scores', 'submissions', 'grading_periods', 'grading_period_groups', 'pseudonyms'
foreach ($table in $tables) {
C:\Python311\Scripts\dap.exe --base-url $DAP_API_URL --client-id $Env:CD_API_KEY --client-secret $Env:CD_API_SECRET --loglevel debug --logfile _${table}_${SyncDate}_dap_output.txt syncdb --namespace canvas --table $table --connection-string $Env:DAP_CONN_STRING
}
The first error in the above section is account_users, so here's the contents of _account_users_03_11_2025_0525_dap_output.txt :
2025-03-11 10:07:20,328 - INFO - Python version: 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]
2025-03-11 10:07:20,328 - INFO - Platform: uname_result(system='Windows', node='informerdev', release='10', version='10.0.20348', machine='AMD64')
2025-03-11 10:07:25,095 - INFO - Package versions: {'aiofiles': '23.2.1', 'aiohttp': '3.9.3', 'aiohttp-retry': '2.8.3', 'instructure-dap-client': '1.3.1', 'json_strong_typing': '0.3.6', 'PyJWT': '2.8.0', 'pysqlsync': '0.8.1', 'tsv2py': '0.7.1', 'types-aiofiles': '23.2.0.20240403'}
2025-03-11 10:07:25,095 - DEBUG - Checking for valid database connection string (abstract_db_command.py:14)
2025-03-11 10:07:25,095 - DEBUG - Checking connection to database (abstract_db_command.py:23)
2025-03-11 10:07:31,065 - INFO - Database version: PostgreSQL 16.2, compiled by Visual C++ build 1937, 64-bit
2025-03-11 10:07:31,065 - DEBUG - Client region: us-east-1 (api.py:118)
2025-03-11 10:07:31,065 - DEBUG - synchronizing table: canvas.account_users (sql.py:61)
2025-03-11 10:07:31,597 - DEBUG - Found version records: [database_version(version=1)] (db_version_upgrader.py:59)
2025-03-11 10:07:31,597 - DEBUG - Current version: 1; Latest version: 1 (db_version_upgrader.py:43)
2025-03-11 10:07:31,597 - DEBUG - No upgrade needed (db_version_upgrader.py:45)
2025-03-11 10:07:31,597 - DEBUG - fetching schema for table: canvas.account_users (sql_op.py:103)
2025-03-11 10:07:31,597 - DEBUG - Get schema of table: account_users (api.py:441)
2025-03-11 10:07:31,597 - DEBUG - Authenticating to DAP in region us-east-1 (api.py:384)
2025-03-11 10:08:11,409 - ERROR - Connection timeout to host https://api-gateway.instructure.com/ids/auth/login
Traceback (most recent call last):
File "C:\Python3...
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python311\Lib\site-packages\aiohttp\client.py", line 573, in _request
async with ceil_timeout(
File "C:\Python311\Lib\asyncio\timeouts.py", line 111, in __aexit__
raise TimeoutError from exc_val
TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python311\Lib\site-packages\dap\__main__.py", line 166, in console_entry
main()
File "C:\Python311\Lib\site-packages\dap\__main__.py", line 129, in main
asyncio.run(dapCommand.execute(args))
File "C:\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\dap\commands\commands.py", line 31, in execute
executed = await super().execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\dap\commands\base.py", line 49, in execute
if await subcommand.execute(args):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\dap\commands\base.py", line 45, in execute
await self._execute_impl(args)
File "C:\Python311\Lib\site-packages\dap\commands\syncdb_command.py", line 42, in _execute_impl
await sync_db(
File "C:\Python311\Lib\site-packages\dap\actions\sync_db.py", line 16, in sync_db
await SQLReplicator(session, db_connection).synchronize(namespace, table_name)
File "C:\Python311\Lib\site-packages\dap\replicator\sql.py", line 77, in synchronize
await sync_op.run()
File "C:\Python311\Lib\site-packages\dap\replicator\sql_op_sync.py", line 36, in run
entity_type, schema, versioned_schema = await fetch_schema_for_table(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\dap\replicator\sql_op.py", line 104, in fetch_schema_for_table
versioned_schema: VersionedSchema = await session.get_table_schema(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\dap\api.py", line 442, in get_table_schema
versioned_schema = await self._get(
^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\dap\api.py", line 232, in _get
await self.authenticate()
File "C:\Python311\Lib\site-packages\dap\api.py", line 391, in authenticate
properties = await self._post_auth_request(self._credentials.basic_credentials)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\dap\api.py", line 336, in _post_auth_request
async with self._session.post(
File "C:\Python311\Lib\site-packages\aiohttp\client.py", line 1194, in __aenter__
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\aiohttp\client.py", line 582, in _request
raise ServerTimeoutError(
aiohttp.client_exceptions.ServerTimeoutError: Connection timeout to host https://api-gateway.instructure.com/ids/auth/login
I'm afraid I'm not really quite sure what to do here. I saw another thread about a timeout issue and this: https://github.com/pypa/bandersnatch/issues/864 but I'm not sure where this resides:
Relevant parts of configuration look like this:
[mirrors]
json = true
timeout = 300
workers = 5
hash-index = false
stop-on-error = false