Skip to content

DRC audit trail silently drops rows: Store to TIM Postgres builds SQL by concatenation and masks its own failure #284

Description

@labgadget015-dotcom

Found by a synthetic end-to-end run, not by a report.

What happened

Opening this issue routed correctly and ran the full council. n8n execution 7832 finished green in ~171s. No row reached tim.agent_runs.

Why the execution looked green

Store to TIM Postgres has onError: continueRegularOutput. The node failed, returned its error as ordinary output, and the workflow carried on to Log DRC to Drive and reported success. This is the same masking that hid three serialisation bugs for months.

The actual failure

Syntax error at line 3 near ":"

Line 3 is inside the interpolated issue body, at Context: the Event Router's ....

The node builds its INSERT by string concatenation, escaping only single quotes with .replace(/'/g, "''"). Postgres accepts the resulting SQL. I verified this directly against the same Neon database with a body containing a newline followed by a bare word and a colon, and it executed fine. So the parse failure happens inside the n8n node, before the statement reaches Postgres.

Impact

Any issue whose body trips this loses its audit row while the run reports success. tim.agent_runs is therefore not a reliable record of what the council processed. It currently holds 16 rows.

Fix

Convert the node to the parameterised queryReplacement form rather than concatenating values into the statement. That form is already proven in the Video Intelligence P0 workflow. Removing onError: continueRegularOutput afterwards is what makes a future regression visible.

Related

Same root cause class as the Normalise Issue Payload quote bug: hand-building a serialised format instead of using the safe constructor.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions