powa-team / powa

PostgreSQL Workload Analyzer
http://powa.readthedocs.io/
PostgreSQL License
758 stars 60 forks source link

powa-collector is not able to connect to remote server, after RHEL8 upgrade #179

Open hrawulwa opened 3 months ago

hrawulwa commented 3 months ago

I have a remote setup which used to work fine on RHEL7. After upgrade to RHEL8, having problems. When starting powa-collector, the log file displays list of workers, but says no connection to remote server for each of them. I have verified the remote server has the pg_hba entry correctly configured. I recompiled powa collector without errors.

Thanks Hari

rjuju commented 3 months ago

Hi,

There should be an error in the postgres logs of the remote explaining why the connection failed. If not, it means that the collector somehow could not try to connect (wrong IP/port, firewall or something). Can you check which one it is?

hrawulwa commented 3 months ago

Strange thing is I do not see any error in the postgres logs of the remote server. I did verify firewall is open on the port from repository to remote server, In fact, I'm able to do psql using -h option to connect to remote server from the repository server.

Thanks Hari

rjuju commented 3 months ago

did you double check that the host and port are exactly the same as defined in the powa_servers table on the repository server? also, is the collector running on the same machine as the repository server?

rjuju commented 3 months ago

also, the collector should give the full connection error info, can you share it?

hrawulwa commented 3 months ago

Here are the messages when starting up powa-collector daemon. I have removed password column from below message. Anyway, trust authentication is enabled for this repository server on the remote servers.

2024-03-19 03:50:05,416 - INFO : Starting powa-collector... 2024-03-19 03:50:05,439 sl73togadbp001:5432 INFO : Starting worker 2024-03-19 03:50:05,443 sl73spiiqdbp010:5432 INFO : Starting worker 2024-03-19 03:50:05,445 sl73scmdbp023:5432 INFO : Starting worker 2024-03-19 03:50:05,448 - INFO : List of workers: 2024-03-19 03:50:05,449 - INFO : sl73togadbp001:5432: {'host': 'sl73togadbp001', 'port': 5432, 'user': 'postgres', 'dbname': 'postgres'} (no connection to remote server) 2024-03-19 03:50:05,449 - INFO : sl73scmdbp023:5432: {'host': 'sl73scmdbp023', 'port': 5432, 'user': 'postgres', 'dbname': 'postgres'} (no connection to remote server)

Thanks Hari

hrawulwa commented 3 months ago

Below is how it is configured inside the powa database in repository server.

hrawulwa commented 3 months ago

powa=# select id, hostname,alias,port,username, dbname, frequency,retention from powa_servers;

id | hostname | alias | port | username | dbname | frequency | retention ----+-----------------+------------------------+------+----------+----------+-----------+----------- 0 | | | 0 | | | -1 | 00:00:00 2 | sl73togadbp001 | TGS-PROD-OCE1 | 5432 | postgres | postgres | 300 | 7 days 5 | sl73scmdbp023 | SCM Bitbucket Prod OCE | 5432 | postgres | postgres | 300 | 7 days

(3 rows)

rjuju commented 3 months ago

2024-03-19 03:50:05,416 - INFO : Starting powa-collector... 2024-03-19 03:50:05,439 sl73togadbp001:5432 INFO : Starting worker 2024-03-19 03:50:05,443 sl73spiiqdbp010:5432 INFO : Starting worker 2024-03-19 03:50:05,445 sl73scmdbp023:5432 INFO : Starting worker 2024-03-19 03:50:05,448 - INFO : List of workers: 2024-03-19 03:50:05,449 - INFO : sl73togadbp001:5432: {'host': 'sl73togadbp001', 'port': 5432, 'user': 'postgres', 'dbname': 'postgres'} (no connection to remote server) 2024-03-19 03:50:05,449 - INFO : sl73scmdbp023:5432: {'host': 'sl73scmdbp023', 'port': 5432, 'user': 'postgres', 'dbname': 'postgres'} (no connection to remote server)

