Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Pgscv_problem #40

Closed
gmaharram opened this issue Jun 23, 2022 · 16 comments
Closed

Pgscv_problem #40

gmaharram opened this issue Jun 23, 2022 · 16 comments

Comments

@gmaharram
Copy link

gmaharram commented Jun 23, 2022

After starting pgscv, although pgscv's status is active, but it gives following error:

 **service":"pgscv","time":"2022-06-23T15:33:32+04:00","message":"system/sysinfo collector failed; invalid input, '': wrong number of values"}**

Also, i connect my database to prometheus and grafana, and in every 3 minute it returns no data, and after 30 seconds i am able to see data means i loose some data. So, I changed restart time to 1 sec, and now after 12 minutes for 2minutes there are not any data repeatedly.

OS: Centos 7
pgSCV Version: 0.7.5
Postgres: 11
Postgres and pgSCV are running on the same host

pgscv.yml:

listen_address: ip_address:9890
services:
  "postgres:5432":
    service_type: "postgres"
    conninfo: "postgres://postgres:somepassword@ip_address:5432/postgres"
defaults:
    postgres_username: "pgscv"
    postgres_password: "somepassword"
no_track_mode: false
@lesovsky
Copy link
Owner

Seems pgscv fails to read /etc/os-release file. Check that file exists and show its content pls

@lesovsky
Copy link
Owner

in every 3 minute it returns no data, and after 30 seconds i am able to see data means i loose some data.

is there any other errors, except this "system/sysinfo collector failed; invalid input, '': wrong number of values" ? If no, you should check logs of prometheus/grafana.

@gmaharram
Copy link
Author

etc/os-release gives this output

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

@gmaharram
Copy link
Author

gmaharram commented Jun 23, 2022

{"level":"error","service":"pgscv","time":"2022-06-23T16:14:32+04:00","message":"system/sysinfo collector failed; invalid input, '': wrong number of values"}
{"level":"error","service":"pgscv","time":"2022-06-23T16:15:02+04:00","message":"system/sysinfo collector failed; invalid input, '': wrong number of values"}
{"level":"warn","service":"pgscv","time":"2022-06-23T16:15:32+04:00","message":"get model for fd0 failed: open /sys/block/fd0/device/model: no such file or directory; skip"}

@lesovsky
Copy link
Owner

Hm, it fails when reading empty line in this file. Will fix in next release.

As a workaround you can remove empty line in the os-release file.

@gmaharram
Copy link
Author

Thank you for answering, also during no data i mean for 30 seconds curl -s http://127.0.0.1:9890/metrics | grep -c ^postgres this command gives 0

@lesovsky
Copy link
Owner

If you see no any other errors in pgSCV logs related to postgres, checkout Postgres logs and logs of other components.

@gmaharram
Copy link
Author

I removed the empty line, but error is the same

@lesovsky
Copy link
Owner

lesovsky commented Jun 23, 2022

When I adding empty line, i see that error. When remove empty line, error disappear. Also I have a unit test which helps me to reproduce that behaviour.

@gmaharram
Copy link
Author

Thank you it helped me a lot, but I got this warning again
{"level":"warn","service":"pgscv","time":"2022-06-23T16:41:32+04:00","message":"get model for fd0 failed: open /sys/block/fd0/device/model: no such file or directory; skip"}

@lesovsky
Copy link
Owner

Messages with warning severity are not critical, you could ignore it or reduce logging level from info (default) to error and omit them.

@gmaharram
Copy link
Author

There are not errors in PostgreSQL logs and pgscv, but I am not able to see some data again for 2 minutes continuously.

@lesovsky
Copy link
Owner

Show me the first lines of logs after pgscv is started (before the line with "message":"listen on http...")

@gmaharram
Copy link
Author

image

Jun 28 17:22:13 testdb systemd[1]: Started pgSCV is the Weaponry platform agent for PostgreSQL ecosystem.
Jun 28 17:22:14 testdb pgscv[19263]: {"level":"info","service":"pgscv","time":"2022-06-28T17:22:14+04:00","message":"read configuration from /etc/pgscv.yaml"}
Jun 28 17:22:14 testdb pgscv[19263]: {"level":"info","service":"pgscv","time":"2022-06-28T17:22:14+04:00","message":"no-track disabled, for details check the documentation about 'no_track_mode' option."}
Jun 28 17:22:14 testdb pgscv[19263]: {"level":"info","service":"pgscv","time":"2022-06-28T17:22:14+04:00","message":"registered new service [system:0]"}
Jun 28 17:22:14 testdb pgscv[19263]: {"level":"info","service":"pgscv","time":"2022-06-28T17:22:14+04:00","message":"registered new service [postgres:5432]"}

@lesovsky
Copy link
Owner

Ok, as i can see "postgres" service is registered. Now run pgscv with "--log-level=debug". It will produce a lot of debug messages. In another console run "curl -s http://127.0.0.1:9890/metrics | grep -c ^postgres" several times. When command returns 0 metrics, inspect debug logs for any suspicious messages.

@gmaharram
Copy link
Author

Thank you for your help, I think it is because of VM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants