Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workspace deletion workflow #11430

Merged
merged 1 commit into from
Mar 18, 2025
Merged

Fix workspace deletion workflow #11430

merged 1 commit into from
Mar 18, 2025

Conversation

flvndvd
Copy link
Contributor

@flvndvd flvndvd commented Mar 18, 2025

Description

This PR fixes the current error observed when attempting to delete a workspace.

activityType: 'deleteAgentsActivity',
error: Error
    at Query.run (/app/node_modules/sequelize/src/dialects/postgres/query.js:76:25)
    at <anonymous> (/app/node_modules/sequelize/src/sequelize.js:650:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at PostgresQueryInterface.bulkDelete (/app/node_modules/sequelize/src/dialects/abstract/query-interface.js:992:12)
    at Function.destroy (/app/node_modules/sequelize/src/model.js:3082:16)
    at deleteAgentsActivity (/app/poke/temporal/activities.ts:300:5)
    at ActivityInboundLogInterceptor.execute (/app/lib/temporal_monitoring.ts:68:14)
    at Activity.execute (/app/node_modules/@temporalio/worker/src/activity.ts:103:14)
    at <anonymous> (/app/node_modules/@temporalio/worker/src/activity.ts:130:24)
    at <anonymous> (/app/node_modules/@temporalio/worker/src/worker.ts:979:24) {
  name: 'SequelizeForeignKeyConstraintError',
  parent: error: update or delete on table "agent_process_configurations" violates foreign key constraint "adsc_processConfigurationId_fkey" on table "agent_data_source_configurations"
      at Parser.parseErrorMessage (/app/node_modules/pg-protocol/src/parser.ts:368:69)
      at Parser.handlePacket (/app/node_modules/pg-protocol/src/parser.ts:187:21)
      at Parser.parse (/app/node_modules/pg-protocol/src/parser.ts:102:30)
      at Socket.<anonymous> (/app/node_modules/pg-protocol/src/index.ts:7:48)
      at Socket.emit (node:events:519:28)
      at Socket.emit (/app/node_modules/dd-trace/packages/datadog-instrumentations/src/net.js:69:25)
      at addChunk (node:internal/streams/readable:559:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
      at Readable.push (node:internal/streams/readable:390:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:191:23) {
    length: 397,
    severity: 'ERROR',
    code: '23503',
    detail: 'Key (id)=(10599) is still referenced from table "agent_data_source_configurations".',
    hint: undefined,
    position: undefined,
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: 'public',
    table: 'agent_data_source_configurations',
    column: undefined,
    dataType: undefined,
    constraint: 'adsc_processConfigurationId_fkey',
    file: 'ri_triggers.c',
    line: '2553',
    routine: 'ri_ReportViolation',
    sql: 'DELETE FROM "agent_process_configurations" WHERE "agentConfigurationId" = 387478',
    parameters: undefined
  },
  original: error: update or delete on table "agent_process_configurations" violates foreign key constraint "adsc_processConfigurationId_fkey" on table "agent_data_source_configurations"

Tests

Risk

Deploy Plan

@flvndvd flvndvd marked this pull request as ready for review March 18, 2025 10:08
@flvndvd
Copy link
Contributor Author

flvndvd commented Mar 18, 2025

PMRR.

Copy link
Contributor

@aubin-tchoi aubin-tchoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flvndvd flvndvd merged commit e551475 into main Mar 18, 2025
6 checks passed
@flvndvd flvndvd deleted the flav/fix-workspace-deletion branch March 18, 2025 10:18
Copy link
Contributor

@spolu spolu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants