diff --git a/pkg/pool/pool.go b/pkg/pool/pool.go index c1265ea1..5abbde8a 100644 --- a/pkg/pool/pool.go +++ b/pkg/pool/pool.go @@ -13,6 +13,7 @@ import ( "github.com/nspcc-dev/neofs-api-go/pkg/client" "github.com/nspcc-dev/neofs-api-go/pkg/container" cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id" + "github.com/nspcc-dev/neofs-api-go/pkg/netmap" "github.com/nspcc-dev/neofs-api-go/pkg/object" "github.com/nspcc-dev/neofs-api-go/pkg/owner" "github.com/nspcc-dev/neofs-api-go/pkg/session" @@ -103,11 +104,21 @@ func newPool(ctx context.Context, options *BuilderOptions) (Pool, error) { } st, err := c.CreateSession(ctx, options.SessionExpirationEpoch) if err != nil { - address := "unknown" + var address interface{} = "unknown" + if epi, err := c.EndpointInfo(ctx); err == nil { - address = epi.NodeInfo().Address() + ni := epi.NodeInfo() + + addresses := make([]string, 0, ni.NumberOfAddresses()) + + netmap.IterateAllAddresses(ni, func(addr string) { + addresses = append(addresses, addr) + }) + + address = addresses } - return nil, fmt.Errorf("failed to create neofs session token for client %s: %w", address, err) + + return nil, fmt.Errorf("failed to create neofs session token for client %v: %w", address, err) } clientPacks[i] = &clientPack{client: c, sessionToken: st, healthy: true} }