Skip to content

[QUESTION] "Connect comms goroutine - error triggered EOF" error #725

@brunoluizkatz-NETZSCH

Description

@brunoluizkatz-NETZSCH

Hi, I'm getting this error from the MQTT lib:

[MQTT-LOG] - [[client]   Connect comms goroutine - error triggered EOF]

The connection options is:

mqttOpts := mqtt.NewClientOptions()
mqttOpts = mqttOpts.SetAutoReconnect(true)
mqttOpts = mqttOpts.SetOnConnectHandler(func(mqtt.Client) {
    // On connect stuff
})
mqttOpts = mqttOpts.SetConnectionLostHandler(func(c mqtt.Client, err error) {
    // On disconnect stuff
})
mqttOpts = mqttOpts.SetClientID(mqttClientID(fmt.Sprintf("%s-%s", clientIDPrefix, h.GetMchID()), time.Now().UnixNano()))
mqttOpts = mqttOpts.SetCleanSession(false)
mqttOpts = mqttOpts.SetKeepAlive(2 * time.Minute) // Sent a ping to the MQTT broker every 2 minutes
mqttOpts = mqttOpts.SetWriteTimeout(2 * time.Second)
mqttOpts = mqttOpts.SetConnectRetry(true)
mqttOpts = mqttOpts.SetPingTimeout(2 * time.Second) // Default is 10 seconds
mqttOpts = mqttOpts.SetConnectRetryInterval(15 * time.Second)
mqttOpts = mqttOpts.AddBroker(fmt.Sprintf("%s://%s:%d", h.connOpts.Protocol, h.connOpts.Host, h.connOpts.Port))
mqttOpts = mqttOpts.SetProtocolVersion(4)
mqttOpts = mqttOpts.SetMaxResumePubInFlight(1) // Max in-flight messages for resume publish
mqttOpts = mqttOpts.SetUsername(h.connOpts.Username)
mqttOpts = mqttOpts.SetPassword(h.connOpts.Password)

I followed the error to the file net.go file at startComms goroutine, specifically at the startOutgoingComms, but it's not triggering the disconnection status and somehow the IsConnected() bool function (at client.go) returns true and the client can't receive or send messages.

The MQTT image instance on EKS version is: eclipse-mosquitto:1.6.10 with SSL enabled

The image is too old or I'm doing some soemthing wrong with the client connection options?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions