Skip to content

fix(knowledge): release kept connector documents in the background so removing a large source cannot time out #32613

fix(knowledge): release kept connector documents in the background so removing a large source cannot time out

fix(knowledge): release kept connector documents in the background so removing a large source cannot time out #32613

Triggered via pull request September 22, 2026 22:26
Status Failure
Total duration 3m 31s
Artifacts –

ci.yml

on: pull_request
Detect Version
Detect Version
Detect Desktop Changes
Detect Desktop Changes
Prepare Trigger.dev
Prepare Trigger.dev
Matrix: Build AMD64
Matrix: Build Dev ECR
Matrix: Build ARM64 (GHCR Only)
Matrix: Test and Build / oauth-postgres
Matrix: Test and Build / test-shard
Test and Build  /  Lint and Test
3m 11s
Test and Build / Lint and Test
Test and Build  /  Build App
3m 27s
Test and Build / Build App
Check Docs Changes
Check Docs Changes
Migrate Dev DB  /  Apply Database Migrations
Migrate Dev DB / Apply Database Migrations
Check Desktop Signing Secrets
Check Desktop Signing Secrets
Migrate DB  /  Apply Database Migrations
Migrate DB / Apply Database Migrations
Create Desktop Prerelease
0s
Create Desktop Prerelease
Promote Images
0s
Promote Images
Desktop Prerelease Build  /  Build, Sign, Notarize
Desktop Prerelease Build / Build, Sign, Notarize
Matrix: Create GHCR Manifests
Process Docs  /  Process Documentation Embeddings
Process Docs / Process Documentation Embeddings
Promote Trigger.dev
0s
Promote Trigger.dev
Publish Desktop Prerelease
Publish Desktop Prerelease
Resolve Attestation Subjects
0s
Resolve Attestation Subjects
Prune Desktop Prereleases
Prune Desktop Prereleases
Matrix: Attest Images
Create GitHub Release
Create GitHub Release
Desktop Release  /  Build, Sign, Notarize
Desktop Release / Build, Sign, Notarize
Fit to window
Zoom out
Zoom in

Annotations