this is expected, this shows the status of workers just after their creation, but they didn't need to connect to the remote servers yet, so there's no remote connection.

do you actually hit an error when trying to perform a snapshot, which is when the worker will try to connect if there isn't a connection?

hrawulwa commented 3 months ago

Ok got it. I had to recompile powa-web also, after the RHEL upgrade. However, getting errors during build install. I still tried starting up powa-web, but it exits with error (bottom of this thread).

Downloaded and installed SQLAlchemy-0.9.9 Downloaded and installed tornado-4.0

[root@sl73pgtldbp001 powa-web-4.1.1]# python setup.py build running build running build_py copying powa/options.py -> build/lib/powa copying powa/user.py -> build/lib/powa running egg_info writing powa_web.egg-info/PKG-INFO writing dependency_links to powa_web.egg-info/dependency_links.txt writing requirements to powa_web.egg-info/requires.txt writing top-level names to powa_web.egg-info/top_level.txt reading manifest file 'powa_web.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching 'powa/templates/' writing manifest file 'powa_web.egg-info/SOURCES.txt' running build_scripts creating build/scripts-3.6 copying and adjusting powa-web -> build/scripts-3.6 changing mode of build/scripts-3.6/powa-web from 644 to 755

[root@sl73pgtldbp001 powa-web-4.1.1]#

