Skip to content

Commit fe7f787

Browse files
authored
fix(core): log at debug instead of error for expected IPC missing client id state (#3636)
Closes #3631 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Refined error handling and logging behavior in authentication metadata retrieval to appropriately categorize and report different error conditions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 4a7353d commit fe7f787

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

service/internal/auth/authn.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,13 @@ func IPCMetadataClientInterceptor(log *logger.Logger) connect.UnaryInterceptorFu
446446
incoming := true
447447
clientID, err := ctxAuth.GetClientIDFromContext(ctx, incoming)
448448
if err != nil {
449-
// metadata will not always be found over IPC - log other errors
450-
if !errors.Is(err, ctxAuth.ErrNoMetadataFound) {
449+
switch {
450+
case errors.Is(err, ctxAuth.ErrNoMetadataFound):
451+
case errors.Is(err, ctxAuth.ErrMissingClientID):
452+
// IPC calls may not propagate tokens/clients across service boundaries, which is not
453+
// necessarily an error case but is useful to know when debugging
454+
log.DebugContext(ctx, "IPCMetadataClientInterceptor", slog.Any("error", err))
455+
default:
451456
log.ErrorContext(ctx, "IPCMetadataClientInterceptor", slog.Any("error", err))
452457
}
453458
} else {

0 commit comments

Comments
 (0)