Skip to content

Agent Mesh

node: name the address behind which no router was found, log a redial without identity

Antonio Ojeaf441673dd086
diff --git a/internal/node/node.go b/internal/node/node.go
index 41698101..61abcbfa 100644
--- a/internal/node/node.go
+++ b/internal/node/node.go
@@ -1066,6 +1066,7 @@ func (n *SamNode) redialRouter(ctx context.Context, router peer.ID) {
}()
biscuitBytes, err := n.loadIdentityForAuth()
if err != nil {
+ logger.Errorf("[AuthN] Cannot redial router %s without an identity: %v", router, err)
return
}
delay := n.config.RouterRedialDelay
@@ -1149,6 +1150,9 @@ func (n *SamNode) ConnectAndAuthWithRouter(ctx context.Context, addr multiaddr.M
}
routers := routerPeers(ctx, []multiaddr.Multiaddr{addr})
+ if len(routers) == 0 {
+ return fmt.Errorf("no router peer behind %s", addr)
+ }
var connected bool
var lastFatalErr error
var errs []error