7 errors and 6 warnings
Test and Build / PostgreSQL integration (migrate)
Process completed with exit code 1.
lib/workspaces/organization-workspaces.postgres.test.ts > organization workspace detachment lock order > lets acceptance finish before organization-delete without inverting invitation, workspace, or organization locks: apps/sim/lib/workspaces/organization-workspaces.postgres.test.ts#L166
AssertionError: promise rejected "Error: Failed query: SELECT st… { …(2) }" instead of resolving ❯ lib/workspaces/organization-workspaces.postgres.test.ts:166:30 Caused by: Error: Failed query: SELECT storage_by_workspace.workspace_id, COALESCE(SUM(storage_by_workspace.workspace_file_bytes), 0)::bigint AS workspace_file_bytes, COALESCE(SUM(storage_by_workspace.document_bytes), 0)::bigint AS document_bytes, COALESCE(SUM(storage_by_workspace.workspace_file_missing_size_count), 0)::bigint AS workspace_file_missing_size_count FROM ( SELECT "workspace_files"."workspace_id" AS workspace_id, SUM("workspace_files"."size_bytes") AS workspace_file_bytes, 0::bigint AS document_bytes, COUNT(*) FILTER (WHERE "workspace_files"."size_bytes" IS NULL)::bigint AS workspace_file_missing_size_count FROM "workspace_files" WHERE "workspace_files"."workspace_id" in ($1) AND "workspace_files"."context" = 'workspace' GROUP BY "workspace_files"."workspace_id" UNION ALL SELECT "knowledge_base"."workspace_id" AS workspace_id, 0::bigint AS workspace_file_bytes, SUM("document"."file_size"::bigint) AS document_bytes, 0::bigint AS workspace_file_missing_size_count FROM "document" INNER JOIN "knowledge_base" ON "knowledge_base"."id" = "document"."knowledge_base_id" WHERE "knowledge_base"."workspace_id" in ($2) AND "document"."connector_id" IS NULL AND "document"."deleted_at" IS NULL GROUP BY "knowledge_base"."workspace_id" UNION ALL SELECT "knowledge_base"."workspace_id" AS workspace_id, 0::bigint AS workspace_file_bytes, SUM("knowledge_connector"."detach_reserved_bytes") AS document_bytes, 0::bigint AS workspace_file_missing_size_count FROM "knowledge_connector" INNER JOIN "knowledge_base" ON "knowledge_base"."id" = "knowledge_connector"."knowledge_base_id" WHERE "knowledge_base"."workspace_id" in ($3) AND "knowledge_connector"."detached_at" IS NOT NULL GROUP BY "knowledge_base"."workspace_id" ) storage_by_workspace GROUP BY storage_by_workspace.workspace_id ORDER BY storage_by_workspace.workspace_id params: workspace,workspace,workspace ❯ PostgresJsPreparedQuery.queryWithCache ../../node_modules/drizzle-orm/pg-core/session.js:41:15 ❯ getExactWorkspaceStorageBytesBatch lib/billing/storage/payer-transfer.ts:186:16 ❯ changeWorkspaceStoragePayersInTx lib/billing/storage/payer-transfer.ts:431:35 ❯ lib/workspaces/organization-workspaces.ts:506:5 ❯ Module.detachOrganizationWorkspacesTx lib/workspaces/organization-workspaces.ts:490:32 ❯ lib/workspaces/organization-workspaces.postgres.test.ts:137:26 ❯ scope ../../node_modules/postgres/src/index.js:261:18 ❯ sql.begin ../../node_modules/postgres/src/index.js:244:14 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { query: '\n SELECT\n storage_by_workspace.workspace_id,\n COALESCE(SUM(storage_by_workspace.workspace_file_bytes), 0)::bigint\n AS workspace_file_bytes,\n COALESCE(SUM(storage_by_workspace.document_bytes), 0)::bigint\n AS document_bytes,\n COALESCE(SUM(storage_by_workspace.workspace_file_missing_size_count), 0)::bigint\n AS workspace_file_missing_size_count\n FROM (\n SELECT\n "workspace_files"."workspace_id" AS workspace_id,\n SUM("workspace_files"."size_bytes") AS workspace_file_bytes,\n 0::bigint AS document_bytes,\n COUNT(*) FILTER (WHERE "workspace_files"."size_bytes" IS NULL)::bigint\n AS workspace_file_missing_size_count\n FROM "workspace_files"\n WHERE "workspace_files"."workspace_id" in ($1)\n AND "workspace_files"."context" = \'workspace\'\n GROUP BY "workspace_files"."workspace_id"\n\n UNION ALL\n\n SELECT\n "knowledge_base"."workspace_id" AS w
lib/workspaces/organization-workspaces.postgres.test.ts > organization workspace detachment lock order > lets acceptance finish before standalone without inverting invitation, workspace, or organization locks: apps/sim/lib/workspaces/organization-workspaces.postgres.test.ts#L166
AssertionError: promise rejected "Error: Failed query: SELECT st… { …(2) }" instead of resolving ❯ lib/workspaces/organization-workspaces.postgres.test.ts:166:30 Caused by: Caused by: Error: Failed query: SELECT storage_by_workspace.workspace_id, COALESCE(SUM(storage_by_workspace.workspace_file_bytes), 0)::bigint AS workspace_file_bytes, COALESCE(SUM(storage_by_workspace.document_bytes), 0)::bigint AS document_bytes, COALESCE(SUM(storage_by_workspace.workspace_file_missing_size_count), 0)::bigint AS workspace_file_missing_size_count FROM ( SELECT "workspace_files"."workspace_id" AS workspace_id, SUM("workspace_files"."size_bytes") AS workspace_file_bytes, 0::bigint AS document_bytes, COUNT(*) FILTER (WHERE "workspace_files"."size_bytes" IS NULL)::bigint AS workspace_file_missing_size_count FROM "workspace_files" WHERE "workspace_files"."workspace_id" in ($1) AND "workspace_files"."context" = 'workspace' GROUP BY "workspace_files"."workspace_id" UNION ALL SELECT "knowledge_base"."workspace_id" AS workspace_id, 0::bigint AS workspace_file_bytes, SUM("document"."file_size"::bigint) AS document_bytes, 0::bigint AS workspace_file_missing_size_count FROM "document" INNER JOIN "knowledge_base" ON "knowledge_base"."id" = "document"."knowledge_base_id" WHERE "knowledge_base"."workspace_id" in ($2) AND "document"."connector_id" IS NULL AND "document"."deleted_at" IS NULL GROUP BY "knowledge_base"."workspace_id" UNION ALL SELECT "knowledge_base"."workspace_id" AS workspace_id, 0::bigint AS workspace_file_bytes, SUM("knowledge_connector"."detach_reserved_bytes") AS document_bytes, 0::bigint AS workspace_file_missing_size_count FROM "knowledge_connector" INNER JOIN "knowledge_base" ON "knowledge_base"."id" = "knowledge_connector"."knowledge_base_id" WHERE "knowledge_base"."workspace_id" in ($3) AND "knowledge_connector"."detached_at" IS NOT NULL GROUP BY "knowledge_base"."workspace_id" ) storage_by_workspace GROUP BY storage_by_workspace.workspace_id ORDER BY storage_by_workspace.workspace_id params: workspace,workspace,workspace ❯ PostgresJsPreparedQuery.queryWithCache ../../node_modules/drizzle-orm/pg-core/session.js:41:15 ❯ getExactWorkspaceStorageBytesBatch lib/billing/storage/payer-transfer.ts:186:16 ❯ changeWorkspaceStoragePayersInTx lib/billing/storage/payer-transfer.ts:431:35 ❯ lib/workspaces/organization-workspaces.ts:506:5 ❯ Module.detachOrganizationWorkspacesTx lib/workspaces/organization-workspaces.ts:490:32 ❯ lib/workspaces/organization-workspaces.postgres.test.ts:137:26 ❯ scope ../../node_modules/postgres/src/index.js:261:18 ❯ sql.begin ../../node_modules/postgres/src/index.js:244:14 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { query: '\n SELECT\n storage_by_workspace.workspace_id,\n COALESCE(SUM(storage_by_workspace.workspace_file_bytes), 0)::bigint\n AS workspace_file_bytes,\n COALESCE(SUM(storage_by_workspace.document_bytes), 0)::bigint\n AS document_bytes,\n COALESCE(SUM(storage_by_workspace.workspace_file_missing_size_count), 0)::bigint\n AS workspace_file_missing_size_count\n FROM (\n SELECT\n "workspace_files"."workspace_id" AS workspace_id,\n SUM("workspace_files"."size_bytes") AS workspace_file_bytes,\n 0::bigint AS document_bytes,\n COUNT(*) FILTER (WHERE "workspace_files"."size_bytes" IS NULL)::bigint\n AS workspace_file_missing_size_count\n FROM "workspace_files"\n WHERE "workspace_files"."workspace_id" in ($1)\n AND "workspace_files"."context" = \'workspace\'\n GROUP BY "workspace_files"."workspace_id"\n\n UNION ALL\n\n SELECT\n "knowledge_base"."workspa
Test and Build / PostgreSQL integration (push)
Process completed with exit code 1.
lib/workspaces/organization-workspaces.postgres.test.ts > organization workspace detachment lock order > lets acceptance finish before organization-delete without inverting invitation, workspace, or organization locks: apps/sim/lib/workspaces/organization-workspaces.postgres.test.ts#L166
AssertionError: promise rejected "Error: Failed query: SELECT st… { …(2) }" instead of resolving ❯ lib/workspaces/organization-workspaces.postgres.test.ts:166:30 Caused by: Error: Failed query: SELECT storage_by_workspace.workspace_id, COALESCE(SUM(storage_by_workspace.workspace_file_bytes), 0)::bigint AS workspace_file_bytes, COALESCE(SUM(storage_by_workspace.document_bytes), 0)::bigint AS document_bytes, COALESCE(SUM(storage_by_workspace.workspace_file_missing_size_count), 0)::bigint AS workspace_file_missing_size_count FROM ( SELECT "workspace_files"."workspace_id" AS workspace_id, SUM("workspace_files"."size_bytes") AS workspace_file_bytes, 0::bigint AS document_bytes, COUNT(*) FILTER (WHERE "workspace_files"."size_bytes" IS NULL)::bigint AS workspace_file_missing_size_count FROM "workspace_files" WHERE "workspace_files"."workspace_id" in ($1) AND "workspace_files"."context" = 'workspace' GROUP BY "workspace_files"."workspace_id" UNION ALL SELECT "knowledge_base"."workspace_id" AS workspace_id, 0::bigint AS workspace_file_bytes, SUM("document"."file_size"::bigint) AS document_bytes, 0::bigint AS workspace_file_missing_size_count FROM "document" INNER JOIN "knowledge_base" ON "knowledge_base"."id" = "document"."knowledge_base_id" WHERE "knowledge_base"."workspace_id" in ($2) AND "document"."connector_id" IS NULL AND "document"."deleted_at" IS NULL GROUP BY "knowledge_base"."workspace_id" UNION ALL SELECT "knowledge_base"."workspace_id" AS workspace_id, 0::bigint AS workspace_file_bytes, SUM("knowledge_connector"."detach_reserved_bytes") AS document_bytes, 0::bigint AS workspace_file_missing_size_count FROM "knowledge_connector" INNER JOIN "knowledge_base" ON "knowledge_base"."id" = "knowledge_connector"."knowledge_base_id" WHERE "knowledge_base"."workspace_id" in ($3) AND "knowledge_connector"."detached_at" IS NOT NULL GROUP BY "knowledge_base"."workspace_id" ) storage_by_workspace GROUP BY storage_by_workspace.workspace_id ORDER BY storage_by_workspace.workspace_id params: workspace,workspace,workspace ❯ PostgresJsPreparedQuery.queryWithCache ../../node_modules/drizzle-orm/pg-core/session.js:41:15 ❯ getExactWorkspaceStorageBytesBatch lib/billing/storage/payer-transfer.ts:186:16 ❯ changeWorkspaceStoragePayersInTx lib/billing/storage/payer-transfer.ts:431:35 ❯ lib/workspaces/organization-workspaces.ts:506:5 ❯ Module.detachOrganizationWorkspacesTx lib/workspaces/organization-workspaces.ts:490:32 ❯ lib/workspaces/organization-workspaces.postgres.test.ts:137:26 ❯ scope ../../node_modules/postgres/src/index.js:261:18 ❯ sql.begin ../../node_modules/postgres/src/index.js:244:14 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { query: '\n SELECT\n storage_by_workspace.workspace_id,\n COALESCE(SUM(storage_by_workspace.workspace_file_bytes), 0)::bigint\n AS workspace_file_bytes,\n COALESCE(SUM(storage_by_workspace.document_bytes), 0)::bigint\n AS document_bytes,\n COALESCE(SUM(storage_by_workspace.workspace_file_missing_size_count), 0)::bigint\n AS workspace_file_missing_size_count\n FROM (\n SELECT\n "workspace_files"."workspace_id" AS workspace_id,\n SUM("workspace_files"."size_bytes") AS workspace_file_bytes,\n 0::bigint AS document_bytes,\n COUNT(*) FILTER (WHERE "workspace_files"."size_bytes" IS NULL)::bigint\n AS workspace_file_missing_size_count\n FROM "workspace_files"\n WHERE "workspace_files"."workspace_id" in ($1)\n AND "workspace_files"."context" = \'workspace\'\n GROUP BY "workspace_files"."workspace_id"\n\n UNION ALL\n\n SELECT\n "knowledge_base"."workspace_id" AS w
lib/workspaces/organization-workspaces.postgres.test.ts > organization workspace detachment lock order > lets acceptance finish before standalone without inverting invitation, workspace, or organization locks: apps/sim/lib/workspaces/organization-workspaces.postgres.test.ts#L166
AssertionError: promise rejected "Error: Failed query: SELECT st… { …(2) }" instead of resolving ❯ lib/workspaces/organization-workspaces.postgres.test.ts:166:30 Caused by: Caused by: Error: Failed query: SELECT storage_by_workspace.workspace_id, COALESCE(SUM(storage_by_workspace.workspace_file_bytes), 0)::bigint AS workspace_file_bytes, COALESCE(SUM(storage_by_workspace.document_bytes), 0)::bigint AS document_bytes, COALESCE(SUM(storage_by_workspace.workspace_file_missing_size_count), 0)::bigint AS workspace_file_missing_size_count FROM ( SELECT "workspace_files"."workspace_id" AS workspace_id, SUM("workspace_files"."size_bytes") AS workspace_file_bytes, 0::bigint AS document_bytes, COUNT(*) FILTER (WHERE "workspace_files"."size_bytes" IS NULL)::bigint AS workspace_file_missing_size_count FROM "workspace_files" WHERE "workspace_files"."workspace_id" in ($1) AND "workspace_files"."context" = 'workspace' GROUP BY "workspace_files"."workspace_id" UNION ALL SELECT "knowledge_base"."workspace_id" AS workspace_id, 0::bigint AS workspace_file_bytes, SUM("document"."file_size"::bigint) AS document_bytes, 0::bigint AS workspace_file_missing_size_count FROM "document" INNER JOIN "knowledge_base" ON "knowledge_base"."id" = "document"."knowledge_base_id" WHERE "knowledge_base"."workspace_id" in ($2) AND "document"."connector_id" IS NULL AND "document"."deleted_at" IS NULL GROUP BY "knowledge_base"."workspace_id" UNION ALL SELECT "knowledge_base"."workspace_id" AS workspace_id, 0::bigint AS workspace_file_bytes, SUM("knowledge_connector"."detach_reserved_bytes") AS document_bytes, 0::bigint AS workspace_file_missing_size_count FROM "knowledge_connector" INNER JOIN "knowledge_base" ON "knowledge_base"."id" = "knowledge_connector"."knowledge_base_id" WHERE "knowledge_base"."workspace_id" in ($3) AND "knowledge_connector"."detached_at" IS NOT NULL GROUP BY "knowledge_base"."workspace_id" ) storage_by_workspace GROUP BY storage_by_workspace.workspace_id ORDER BY storage_by_workspace.workspace_id params: workspace,workspace,workspace ❯ PostgresJsPreparedQuery.queryWithCache ../../node_modules/drizzle-orm/pg-core/session.js:41:15 ❯ getExactWorkspaceStorageBytesBatch lib/billing/storage/payer-transfer.ts:186:16 ❯ changeWorkspaceStoragePayersInTx lib/billing/storage/payer-transfer.ts:431:35 ❯ lib/workspaces/organization-workspaces.ts:506:5 ❯ Module.detachOrganizationWorkspacesTx lib/workspaces/organization-workspaces.ts:490:32 ❯ lib/workspaces/organization-workspaces.postgres.test.ts:137:26 ❯ scope ../../node_modules/postgres/src/index.js:261:18 ❯ sql.begin ../../node_modules/postgres/src/index.js:244:14 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { query: '\n SELECT\n storage_by_workspace.workspace_id,\n COALESCE(SUM(storage_by_workspace.workspace_file_bytes), 0)::bigint\n AS workspace_file_bytes,\n COALESCE(SUM(storage_by_workspace.document_bytes), 0)::bigint\n AS document_bytes,\n COALESCE(SUM(storage_by_workspace.workspace_file_missing_size_count), 0)::bigint\n AS workspace_file_missing_size_count\n FROM (\n SELECT\n "workspace_files"."workspace_id" AS workspace_id,\n SUM("workspace_files"."size_bytes") AS workspace_file_bytes,\n 0::bigint AS document_bytes,\n COUNT(*) FILTER (WHERE "workspace_files"."size_bytes" IS NULL)::bigint\n AS workspace_file_missing_size_count\n FROM "workspace_files"\n WHERE "workspace_files"."workspace_id" in ($1)\n AND "workspace_files"."context" = \'workspace\'\n GROUP BY "workspace_files"."workspace_id"\n\n UNION ALL\n\n SELECT\n "knowledge_base"."workspa
Test and Build / Lint and Test
Process completed with exit code 1.
Test and Build / PostgreSQL integration (migrate)
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
Test and Build / PostgreSQL integration (migrate)
Skipping sticky disk commit due to previous step failures
Test and Build / PostgreSQL integration (migrate)
Found 2 failed/cancelled steps in previous workflow steps
Test and Build / PostgreSQL integration (push)
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
Test and Build / PostgreSQL integration (push)
Skipping sticky disk commit due to previous step failures
Test and Build / PostgreSQL integration (push)
Found 2 failed/cancelled steps in previous workflow steps