Skip to content

postgres-exporter has pg_postmaster_start_time invalid syntax

Summary

Seeing invalid data type error in postgres-exporter logs due to the bug in postgres-exporter (it's been address though, hopefully the fix is simple for GitLab):


==> /var/log/gitlab/postgres-exporter/current <==
2023-07-28_09:22:39.04730 ts=2023-07-28T09:22:39.047Z caller=collector.go:190 level=error msg="collector failed" name=replication duration_seconds=0.000338635 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2023-07-28 05:41:21.748421 +0000 GMT\") to a float64: invalid syntax"
2023-07-28_09:22:39.05917 ts=2023-07-28T09:22:39.059Z caller=collector.go:190 level=error msg="collector failed" name=postmaster duration_seconds=0.012142709 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2023-07-28 05:41:21.748421 +0000 GMT\") to a float64: invalid syntax"

Steps to reproduce

  1. Enable PSQL Exporter (if not yet)
  2. Run gitlab-ctl tail postgres-exporter

Environment details:

  1. psql (PostgreSQL) 13.11
  2. gitlab v16.2.1-ee

Example Project

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Evgeny Rudinsky (GitLab)