Skip to content

fix(logs): avoid false-positive error level for no-error values (#4538)#122

Closed
AminDhouib wants to merge 1 commit into
canaryfrom
port/upr-4539
Closed

fix(logs): avoid false-positive error level for no-error values (#4538)#122
AminDhouib wants to merge 1 commit into
canaryfrom
port/upr-4539

Conversation

@AminDhouib

Copy link
Copy Markdown
Member

Ports Dokploy#4539 by @brendler.

Addresses Dokploy#4538.

What

getLogType classified any log line containing error: or the word failed as an error, ignoring the value that follows. Job-scheduler completion lines such as:

▶ NOTICE Finished job "nightly-task" in "1.2s", failed: false, skipped: false, error: none

were highlighted red even though failed: false / error: none report success.

Changes

  • error: / err:, failed, and failure classify as an error only when not immediately followed by a no-error value (none|null|false|nil|no|0), via negative lookahead. This is value-specific, not a blanket suppressor: error: none, failed: true is still flagged as an error.
  • Bare NOTICE (no colon) is treated as info so scheduler lines short-circuit before the error branch. notice: (with colon) is left to the warning branch, preserving existing behaviour.

Verify-first (fork)

The fork's getLogType info/error branches are byte-identical to upstream's pre-fix version, so the false positive reproduces here. Added apps/dokploy/__test__/utils/log-type.test.ts: against the unmodified parser 3/6 cases fail (scheduler "finished" line, error: none, bare NOTICE); after the fix all 6 pass. pnpm --filter=dokploy run typecheck is clean.

…loy#4538)

getLogType classified any line containing `error:` or the word `failed`
as an error regardless of the value, so scheduler completion lines like
`... failed: false, ..., error: none` were highlighted red.

- error:/err:, failed and failure now classify as an error only when not
  immediately followed by a no-error value (none|null|false|nil|no|0),
  via negative lookahead. The exclusion is value-specific: a line such as
  `error: none, failed: true` is still flagged.
- Bare NOTICE (no colon) is treated as info so scheduler lines
  short-circuit before the error branch; `notice:` stays a warning.

Adds __test__/utils/log-type.test.ts covering these cases.

Ports Dokploy#4539 by @brendler.
@AminDhouib

Copy link
Copy Markdown
Member Author

Closing as a duplicate. #68 (ports Dokploy#4594) already addresses the same issue (Dokploy#4538) and uses a more robust no-error-value check — it only clears "no-error" pairs when the value is complete (terminated by end-of-line/comma/semicolon), so genuine lines like error: none of the nodes responded stay classified as errors. #68 was opened first and is CI-green, so it's the one we'll ship. (Internal supersession; not a reflection on the upstream fix.)

@AminDhouib AminDhouib closed this Jul 14, 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.

2 participants