[root@sl73pgtldbp001 powa-web-4.1.1]# python setup.py build install running build running build_py running egg_info writing powa_web.egg-info/PKG-INFO writing dependency_links to powa_web.egg-info/dependency_links.txt writing requirements to powa_web.egg-info/requires.txt writing top-level names to powa_web.egg-info/top_level.txt reading manifest file 'powa_web.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching 'powa/templates/' writing manifest file 'powa_web.egg-info/SOURCES.txt' running build_scripts running install running bdist_egg installing library code to build/bdist.linux-x86_64/egg running install_lib creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/powa copying build/lib/powa/init.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/collector.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/compat.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/config.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/dashboards.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/database.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/framework.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/json.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/overview.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/qual.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/query.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/server.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/ui_methods.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/ui_modules.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/wizard.py -> build/bdist.linux-x86_64/egg/powa creating build/bdist.linux-x86_64/egg/powa/sql copying build/lib/powa/sql/init.py -> build/bdist.linux-x86_64/egg/powa/sql copying build/lib/powa/sql/compat.py -> build/bdist.linux-x86_64/egg/powa/sql copying build/lib/powa/sql/tables.py -> build/bdist.linux-x86_64/egg/powa/sql copying build/lib/powa/sql/utils.py -> build/bdist.linux-x86_64/egg/powa/sql copying build/lib/powa/sql/views.py -> build/bdist.linux-x86_64/egg/powa/sql copying build/lib/powa/powa.wsgi -> build/bdist.linux-x86_64/egg/powa creating build/bdist.linux-x86_64/egg/powa/static creating build/bdist.linux-x86_64/egg/powa/static/css copying build/lib/powa/static/css/foundation-icons.eot -> build/bdist.linux-x86_64/egg/powa/static/css copying build/lib/powa/static/css/foundation-icons.svg -> build/bdist.linux-x86_64/egg/powa/static/css copying build/lib/powa/static/css/foundation-icons.ttf -> build/bdist.linux-x86_64/egg/powa/static/css copying build/lib/powa/static/css/foundation-icons.woff -> build/bdist.linux-x86_64/egg/powa/static/css copying build/lib/powa/static/css/powa-all.min.css -> build/bdist.linux-x86_64/egg/powa/static/css copying build/lib/powa/static/css/powa-all.min.css.map -> build/bdist.linux-x86_64/egg/powa/static/css copying build/lib/powa/static/css/translucent.css -> build/bdist.linux-x86_64/egg/powa/static/css creating build/bdist.linux-x86_64/egg/powa/static/img copying build/lib/powa/static/img/powa-logo-white.png -> build/bdist.linux-x86_64/egg/powa/static/img creating build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon-114x114.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon-120x120.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon-144x144.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon-152x152.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon-57x57.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon-60x60.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon-72x72.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon-76x76.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon-precomposed.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/apple-touch-icon.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/browserconfig.xml -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/favicon-160x160.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/favicon-16x16.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/favicon-196x196.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/favicon-32x32.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/favicon-96x96.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/favicon.ico -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/mstile-144x144.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/mstile-150x150.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/mstile-310x150.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/mstile-310x310.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon copying build/lib/powa/static/img/favicon/mstile-70x70.png -> build/bdist.linux-x86_64/egg/powa/static/img/favicon creating build/bdist.linux-x86_64/egg/powa/static/js copying build/lib/powa/static/js/config.js -> build/bdist.linux-x86_64/egg/powa/static/js copying build/lib/powa/static/js/powa.min-all.js -> build/bdist.linux-x86_64/egg/powa/static/js copying build/lib/powa/static/js/require.js -> build/bdist.linux-x86_64/egg/powa/static/js creating build/bdist.linux-x86_64/egg/powa/templates copying build/lib/powa/templates/fullpage_dashboard.html -> build/bdist.linux-x86_64/egg/powa/templates copying build/lib/powa/templates/index.html -> build/bdist.linux-x86_64/egg/powa/templates copying build/lib/powa/templates/layout.html -> build/bdist.linux-x86_64/egg/powa/templates copying build/lib/powa/templates/login.html -> build/bdist.linux-x86_64/egg/powa/templates copying build/lib/powa/templates/messages.html -> build/bdist.linux-x86_64/egg/powa/templates copying build/lib/powa/templates/navigation.html -> build/bdist.linux-x86_64/egg/powa/templates copying build/lib/powa/templates/xhr.html -> build/bdist.linux-x86_64/egg/powa/templates copying build/lib/powa/templates/xhrm.html -> build/bdist.linux-x86_64/egg/powa/templates creating build/bdist.linux-x86_64/egg/powa/templates/config copying build/lib/powa/templates/config/allcollectors.html -> build/bdist.linux-x86_64/egg/powa/templates/config copying build/lib/powa/templates/config/serverserror.html -> build/bdist.linux-x86_64/egg/powa/templates/config creating build/bdist.linux-x86_64/egg/powa/templates/database copying build/lib/powa/templates/database/nowizard.html -> build/bdist.linux-x86_64/egg/powa/templates/database copying build/lib/powa/templates/database/wizard.html -> build/bdist.linux-x86_64/egg/powa/templates/database copying build/lib/powa/templates/database/wizardthisdatabase.html -> build/bdist.linux-x86_64/egg/powa/templates/database creating build/bdist.linux-x86_64/egg/powa/templates/database/query copying build/lib/powa/templates/database/query/detail.html -> build/bdist.linux-x86_64/egg/powa/templates/database/query copying build/lib/powa/templates/database/query/explains.html -> build/bdist.linux-x86_64/egg/powa/templates/database/query copying build/lib/powa/templates/database/query/indexes.html -> build/bdist.linux-x86_64/egg/powa/templates/database/query copying build/lib/powa/templates/database/query/qualdetail.html -> build/bdist.linux-x86_64/egg/powa/templates/database/query copying build/lib/powa/options.py -> build/bdist.linux-x86_64/egg/powa copying build/lib/powa/user.py -> build/bdist.linux-x86_64/egg/powa byte-compiling build/bdist.linux-x86_64/egg/powa/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/collector.py to collector.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/compat.py to compat.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/config.py to config.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/dashboards.py to dashboards.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/database.py to database.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/framework.py to framework.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/json.py to json.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/overview.py to overview.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/qual.py to qual.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/query.py to query.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/server.py to server.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/ui_methods.py to ui_methods.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/ui_modules.py to ui_modules.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/wizard.py to wizard.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/sql/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/sql/compat.py to compat.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/sql/tables.py to tables.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/sql/utils.py to utils.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/sql/views.py to views.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/options.py to options.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/powa/user.py to user.cpython-36.pyc Sorry: TabError: inconsistent use of tabs and spaces in indentation (user.py, line 17) creating build/bdist.linux-x86_64/egg/EGG-INFO installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts running install_scripts creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-3.6/powa-web -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/powa-web to 755 copying powa_web.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying powa_web.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying powa_web.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying powa_web.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying powa_web.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... powa.pycache.init.cpython-36: module references file powa.pycache.dashboards.cpython-36: module MAY be using inspect.stack creating 'dist/powa_web-4.1.1-py3.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing powa_web-4.1.1-py3.6.egg removing '/usr/local/lib/python3.6/site-packages/powa_web-4.1.1-py3.6.egg' (and everything under it) creating /usr/local/lib/python3.6/site-packages/powa_web-4.1.1-py3.6.egg Extracting powa_web-4.1.1-py3.6.egg to /usr/local/lib/python3.6/site-packages Sorry: TabError: inconsistent use of tabs and spaces in indentation (user.py, line 17) powa-web 4.1.1 is already the active version in easy-install.pth Installing powa-web script to /usr/local/bin

