Skip to content

[data] Error handling & observability: print() over logging, silent rule-load failure, bare except swallowing errors #89

Description

@rahulkatiyar19955

Severity

Low

Summary

Error handling across the data/ingestion path hides failures: print() is used instead of logging (and is dangerous in stdio-transport workers), causal-rule load failures fail silently and leave the engine empty, and several bare except: pass blocks swallow TF and timestamp parse errors — masking real bugs.

Findings

  • print() used for error reporting instead of logging — backend/app/services/causal_rules.py:39,41 and backend/app/api/sessions.py:352print(...) writes to stdout. In MCP workers stdout is the stdio JSON-RPC transport (see mcp_workers/_shared/health.py:50-52), so stray prints can corrupt the protocol; elsewhere it bypasses the logger entirely. Fix: replace with logger.warning / logger.exception.

  • Silent rule-load failure leaves the causal engine empty with only a printbackend/app/services/causal_rules.py:29-41 — If causal.yaml is missing or malformed, self.rules = [] with only a print. The evaluator then produces zero CAUSED/TRIGGERED edges and RCA causal chains come back empty with no operator-visible error. Fix: log at ERROR and expose a health/status flag; consider failing ingestion loudly if the rules file is expected to exist.

  • Bare except Exception: pass swallows TF and timestamp parse errors — backend/app/services/tf_parser.py:36-37, mcap_parser/parser.py:109-110, backend/app/services/parser.py:284-289, backend/app/services/causal_rules.py:16-22 — TF parse failures are silently dropped (producing an incomplete frame graph with no warning), and the timestamp parsers swallow everything and return 0.0, which also masks the long-bag day-format timestamp bug. Fix: catch narrowly and at minimum logger.debug / append a warning; let unexpected errors surface instead of being silently ignored.

Project-rule reference

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:dataParser, services, Neo4j, MCP workersbugSomething isn't workingseverity:lowStyle / nit / minortech-debtMaintainability, dead code, duplication, types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions