-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command "node_is_alive" return python error #48
Comments
Hi, which version are you using ? |
I spotted a similar problem in #31 and fixed it in v1. |
Hi, The debian package : https://packages.debian.org/sid/check-patroni |
Can you try to apply this patch? diff --git a/check_patroni/types.py b/check_patroni/types.py
index 16789a7..dd64905 100644
--- a/check_patroni/types.py
+++ b/check_patroni/types.py
@@ -8,7 +8,7 @@ import requests
from . import _log
-class APIError(requests.exceptions.RequestException):
+class APIError(requests.RequestException):
"""This exception is raised when the rest api couldn't
be reached and we got a http status code different from 200.
"""
@@ -71,7 +71,7 @@ class PatroniResource(nagiosplugin.Resource):
try:
return r.json()
- except requests.exceptions.JSONDecodeError:
+ except requests.JSONDecodeError:
return None
raise nagiosplugin.CheckError("Connection failed for all provided endpoints")
@blogh, there is probably no need to pull exception classes from the |
I apply this patch :
But I have the same error like this :
|
@leeroyke, I tried this on my side with the debian package on a sid system and got no problem. Though the error you get seems to be related to the
|
Actually the problem comes from the debian package python3-requests 2.25, available in Debian 11. If i run this command with package python3-requests 2.25, the class JSONDecodeError return a error :
This issues has been reported in python here : In Debian 12 and package python3-requests 2.28.1 this issues has fixed. Sorry for the inconvenience, I report this bug in Debian for the package python3-requests 2.25 here : |
In requests 2.25, the top-level
These issues are about typing and should have no effect at runtime, so I think it's unrelated. I'm also quite surprised you mention this old requests version as you earlier said you were packaging check_patroni for Debian/Sid?! In any case, it does not seem we can do anything on our side, so the issue might be closed IMO. |
Thanks for your feedback. We have packaged check_patroni for Debian, but since the package is new, we can only deploy it on Debian Sid at this time. I close this issue. |
#59 should resolve this issue. |
Hello,
I use check_patroni on Debian 11 with python 3.9.2 and patroni 3.0.1, and i would like use the command "node_is_alive", but I return this python error, here is the command I use, in verbose mode :
Can you help me for this issues ?
Thanks.
The text was updated successfully, but these errors were encountered: