Skip to content

[low] fix: [qintel_helper] add missing f-prefix to rate-limit log message - #880

Open
elhoim wants to merge 1 commit into
MISP:mainfrom
elhoim:fix/072-qintel-429-fstring
Open

[low] fix: [qintel_helper] add missing f-prefix to rate-limit log message#880
elhoim wants to merge 1 commit into
MISP:mainfrom
elhoim:fix/072-qintel-429-fstring

Conversation

@elhoim

@elhoim elhoim commented Aug 31, 2026

Copy link
Copy Markdown
Member

BLUF — The Qintel 429 log line was missing its f prefix, so it printed raw placeholders.

  • Problem — The rate-limit handler in misp_modules/lib/qintel_helper.py builds its message from a plain string literal, so {request_attempts} and {wait_time} are logged verbatim rather than interpolated.
  • Fix — Add the missing f prefix to that message; a one-line change with no behavior change beyond the log text.
  • Effect — Operators debugging Qintel API throttling see the real retry count and backoff duration in the log instead of placeholder text.

The 429 rate-limit log message in qintel_helper.py was a plain string literal, not an f-string:

if response.code == 429:
    msg = "rate limit reached on attempt {request_attempts}, waiting {wait_time} seconds"

Because the f prefix was missing, the {request_attempts} and {wait_time} placeholders were never interpolated — the log line prints the literal text {request_attempts} and {wait_time} instead of the actual attempt number and wait time.

Impact: When the Qintel enrichment module hits the Qintel API's rate limit, the log message an analyst or operator relies on to understand and debug the throttling behavior is useless — it shows placeholder text instead of which attempt this is and how long the module is waiting before retrying.

Fix: Added the missing f prefix so the log line correctly interpolates request_attempts and wait_time. This is a one-line change with no behavior change beyond the log text now being correct.

Found during a review of the repository; other findings are being submitted as separate PRs.

Verification

  • py_compile misp_modules/lib/qintel_helper.py: OK
  • Full module test suite: 161 passed, 4 skipped, 5 subtests passed in 24.76s

🤖 Generated with Claude Code

The 429 rate-limit branch builds its log message as a plain string
literal containing {request_attempts} and {wait_time} placeholders, but
never marks it as an f-string. An analyst reading the module's logs
during a Qintel rate-limit event sees the literal text
"rate limit reached on attempt {request_attempts}, waiting {wait_time}
seconds" instead of the actual attempt count and wait duration, making
the log line useless for diagnosing retry behaviour.

Verified with py_compile on the changed file and the full pytest suite
against a live modules server on port 6772: 161 passed, 4 skipped, 5
subtests passed, matching the baseline.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018dfYpyaSZd1nxSRLr8suj8
@elhoim elhoim changed the title fix: [qintel_helper] add missing f-prefix to rate-limit log message [low] fix: [qintel_helper] add missing f-prefix to rate-limit log message Sep 3, 2026
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