Installed /usr/local/lib/python3.6/site-packages/powa_web-4.1.1-py3.6.egg Processing dependencies for powa-web==4.1.1 Searching for psycopg2==2.7.5 Best match: psycopg2 2.7.5 Adding psycopg2 2.7.5 to easy-install.pth file Using /usr/lib64/python3.6/site-packages Searching for tornado==4.0 Best match: tornado 4.0 Processing tornado-4.0-py3.6-linux-x86_64.egg Adding tornado 4.0 to easy-install.pth file Using /usr/local/lib64/python3.6/site-packages/tornado-4.0-py3.6-linux-x86_64.egg Searching for SQLAlchemy==0.9.9 Best match: SQLAlchemy 0.9.9 Processing SQLAlchemy-0.9.9-py3.6-linux-x86_64.egg Adding SQLAlchemy 0.9.9 to easy-install.pth file Using /usr/local/lib64/python3.6/site-packages/SQLAlchemy-0.9.9-py3.6-linux-x86_64.egg Searching for certifi==2020.4.5.1 Best match: certifi 2020.4.5.1 Processing certifi-2020.4.5.1-py3.6.egg certifi 2020.4.5.1 is already the active version in easy-install.pth Using /usr/local/lib/python3.6/site-packages/certifi-2020.4.5.1-py3.6.egg Finished processing dependencies for powa-web==4.1.1

[root@sl73pgtldbp001 powa-web-4.1.1]#

cd /pgbin/powa/powa-web-4.1.1

[root@sl73pgtldbp001 powa-web-4.1.1]# nohup ./powa-web & [root@sl73pgtldbp001 powa-web-4.1.1]# cat nohup.out

Traceback (most recent call last): File "./powa-web", line 2, in from powa import make_app File "/pgbin/powa/powa-web-4.1.1/powa/init.py", line 15, in from tornado.web import Application, URLSpec as U ModuleNotFoundError: No module named 'tornado' Traceback (most recent call last): File "./powa-web", line 2, in from powa import make_app File "/pgbin/powa/powa-web-4.1.1/powa/init.py", line 20, in from powa.user import LoginHandler, LogoutHandler File "/pgbin/powa/powa-web-4.1.1/powa/user.py", line 17 expires_days = options.cookie_expires_days ^ TabError: inconsistent use of tabs and spaces in indentation

rjuju commented 3 months ago

I'm really confused with that. First, the mentioned code landed in version 4.1.3, but you seem to be working on version 4.1.1. Which version / commit are you using? Or do you have some custom patch?

Then, there isn't a single tab in the powa/user.py file, and nothing wrong that I can see with the number of spaces either around that line in versions 4.1.3+.

hrawulwa commented 3 months ago

I'm also confused now. Couple years ago, with reference to #134, there was issue with 4.1.1 version related to tornado, and I had to install tornado 4.0 to make it work, Not sure if I installed any custom patch based on my previous tickets. Anyways, do you recommend me to download and install powa-web 4.1.3 and see if this fixes the issue?

rjuju commented 3 months ago

I would recommend trying version 4.1.4 if you want to stay with powa 4.1, or even 4.2.0 if you have pg_stat_statements > 1.9 (and then switch to powa-archivist 4.2.2).

hrawulwa commented 3 months ago

Let me try web version 4.1.4. Majority of remote DB servers are in 12.x and 14.x versions using powa-archivist 4.1.2 and pg_stat_statements 1.9. So makes sense to stick with 4.1.4 web version for now.

hrawulwa commented 3 months ago

web 4.1.4 worked fine. However I'm having issue with another repository server for Non-Prod servers. I followed same steps there to install and compile 4.1.4 However the UI screen is blank, and does not show the DB servers. There is one server registered. powa=# select id, hostname,alias,port,username,password, dbname, frequency,retention from powa_servers;

id | hostname | alias | port | username | password | dbname | frequency | retention

----+----------------+----------+------+----------+----------+----------+-----------+-----------

0 | | | 0 | | | | -1 | 00:00:00

1 | sl73cawpdbq001 | ADOBE QA | 5432 | postgres | postgres | postgres | 300 | 7 days

(2 rows)

There are no error messages in the powa-web log file. [I 240320 23:09:02 powa-web:39] Starting powa-web on http://127.0.0.1:8889/ [I 240320 23:09:14 web:1811] 302 GET / (127.0.0.1) 0.89ms [W 240320 23:09:14 web:1811] 403 GET /login/?next=%2F (127.0.0.1) 13.34ms [I 240320 23:09:14 web:1811] 200 GET /static/css/powa-all.min.css?v=8c7dc8452e317e10953cf920dd367485 (127.0.0.1) 1.94ms [I 240320 23:09:15 web:1811] 200 GET /static/css/translucent.css?v=647ebcff5289bfdd1746def10b39f389 (127.0.0.1) 0.72ms [I 240320 23:09:15 web:1811] 200 GET /static/img/favicon/favicon-32x32.png?v=f64009832088abf024bd5c01c175449f (127.0.0.1) 0.50ms [I 240320 23:09:15 web:1811] 200 GET /static/js/require.js?v=640929dac3c23a448d2eebc37bc32062 (127.0.0.1) 0.96ms [I 240320 23:09:15 web:1811] 200 GET /static/js/powa.min-all.js?v=9b661ca18f5af5c8c6c0b15e6150f5e1 (127.0.0.1) 1.59ms [I 240320 23:09:25 web:1811] 302 POST /login/?next=%2F (127.0.0.1) 1588.27ms [I 240320 23:09:25 web:1811] 302 GET / (127.0.0.1) 170.11ms [I 240320 23:09:26 web:1811] 200 GET /server/ (127.0.0.1) 182.50ms [I 240320 23:09:26 web:1811] 200 GET /static/css/foundation-icons.woff (127.0.0.1) 0.97ms

powa-ui

rjuju commented 3 months ago

is there any error in the browser console?

hrawulwa commented 3 months ago

No errors in the browser console.

rjuju commented 3 months ago

any error in the underlying postgres repository server?

hrawulwa commented 3 months ago

It was not showing errors when only one server sl73cawpdbq001 was registered earlier. When I registered the second server, and restarted collector, it started showing errors.

