From 7421dcb45f9ead04e0d0a7761a9933b31b2224ed Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Fri, 11 Nov 2022 09:44:17 +0000 Subject: [PATCH] feat(openvpn): explain ip route error in logs - `RTNETLINK answers: File exists` changed to warning with explanation - `Linux route add command failed:` changed to warning with explanation --- internal/openvpn/logs.go | 10 ++++++++++ internal/openvpn/logs_test.go | 30 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/internal/openvpn/logs.go b/internal/openvpn/logs.go index 7990d469..f1946ebf 100644 --- a/internal/openvpn/logs.go +++ b/internal/openvpn/logs.go @@ -65,6 +65,16 @@ That error usually happens because either: filtered = s level = levelInfo } + + switch { + case filtered == "RTNETLINK answers: File exists": + filtered = "OpenVPN tried to add an IP route which already exists (" + filtered + ")" + level = levelWarn + case strings.HasPrefix(filtered, "Linux route add command failed: "): + filtered = "Previous error details: " + filtered + level = levelWarn + } + filtered = constants.ColorOpenvpn().Sprintf(filtered) return filtered, level } diff --git a/internal/openvpn/logs_test.go b/internal/openvpn/logs_test.go index 991180fd..a9f099ff 100644 --- a/internal/openvpn/logs_test.go +++ b/internal/openvpn/logs_test.go @@ -43,6 +43,36 @@ func Test_processLogLine(t *testing.T) { "AUTH: Received control message: AUTH_FAILED", "AUTH: Received control message: AUTH_FAILED\n\nYour credentials might be wrong ๐Ÿคจ\n\n", levelError}, + "TLS key negotiation error": { + s: "TLS Error: TLS key negotiation failed to occur within " + + "60 seconds (check your network connectivity)", + filtered: "TLS Error: TLS key negotiation failed to occur within " + + "60 seconds (check your network connectivity)" + ` +๐Ÿš’๐Ÿš’๐Ÿš’๐Ÿš’๐Ÿš’๐Ÿšจ๐Ÿšจ๐Ÿšจ๐Ÿšจ๐Ÿšจ๐Ÿšจ๐Ÿš’๐Ÿš’๐Ÿš’๐Ÿš’๐Ÿš’ +That error usually happens because either: + +1. The VPN server IP address you are trying to connect to is no longer valid ๐Ÿ”Œ + Update your server information using https://github.com/qdm12/gluetun/wiki/Updating-Servers + +2. The VPN server crashed ๐Ÿ’ฅ, try changing your VPN servers filtering options such as SERVER_REGIONS + +3. Your Internet connection is not working ๐Ÿคฏ, ensure it works + +4. Something else โžก๏ธ https://github.com/qdm12/gluetun/issues/new/choose +`, + level: levelWarn, + }, + "RTNETLINK answers: File exists": { + s: "ERROR: RTNETLINK answers: File exists", + filtered: "OpenVPN tried to add an IP route which already exists " + + "(RTNETLINK answers: File exists)", + level: levelWarn, + }, + "Linux route add command failed": { + s: "ERROR: Linux route add command failed: some error", + filtered: "Previous error details: Linux route add command failed: some error", + level: levelWarn, + }, } for name, tc := range tests { tc := tc