Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v17] Prevent logging exception due to nil attribute #49146

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

rosstimothy
Copy link
Contributor

Backport #49134 to branch/v17

The where condition being logged in SearchSession events is nil
even though it's not nil, thanks Go, causing additional log spam.
This addresses the issue by only passing in the condition if it
was populated in the request.

```bash
2024-11-18T13:04:02-05:00 DEBU [AUDIT]     SearchSessionEvents from:2024-11-18 05:00:00 +0000 UTC to:2024-11-19 04:59:59.999 +0000 UTC order:1 limit:5000 error:[LogValue panicked
called from runtime.panicwrap (runtime/error.go:355)
called from github.com/gravitational/teleport/api/types.(*WhereExpr).String (<autogenerated>:1)
called from github.com/gravitational/teleport/lib/utils/log.stringerAttr.LogValue (github.com/gravitational/teleport/lib/utils/log/slog_handler.go:662)
called from log/slog.Value.Resolve (log/slog/value.go:512)
called from github.com/gravitational/teleport/lib/utils/log.(*SlogTextHandler).appendAttr (github.com/gravitational/teleport/lib/utils/log/slog_handler.go:140)
(rest of stack elided)
] trace_id:42463c70955f653d0f992286feae738e span_id:a4e9b13d53f8f7d8 events/filelog.go:348
```
@rosstimothy rosstimothy added the no-changelog Indicates that a PR does not require a changelog entry label Nov 18, 2024
@github-actions github-actions bot added audit-log Issues related to Teleports Audit Log backport size/sm labels Nov 18, 2024
@rosstimothy rosstimothy added this pull request to the merge queue Nov 19, 2024
Merged via the queue into branch/v17 with commit 2eaa9d1 Nov 19, 2024
41 of 42 checks passed
@rosstimothy rosstimothy deleted the bot/backport-49134-branch/v17 branch November 19, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit-log Issues related to Teleports Audit Log backport no-changelog Indicates that a PR does not require a changelog entry size/sm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants