View Issue Details

IDProjectCategoryView StatusLast Update
0000298pgpoolAdminBugpublic2017-08-29 09:49
Reporterwschwurack Assigned Topengbo  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionopen 
PlatformUbuntuOSx64OS Version14.04
Product Version3.6.0 
Summary0000298: pcp_watchdog_info command error occurred. Notice: Undefined offset: 2 in $PATH/command.php on line 156
DescriptionWhen I was looking see if this issue was reported I found issue 0000187 which states its been resolved but I'm getting the same errors in version 3.5 and 3.6
I used the same comments from issue 0000187 because the issue is the same.

Any function call In pgpooladmin web pages resulted error message like "pcp_proc_count command error occurred." or "pcp_node_count command error occurred." etc.
Following error printed in web server error log:
FATAL: authentication failed for user "postgres"
DETAIL: username and/or password does not match.
If I call for example pcp_proc_count from shell I promted with password, but in pgpool 3.4 I call pcp_* commands with password in parameter list (i.e. without need to input password after entering command).
In pgpoolAdmin`s command.php at 80-162 strings pcp_* commands invoked in old fashion like "pcp_command -w -h hostname -p port_num -U user". If I try to invoke any of pcp_* in such way in shell, I get same error as in web server error log:
FATAL: authentication failed for user "postgres"
DETAIL: username and/or password does not match.
Steps To Reproduce1) Install pgpool-3.6.2 and pgpoolAdmin 3.6.0 from sources according to documentation.
2) Add pcp user with md5 hashed password to pcp.conf
3) Start pgpool with command:
pgpool -n -D -d >pgpool.log 2>&1 &
4) Open pgpoolAdmin web interface, login as user 'postgres' and go to 'pgPool Status' tab.
If pgpool state in bottom of page is "not running" try start/restart buttons.
Then click on any of 'Process Info', 'Node Info' buttons or 'Node Status' tab and check "Backend info (PostgreSQL)" part for error messages like:
  pcp_node_count command error occurred,
  pcp_proc_count command error occurred
  etc...
5) Check web server error.log (/var/log/apache2/error.log in my case) for error message(s):
FATAL: authentication failed for user "postgres"
DETAIL: username and/or password does not match.

6) invoke any pcp_* command in shell, for example:
$pcp_proc_count -w -h localhost -p 9898 -U postgres
Check that result is:
FATAL: authentication failed for user "postgres"
DETAIL: username and/or password does not match

7) invoke same command in shell (without arguments in case of pcp_proc_count), enter password when shell prompts and check that command works!
Additional InformationThis is the same as issue 0000187 which states resolved but I'm getting the same errors in version 3.5 and 3.6
TagsNo tags attached.

Activities

pengbo

2017-04-07 14:13

developer   ~0001406

From Pgpool-II 3.5 .pcppass file is used for pcp connection authentication.

If you use pgpoolAdmin, you have to make .pcppass in apache user home directory like this:

====
-bash-4.2$ pwd
/usr/share/httpd
-bash-4.2$ cat .pcppass
*:9898:postgres:postgres
-bash-4.2$ chmod 600 .pcppass
====

If you execute pcp command in command line with option [-w], you have to create .pcppass file in this user home directory.

For example execute pcp command by root user:

====
# pwd
/root
# cat .pcppass
*:9898:postgres:postgres
# chmod 600 .pcppass
====
Please see the document for details.

http://www.pgpool.net/docs/latest/en/html/pcp-commands.html

wschwurack

2017-04-08 00:05

reporter   ~0001411

I tried what you stated but still fails when using '-w'

root@pgtest-con1:~# pwd
/root
root@pgtest-con1:~# cat .pcppass
*:9898:apache:c1d10d0db9c99fa6d3361639269141fd
*:9898:wolf:c1d10d0db9c99fa6d3361639269141fd
*:9898:postgres:1e234fd132b63d8e22cbc7b4d84f1342
root@pgtest-con1:~# ll .pcppass
-rw------- 1 apache root 141 Apr 7 08:57 .pcppass
root@pgtest-con1:~# pcp_proc_count -w -h localhost -p 9898 -U postgres
FATAL: authentication failed for user "postgres"
DETAIL: username and/or password does not match

root@pgtest-con1:~# pcp_proc_count -W -h localhost -p 9898 -U postgres
Password:
15506 15887 16846 18526 18735 30337 16674 13238 18034 18366 18445 18408 16455 17585 18407 12192 18691 17371 15951 15342 18327 18736 16560 31915 18261 22162 458 17567 16591 18525 18690 25115

wschwurack

2017-04-22 04:52

reporter   ~0001455

I got this to work by setting the correct info in .pcppass
What works
*:*:username:plain text password
or
localhost:9898:username:plain text password
example
*:*:postgres:password

Fails with this
hostname:wrong port:username:pg_md5 password

Issue History

Date Modified Username Field Change
2017-03-23 23:09 wschwurack New Issue
2017-03-24 09:47 pengbo Assigned To => pengbo
2017-03-24 09:47 pengbo Status new => assigned
2017-04-07 14:13 pengbo Note Added: 0001406
2017-04-08 00:05 wschwurack Note Added: 0001411
2017-04-22 04:52 wschwurack Note Added: 0001455
2017-08-29 09:49 pengbo Status assigned => closed