Skip to content

Workflow channel raises an exception when fetching trigger auth methods for an unpersisted trigger #4819

@midigofrank

Description

@midigofrank

Sentry: LIGHTNING-19P — 169 events, 2025-12-08 → 2026-05-31, ~85% prod (rest demo + 1 staging), across many distinct trigger ids.

The request_trigger_auth_methods handler looks the trigger up with the bang variant:

# lib/lightning_web/channels/workflow_channel.ex:516
trigger = Lightning.Repo.get!(Lightning.Workflows.Trigger, trigger_id)

When the trigger id isn't in the database — e.g. a trigger that exists in the collaborative-editor document but hasn't been saved yet, or one that was already removed — get!/2 raises Ecto.NoResultsError. The handler runs inside async_task/3, whose rescue logs the failure at :error (workflow_channel.ex:821), so every occurrence is reported to Sentry:

Failed to handle request_trigger_auth_methods: %Ecto.NoResultsError{message: "expected at least one result but got none in query:\n\nfrom t0 in Lightning.Workflows.Trigger, where: t0.id == ^\"...\"\n"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    SentrybugNewly identified bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    New Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions