Open mgibson323 opened 3 years ago
Also look into having a non-nil default for -T / --timeout in all the scripts. libpq12+ breaks the scripts on libpq 12.
Note also, libpq is always able to talk to lower releases. I.E. this should be built with the latest libpq from the latest release from PGDG.
Note 1: There is no ubuntu asset. there is at best a debian platform_family asset
Note 2: ongoing work to refactor is here: https://github.com/sensu-plugins/sensu-plugins-postgres/tree/js/update-asset-libpq12
Dockerfiles controlling the asset build are found in the directory asset_build_scripts/
Debian platform_family asset build is controlled by Dockerfile.debian
file and is making use of the upstream repository:
http://apt.postgresql.org/pub/repos/apt/
Which I thought was best practice and would provide latest libpq.
I guess the question is.. why is the upstream repository not offering the latest libpq12? I'm not a debian user, so I may be getting the packaging commands wrong. Input from a debian user on how to ensure that the most recent libpq packages from the upstream repository are being pulled would be appreciated.
Debian's packages are generally behind PGDG's releases.
I personally pull from the apt repo referenced here: https://wiki.postgresql.org/wiki/Apt
PostgreSQL 13 is the latest release, and 14 is starting the release process, for what it's worth.
I didnt say debian's packages I said postgresl.org's packages FOR debian
This is the file in question. Please review the packaging commands being used to setup the posgresql.org apt repository and then install libpq-dev package:
https://github.com/sensu-plugins/sensu-plugins-postgres/blob/js/update-asset-libpq12/asset_build_scripts/Dockerfile.debian
I have no idea why using the best practice postgresl.org repository isn't pulling a recent enough libpq version. My understanding is this is the correct source to use.
you want the libpq5 package:
postgres@postgresql-slave-000:/usr/lib/x86_64-linux-gnu$ dpkg-query -S pwd
/libpq.so.5.13
libpq5:amd64: /usr/lib/x86_64-linux-gnu/libpq.so.5.13
postgres@postgresql-slave-000:/usr/lib/x86_64-linux-gnu$
sorry for not reading clearly :)
thanks I'll update the file and rebuild the test debian family asset in the testing bucket.
Can you also look into the -T / --timeout thing with nil, which breaks with the later libpq's?
If you can suggest I reasonable default to replace nil to test I can change it.
I'd say 10-30 seconds. If PostgreSQL doesn't respond in that time, there's something wrong, IMO.
I'll open a separate branch with that change. In the meantime can you test and see if explicit use of the --timeout option as an argument works with the next test asset?
using -T 10 works with the current test asset, that's how I got around it yesterday.
the Alpha @mgibson323 gave me is the test asset I'm using.
you'll have to teach me how to get my SensuGo to pull the test asset(s). Thanks in advance.
Okay this should have an updated asset definition that points to the new alpha.2 debian build. I've also correct the definition so that it uses platform_family filter so it should work on ubuntu without modification. https://cre-testing.s3.us-west-2.amazonaws.com/sensu-plugins-postgres/sensu-plugins-postgres.yaml
You'll want to review it first, maybe change the asset name as needed for your test, but this should load with sensuctl create -f
Looks good. Worked just fine.
okay let's get that timeout default fixed up now.
I wonder does timeout 0 disable timeout?
not sure. I do know that it doesn't like "" :)
connect_timeout
Maximum time to wait while connecting, in seconds (write as a decimal integer, e.g., 10). Zero, negative, or not specified means wait indefinitely. The minimum allowed timeout is 2 seconds, therefore a value of 1 is interpreted as 2. This timeout applies separately to each host name or IP address. For example, if you specify two hosts and connect_timeout is 5, each host will time out if no connection is made within 5 seconds, so the total time spent waiting for a connection might be up to 10 seconds.
next test build will have 10 second timeout default for all included check executables and should error if argument to timeout is not understandable as an integer. One of the checks already had 2 default defined instead of nil and was ensuring processing of argument as integer.
Great! let me know when it's ready, and I'll put it in, and remove my -T 10's.
Okay repull that s3 bucket url and it will have an updated asset definition pointing to alpha.3 test build
Looks Good! removed my -T 10's and pointed to Alpha.3, and we're golden. Thanks!
can you let me know when it's pushed to Bonsai? -- Thanks!
Well pushed to bonsai is gonna be a bit longer as these changes will need review from someone else as per normal merge/release rules.
I'll keep this issue open and close it when we have a release approved through normal channels. Until then you can use the test asset. Once the official asset is releases, we'll empty out the test bucket after you confirm the swtich.
Thanks a ton!
To help improve compatibility with latest versions of Postgres on Ubuntu the plugin should be updated with libpq 10+.
Once updated, please release to Bonsai.
(Follow up to #157)