Skip to content

[BUG]: Workflow errors are logged as "Unknown source: No message provided" #187

Open

Description

@itsnjstyle27

Description

When a step of the LangGraph workflow fails, the server log does not say which step failed or why. Every failure is logged as:

Error detected from 'Unknown source': No message provided

Each node returns {"status": "error", "error_from": ..., "message": ...} when it fails, and error_handler logs error_from and message. But MyState in backend/app/modules/langgraph_builder.py has no error_from or message keys, and LangGraph drops keys that are not in the state schema. So error_handler never sees them and falls back to its defaults.

backend/API.md says for /api/process: "The failing step and its message are written to the server log only, not to the response." The response part holds, but the log part does not. The comment in test_workflow_stops_at_the_first_failing_step (backend/tests/test_pipeline.py) also notes that these keys are dropped.

Steps to reproduce

Make any node fail, for example /api/process with a Groq call that errors, or this in the backend test setup:

from app.modules import langgraph_builder
from app.modules.langgraph_nodes import sentiment

sentiment.run_sentiment_sdk = lambda state: {
    "status": "error", "error_from": "sentiment_analysis", "message": "Groq timed out"
}
langgraph_builder.build_langgraph().invoke({"cleaned_text": "Article text."})

The log shows Error detected from 'Unknown source': No message provided instead of Error detected from 'sentiment_analysis': Groq timed out.

Expected

The log names the failing step and its message, as API.md describes, and the response stays the same (no error_from or message in it).

I have a fix with tests ready and will open a PR.

Activity

  1. itsnjstyle27 commented on Nov 5, 2026

    @itsnjstyle27
    Author

    The fix with tests is on this branch: main...itsnjstyle27:Perspective:fix/keep-error-details-in-workflow-state

    GitHub does not let me open a second pull request here while #182 is open, so I will open it as soon as #182 is merged or closed.

  2. gitcordapp commented on Nov 5, 2026

    @gitcordapp

    Link your account with Gitcord

    Thanks for opening this issue, @itsnjstyle27!

    To receive Discord notifications and contributor tracking for this organization:

    1. Join Discord: https://discord.gg/hjUhu33uAn
    2. In Discord, run /link itsnjstyle27
    3. Paste the verification code into your GitHub bio (or a public gist)
    4. Click Verify in Discord (or run /verify-link itsnjstyle27)

    Once linked, Gitcord can notify you about assignments, mentions, and more.

    — Posted by Gitcord

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions