From e6e3d45b1ef8fa061a0384390a449feeeff55a0e Mon Sep 17 00:00:00 2001 From: Frank Li <39414003+frankisawesome@users.noreply.github.com> Date: Mon, 15 Nov 2021 21:39:06 +1000 Subject: [PATCH] [2982] Handle operation not permitted exception (firewall) (#3058) * catch exception Signed-off-by: Frank Li * use full error message Signed-off-by: Frank Li Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com> Co-authored-by: Sally MacFarlane --- .../besu/ethereum/p2p/discovery/PeerDiscoveryAgent.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/PeerDiscoveryAgent.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/PeerDiscoveryAgent.java index c1b1b9a7251..a7e449a9aca 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/PeerDiscoveryAgent.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/PeerDiscoveryAgent.java @@ -315,6 +315,12 @@ protected void handleOutgoingPacket(final DiscoveryPeer peer, final Packet packe if (err instanceof SocketException && err.getMessage().contains("unreachable")) { LOG.debug( "Peer {} is unreachable, packet: {}", peer, wrapBuffer(packet.encode()), err); + } else if (err instanceof SocketException + && err.getMessage().contentEquals("Operation not permitted")) { + LOG.debug( + "Operation not permitted sending to peer {}, this might be caused by firewall rules blocking traffic to a specific route.", + peer, + err); } else if (err instanceof UnsupportedAddressTypeException) { LOG.warn( "Unsupported address type exception when connecting to peer {}, this is likely due to ipv6 not being enabled at runtime. "