Skip to content

Suppress record not found logs#3016

Merged
h2zh merged 1 commit into
PelicanPlatform:mainfrom
h2zh:suppress-record-not-found-logs
Jan 22, 2026
Merged

Suppress record not found logs#3016
h2zh merged 1 commit into
PelicanPlatform:mainfrom
h2zh:suppress-record-not-found-logs

Conversation

@h2zh

@h2zh h2zh commented Jan 21, 2026

Copy link
Copy Markdown
Contributor
  • GORM would generate a log for each DB query, no matter success (level: debug) or failure (level: error)
  • However, when the user starts an Origin/Cache for the first time, the DB is empty so the DB query will definitely get a "record not found" error
  • This error will be logged by GORM by default as an error log. But this may be misleading for the user because this is an expected behavior. The "record not found" is already handled by the subsequent code.
  • So this PR aims to suppress query logs on these two DB operations to avoid confusions.

- GORM would generate a log for each DB query, no matter success  (level: debug) or failure (level: error)
- However, when the user starts an Origin/Cache for the first time, the DB is empty so the DB query will definitely get a "record not found" error
- This error will be logged by GORM by default as an error log. But this may be misleading for the user because this is an expected behavior. The "record not found" is already handled by the subsequent code.
- So this commit aims to suppress query logs on these two DB operations to avoid confusions.
@h2zh h2zh force-pushed the suppress-record-not-found-logs branch from add3115 to 65ea291 Compare January 21, 2026 18:59
@h2zh h2zh linked an issue Jan 21, 2026 that may be closed by this pull request
@h2zh h2zh added this to the v7.24 milestone Jan 21, 2026
@h2zh h2zh requested a review from patrickbrophy January 21, 2026 19:17

@patrickbrophy patrickbrophy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@h2zh h2zh merged commit 4a7c411 into PelicanPlatform:main Jan 22, 2026
27 of 30 checks passed
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.

"record not found" error on Origin/Cache initial startup

2 participants