mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-01 07:02:48 +08:00
add checks/logs on broker connect timeout
This commit is contained in:
@@ -242,6 +242,14 @@ func setupMQTT(cfg *config.ClientConfig, publish bool) mqtt.Client {
|
||||
} else {
|
||||
err = token.Error()
|
||||
}
|
||||
brokerErr := checkBroker(cfg.Server.Server)
|
||||
if brokerErr.Error() == "dns" {
|
||||
logger.FatalLog("dns lookup failed for broker ... update dns records")
|
||||
} else if brokerErr.Error() == "ping" {
|
||||
logger.FatalLog("unable to connect to broker ... check firewalls")
|
||||
} else if brokerErr != nil {
|
||||
logger.Log(0, "unable to conncet to broker")
|
||||
}
|
||||
logger.Log(0, "could not connect to broker", cfg.Server.Server, err.Error())
|
||||
if strings.Contains(err.Error(), "connectex") || strings.Contains(err.Error(), "connect timeout") {
|
||||
logger.Log(0, "connection issue detected.. attempt connection with new certs")
|
||||
|
Reference in New Issue
Block a user