Skip to content
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

Failed to stat logfile / Can't determine log file #55

Closed
vitabaks opened this issue Feb 11, 2019 · 7 comments
Closed

Failed to stat logfile / Can't determine log file #55

vitabaks opened this issue Feb 11, 2019 · 7 comments
Assignees
Labels

Comments

@vitabaks
Copy link

pgcenter_0.6.0_Linux_x86_64.deb

'L' logtail.
result:
Failed to stat logfile: stat : no such file or directory

l open log file with pager.
result:
Can't determine log file: can't parse log_filename format

show log_directory;

    log_directory
---------------------
 /var/log/postgresql

show log_filename;

   log_filename
-------------------
 postgresql-%a.log

p.s.
This actions is worked on v0.4.0.

@lesovsky
Copy link
Owner

@vitabaks Try to build pgcenter from dev branch and reproduce the bug

@vitabaks
Copy link
Author

Try to build pgcenter from dev branch

@lesovsky Maybe I do not have enough experience for build on go...

root@drm-pgnode02:~# cd /tmp/pgcenter-dev/
root@drm-pgnode02:/tmp/pgcenter-dev# make
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
go mod download
go: finding github.com/jmoiron/sqlx v1.2.0
go: finding github.com/jroimartin/gocui v0.4.0
go: finding github.com/lib/pq v1.0.0
go: finding github.com/inconshreveable/mousetrap v1.0.0
go: finding github.com/spf13/pflag v1.0.2
go: finding github.com/mattn/go-runewidth v0.0.3
go: finding github.com/spf13/cobra v0.0.3
go: finding github.com/pkg/errors v0.8.0
^CMakefile:21: recipe for target 'pgcenter' failed
make: *** [pgcenter] Interrupt

root@drm-pgnode02:/tmp/pgcenter-dev# git init
Initialized empty Git repository in /tmp/pgcenter-dev/.git/
root@drm-pgnode02:/tmp/pgcenter-dev#
root@drm-pgnode02:/tmp/pgcenter-dev# make
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
go mod download
go: finding github.com/jroimartin/gocui v0.4.0
go: finding github.com/spf13/pflag v1.0.2
go: finding github.com/lib/pq v1.0.0
go: finding github.com/mattn/go-runewidth v0.0.3
go: finding github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869
go: finding github.com/inconshreveable/mousetrap v1.0.0
go: finding github.com/spf13/cobra v0.0.3
go: finding github.com/nsf/termbox-go v0.0.0-20180819125858-b66b20ab708e
^CMakefile:21: recipe for target 'pgcenter' failed
make: *** [pgcenter] Interrupt

go version go1.11.5 linux/amd64

@vitabaks
Copy link
Author

vitabaks commented Feb 11, 2019

go build pgcenter.go

its worked

root@drm-pgnode02:/tmp/pgcenter-dev# ./pgcenter top -h /var/run/postgresql/ -U postgres -d postgres

'L' logtail.
default

but...

2019-02-11 16:58:10 MSK [12036-1] [local] postgres@postgres ERROR:  unrecognized configuration parameter "track_commit_timestamp"
2019-02-11 16:58:10 MSK [12036-2] [local] postgres@postgres STATEMENT:  SELECT current_setting($1)
2019-02-11 16:58:10 MSK [12036-3] [local] postgres@postgres ERROR:  function pg_current_logfile() does not exist at character 8
2019-02-11 16:58:10 MSK [12036-4] [local] postgres@postgres HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
2019-02-11 16:58:10 MSK [12036-5] [local] postgres@postgres STATEMENT:  SELECT pg_current_logfile();

PostgreSQL ver: 9.4.18

@lesovsky
Copy link
Owner

Last errors are ok, code will be rewritten to be more careful and don't cause errors.
First error, related to track_commit_timestamp, it's just checking is this option enabled or not. But track_commit_timestamp is quite new and in old versions of Postgres might cause errors.
Second error is also related to new function pg_current_logfile(), if it fails it pgcenter uses more generic way for finding logfile.
I have these points in TODO, so they will be refactored in the future versions.

@vitabaks
Copy link
Author

Thank you!

@lesovsky
Copy link
Owner

I have found some mess in my branches, I going to tidy up them and then merge the bugfix into the master master. So you can find new updated packages tomorrow (or even this evening)

@lesovsky
Copy link
Owner

fixed in v0.6.1

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

No branches or pull requests

2 participants