Skip to content

Sentry: Workspace update fails with no primary key in processTransactionTrace job #709

Description

@claude

Sentry Error

Project: ethernal-backend
Level: error
Events (24h): 33
Regression: No
Link: https://sentry.tryethernal.com/organizations/sentry/issues/99/

Error

You attempted to save an instance with no primary key, this is not allowed since it would result in a global update

Location

processTransactionTrace.js:73 - When disabling tracing after RPC error:

await transaction.workspace.update({ tracing: null });

Context

  • Occurs in the processTransactionTrace background job
  • Triggered when RPC endpoint doesn't support debug_traceTransaction
  • The workspace instance somehow lacks a primary key value
  • Sequelize prevents the update to avoid a global update across all workspaces

Root Cause

The workspace instance being updated is missing its primary key (id field), likely due to:

  1. Incomplete eager loading in the transaction query
  2. Workspace instance being modified elsewhere, losing the primary key
  3. Database inconsistency

Suggested Fix

  1. Investigate how the workspace is loaded in the transaction processing
  2. Ensure workspace is properly loaded with its primary key
  3. Add validation to check workspace.id exists before updating
  4. Consider using Workspace.update({ tracing: null }, { where: { id: workspaceId } }) instead of instance method

Created by Sentry Scanner

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend componentsentryAuto-created from Sentry alert

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions