diff --git a/lib/events/athena/athena.go b/lib/events/athena/athena.go index c72c92daf91cc..00556ac2ed00f 100644 --- a/lib/events/athena/athena.go +++ b/lib/events/athena/athena.go @@ -543,7 +543,11 @@ func (l *Log) SearchSessionEvents(ctx context.Context, req events.SearchSessionE } func (l *Log) Close() error { - return trace.Wrap(l.consumerCloser.Close()) + // consumerCloser is nil when consumer is disabled. + if l.consumerCloser != nil { + return trace.Wrap(l.consumerCloser.Close()) + } + return nil } func (l *Log) IsConsumerDisabled() bool {