2024-03-20 23:18:50,696 - INFO : List of workers: 2024-03-20 23:18:50,697 - INFO : sl73cawpdbq001:5432: {'host': 'sl73cawpdbq001', 'port': 5432, 'user': 'postgres', 'dbname': 'postgres'} (no connection to remote server) 2024-03-20 23:18:50,697 - INFO : sl73togadbq003:5432: {'host': 'sl73togadbq003', 'port': 5432, 'user': 'postgres', 'dbname': 'postgres'} (no connection to remote server) 2024-03-20 23:18:50,723 sl73togadbq003:5432 ERROR : PoWA extension not found 2024-03-20 23:18:50,723 sl73togadbq003:5432 INFO : Disconnecting from remote server 2024-03-20 23:18:50,723 sl73togadbq003:5432 INFO : Disconnecting from repository Exception in thread sl73togadbq003:5432: Traceback (most recent call last): File "/usr/lib64/python3.6/threading.py", line 937, in _bootstrap_inner self.run() File "/pgbin/powa/powa-collector-1.1.1/powa_collector/powa_worker.py", line 597, in run self.worker_main() File "/pgbin/powa/powa-collector-1.1.1/powa_collector/powa_worker.py", line 340, in __worker_main self.check_powa() File "/pgbin/powa/powa-collector-1.1.1/powa_collector/powa_worker.py", line 200, in __check_powa self.connect() File "/pgbin/powa/powa-collector-1.1.1/powa_collector/powa_worker.py", line 296, in connect cur = self.__remote_conn.cursor() AttributeError: 'NoneType' object has no attribute 'cursor' 2024-03-20 23:18:54,518 - INFO : Stopping all workers and exiting... 2024-03-20 23:18:54,518 sl73cawpdbq001:5432 INFO : Asked to stop... 2024-03-20 23:18:54,518 sl73togadbq003:5432 INFO : Asked to stop... 2024-03-20 23:18:54,649 sl73cawpdbq001:5432 INFO : Disconnecting from remote server 2024-03-20 23:18:54,649 sl73cawpdbq001:5432 INFO : stopped 2024-03-20 23:19:01,321 - INFO : Starting powa-collector... 2024-03-20 23:19:01,330 sl73cawpdbq001:5432 INFO : Starting worker 2024-03-20 23:19:01,330 sl73togadbq003:5432 INFO : Starting worker 2024-03-20 23:19:01,330 - INFO : List of workers: 2024-03-20 23:19:01,332 - INFO : sl73cawpdbq001:5432: {'host': 'sl73cawpdbq001', 'port': 5432, 'user': 'postgres', 'dbname': 'postgres'} (no connection to remote server) 2024-03-20 23:19:01,332 - INFO : sl73togadbq003:5432: {'host': 'sl73togadbq003', 'port': 5432, 'user': 'postgres', 'dbname': 'postgres'} (no connection to remote server) 2024-03-20 23:19:01,390 sl73togadbq003:5432 ERROR : PoWA extension not found 2024-03-20 23:19:01,391 sl73togadbq003:5432 INFO : Disconnecting from remote server 2024-03-20 23:19:01,391 sl73togadbq003:5432 INFO : Disconnecting from repository

rjuju commented 3 months ago

Well, you clearly missed some configuration steps.

rjuju commented 3 months ago

Is everything now working after fixing that error?

hrawulwa commented 3 months ago

Yes, everything looks good now. There was some issue with the http server. I reinstalled which fixed the issue. Btw. I have got another question related to startup of collector and web. I usually start both the daemons using nohup ./powa-collector.py & and nohup ./powa-web & from its respective directories. I have seen nohup.out grown big, especially for powa-web. Any click on the Web UI writes to this log file. Is there any better mechanism to log these two daemon processes, and if possible perform log purging?

Thanks Hari

rjuju commented 3 months ago

ah good news!

for the logs if you're relying on custom startup the usual answer is to configure some external log file utility for behaviour you want, like logrotate (assuming that nohup plays well with it)

otherwise nowadays this is supposed to be handled by the OS service infrastructure, like systemd and journald

hrawulwa commented 3 months ago

Ok thanks. Will check those options.