Skip to content

fix(server): log an unreadable config at warn, not error - #131

Closed
hyperpolymath wants to merge 2 commits into
mainfrom
fix/config-read-log-level
Closed

hyperpolymath wants to merge 2 commits into
mainfrom
fix/config-read-log-level

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

_read_databases and _read_primers both answer json_error(400, ...): the route's own verdict that a malformed config/databases.yml or config/primers.yml is an operator-fixable input, not a server fault. Logging that at @error with a full backtrace reports a routine bad file as if the server had crashed, and the backtrace pointed into YAML.jl's parser rather than at the offending line, so it carried no diagnostic value either.

The reason string is kept -- reason=sprint(showerror, e) is what actually names the YAML defect. Only the backtrace goes.

Deliberately NOT changed: the three 500-class sites, which stay at @error with their backtraces --

src/server/routes/analysis_config.jl:144
src/server/routes/annotations.jl:318
src/server/routes/composition.jl:370

A 500 is the route saying it did not expect this, and there the backtrace is the only thing separating a data problem from a code bug. Dropping it would be muting a diagnostic rather than fixing one. analysis_config.jl already draws this line itself: its ArgumentError branch returns 400 with no logging at all, while everything else logs at @error and returns 500.

src/server/routes/pipeline.jl:520 is untouched -- it is the silent-degradation shape tracked in #31, not a severity question.

Claude-Session: https://claude.ai/code/session_01X3hgXxWm6umMgZkjYyHnnm (cherry picked from commit e2147d5)

Summary

Closes #

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (would change existing behaviour)
  • 🕳️ Soundness fix (fixes a checker/proof false-negative)
  • 📖 Documentation
  • 🧹 Refactor / tech debt (behaviour-preserving)
  • ⚡ Performance
  • 🔧 Build / CI / tooling

How has this been verified?

Checklist

  • My commits are signed (git commit -S).
  • I ran the project's own checks/tests locally and they pass.
  • New files carry the correct SPDX-License-Identifier (code/config MPL-2.0,
    prose CC-BY-SA-4.0); I did not relicense existing files.
  • Docs are updated, and no public claim now overstates what the code does.
  • I have not introduced a soundness hole (or I have flagged where I might have).

Notes for reviewers

`_read_databases` and `_read_primers` both answer `json_error(400, ...)`: the
route's own verdict that a malformed `config/databases.yml` or `config/primers.yml`
is an operator-fixable input, not a server fault. Logging that at `@error` with a
full backtrace reports a routine bad file as if the server had crashed, and the
backtrace pointed into YAML.jl's parser rather than at the offending line, so it
carried no diagnostic value either.

The reason string is kept -- `reason=sprint(showerror, e)` is what actually names
the YAML defect. Only the backtrace goes.

Deliberately NOT changed: the three 500-class sites, which stay at `@error` with
their backtraces --

  src/server/routes/analysis_config.jl:144
  src/server/routes/annotations.jl:318
  src/server/routes/composition.jl:370

A 500 is the route saying it did not expect this, and there the backtrace is the
only thing separating a data problem from a code bug. Dropping it would be muting
a diagnostic rather than fixing one. `analysis_config.jl` already draws this line
itself: its `ArgumentError` branch returns 400 with no logging at all, while
everything else logs at `@error` and returns 500.

`src/server/routes/pipeline.jl:520` is untouched -- it is the silent-degradation
shape tracked in #31, not a severity question.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X3hgXxWm6umMgZkjYyHnnm
(cherry picked from commit e2147d5)
@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 380b6643-108e-4e1a-a476-b71c51e8f3d1
📥 Commits

Reviewing files that changed from the base of the PR and between ebebed2 and cfc9cad.

📒 Files selected for processing: 2
  • src/server/routes/config.jl
  • src/server/routes/databases.jl
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath

Copy link
Copy Markdown
Owner Author

Closing: 0 files changed -- this branch's work is already on main (squash-merged through another PR), so the sweep produced an empty PR.

@hyperpolymath
hyperpolymath deleted the fix/config-read-log-level branch October 15, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant