Skip to content

Why are SASL Handshake errors not logged ? #2994

@pierDipi

Description

@pierDipi

Is there a security concern that prevents Sarama from logging SASL handshake errors?

I'm trying to debug an issue and the logger is only logging Error while performing SASL handshake kafka-1:9093 since the actual error is not logged, it's not clear what went wrong:

sarama/broker.go

Lines 1243 to 1252 in 893978c

handshakeErr := b.sendInternal(handshakeRequest, prom)
if handshakeErr != nil {
Logger.Printf("Error while performing SASL handshake %s\n", b.addr)
return handshakeErr
}
handshakeErr = handleResponsePromise(handshakeRequest, handshakeResponse, prom, metricRegistry)
if handshakeErr != nil {
Logger.Printf("Error while performing SASL handshake %s\n", b.addr)
return handshakeErr
}

sarama/broker.go

Lines 260 to 275 in 893978c

if conf.Net.SASL.Enable && !useSaslV0 {
b.connErr = b.authenticateViaSASLv1()
if b.connErr != nil {
close(b.responses)
<-b.done
err = b.conn.Close()
if err == nil {
DebugLogger.Printf("Closed connection to broker %s\n", b.addr)
} else {
Logger.Printf("Error while closing connection to broker %s: %s\n", b.addr, err)
}
b.conn = nil
atomic.StoreInt32(&b.opened, 0)
return
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions