Postgres 13 and pgadmin4 in Mageia 8

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

Postgres 13 and pgadmin4 in Mageia 8

Postby hviaene » Aug 10th, '21, 16:45

Installed the database and it runs. Using the pgsql commands, I've been able to initiate the necessary database, user etc ... to let gnucash store its data in the postgres database.
But i cann't get pgadmin4 tool not working, and the (main?) reason seems to be that the pgadmin4 service does not run.
I get:
Code: Select all
# systemctl -l status pgadmin4
● pgadmin4.service - pgAdmin4
     Loaded: loaded (/usr/lib/systemd/system/pgadmin4.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Tue 2021-08-10 13:32:42 CEST; 3h 4min ago
    Process: 3242 ExecStart=/usr/bin/python3 /usr/lib/python3.8/site-packages/pgadmin4-web/pgAdmin4.py (code=exited, status=1/FAILURE)
   Main PID: 3242 (code=exited, status=1/FAILURE)
        CPU: 368ms

aug 10 13:32:42 mach1.hviaene.thuis python3[3242]:   File "<string>", line 341, in setup_db
aug 10 13:32:42 mach1.hviaene.thuis python3[3242]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/setup/data_directory.py", line 24, in create_app_data_directory
aug 10 13:32:42 mach1.hviaene.thuis python3[3242]:     _create_directory_if_not_exists(os.path.dirname(config.SQLITE_PATH))
aug 10 13:32:42 mach1.hviaene.thuis python3[3242]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/setup/data_directory.py", line 16, in _create_directory_if_not_exists
aug 10 13:32:42 mach1.hviaene.thuis python3[3242]:     os.makedirs(_path)
aug 10 13:32:42 mach1.hviaene.thuis python3[3242]:   File "/usr/lib64/python3.8/os.py", line 223, in makedirs
aug 10 13:32:42 mach1.hviaene.thuis python3[3242]:     mkdir(name, mode)
aug 10 13:32:42 mach1.hviaene.thuis python3[3242]: "Permission denied: '/var/lib/pgadmin'
aug 10 13:32:42 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Main process exited, code=exited, status=1/FAILURE
aug 10 13:32:42 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Failed with result 'exit-code'.

And I see on my system that the message "PermissionError: [Errno 13] " is misleading, since that folder does not exist.
What is going on here????
Last edited by doktor5000 on Aug 10th, '21, 17:18, edited 1 time in total.
Reason: added code tags
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby doktor5000 » Aug 10th, '21, 17:22

You did already report this as https://bugs.mageia.org/show_bug.cgi?id=29066 quite some time ago, why not mention this when crossposting here?

What happens if you create /var/lib/pgadmin and then restart pgadmin4 service ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby hviaene » Aug 10th, '21, 17:42

Created the folder manually, made its owner and group postgres and then:
Code: Select all
# systemctl  start pgadmin4
# systemctl -l status pgadmin4
● pgadmin4.service - pgAdmin4
     Loaded: loaded (/usr/lib/systemd/system/pgadmin4.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Tue 2021-08-10 17:35:30 CEST; 4s ago
    Process: 38066 ExecStart=/usr/bin/python3 /usr/lib/python3.8/site-packages/pgadmin4-web/pgAdmin4.py (code=exited, status=1/FAILURE)
   Main PID: 38066 (code=exited, status=1/FAILURE)
        CPU: 344ms

aug 10 17:35:30 mach1.hviaene.thuis python3[38066]:   File "<string>", line 341, in setup_db
aug 10 17:35:30 mach1.hviaene.thuis python3[38066]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/setup/data_directory.py", line 37, in create_app_data_directory
aug 10 17:35:30 mach1.hviaene.thuis python3[38066]:     _create_directory_if_not_exists(os.path.dirname(config.LOG_FILE))
aug 10 17:35:30 mach1.hviaene.thuis python3[38066]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/setup/data_directory.py", line 16, in _create_directory_if_not_exists
aug 10 17:35:30 mach1.hviaene.thuis python3[38066]:     os.makedirs(_path)
aug 10 17:35:30 mach1.hviaene.thuis python3[38066]:   File "/usr/lib64/python3.8/os.py", line 223, in makedirs
aug 10 17:35:30 mach1.hviaene.thuis python3[38066]:     mkdir(name, mode)
aug 10 17:35:30 mach1.hviaene.thuis python3[38066]: PermissionError: [Errno 13] Permission denied: '/var/log/pgadmin'
aug 10 17:35:30 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Main process exited, code=exited, status=1/FAILURE
aug 10 17:35:30 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Failed with result 'exit-code'.

Note that the first failing line is now 37 i.s.o. 24 and refers to config.LOG_FILE, not any more to config.SQLITE_PATH. There is nothing pgadmin-like in /var/log????
Last edited by doktor5000 on Aug 10th, '21, 17:54, edited 1 time in total.
Reason: added code tags
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby hviaene » Aug 10th, '21, 17:49

I took the freedom to also create manually /var/log/pagadmin and assign it to postgres, and the target moves again!!
Code: Select all
# systemctl -l status pgadmin4
● pgadmin4.service - pgAdmin4
     Loaded: loaded (/usr/lib/systemd/system/pgadmin4.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Tue 2021-08-10 17:44:20 CEST; 3s ago
    Process: 39354 ExecStart=/usr/bin/python3 /usr/lib/python3.8/site-packages/pgadmin4-web/pgAdmin4.py (code=exited, status=1/FAILURE)
   Main PID: 39354 (code=exited, status=1/FAILURE)
        CPU: 345ms

aug 10 17:44:20 mach1.hviaene.thuis python3[39354]:   File "<string>", line 341, in setup_db
aug 10 17:44:20 mach1.hviaene.thuis python3[39354]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/setup/data_directory.py", line 40, in create_app_data_directory
aug 10 17:44:20 mach1.hviaene.thuis python3[39354]:     _create_directory_if_not_exists(config.SESSION_DB_PATH)
aug 10 17:44:20 mach1.hviaene.thuis python3[39354]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/setup/data_directory.py", line 16, in _create_directory_if_not_exists
aug 10 17:44:20 mach1.hviaene.thuis python3[39354]:     os.makedirs(_path)
aug 10 17:44:20 mach1.hviaene.thuis python3[39354]:   File "/usr/lib64/python3.8/os.py", line 223, in makedirs
aug 10 17:44:20 mach1.hviaene.thuis python3[39354]:     mkdir(name, mode)
aug 10 17:44:20 mach1.hviaene.thuis python3[39354]: PermissionError: [Errno 13] Permission denied: '/var/lib/pgadmin/sessions'
aug 10 17:44:20 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Main process exited, code=exited, status=1/FAILURE
aug 10 17:44:20 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Failed with result 'exit-code'.

I checked, the access rights on /var/lib/pgadmin/ are still wth the postgres user.
Last edited by doktor5000 on Aug 10th, '21, 17:55, edited 1 time in total.
Reason: added code tags
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby doktor5000 » Aug 10th, '21, 17:56

Please, if you post output use the code-tags in the forum editor.

Regarding the last post, what about /var/lib/pgadmin/sessions - does it exist and to which user does it belong? It would be helpful if you could post output of
Code: Select all
ls -al /var/lib/pgadmin
as root if you don't check it yourself already.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby hviaene » Aug 11th, '21, 09:53

Code: Select all
# ls -al /var/lib/pgadmin
totaal 8
drwxrwxr-x  2 postgres postgres 4096 aug 10 17:32 ./
drwxr-xr-x 70 root     root     4096 aug 11 09:18 ../
Last edited by doktor5000 on Aug 11th, '21, 17:22, edited 1 time in total.
Reason: removed fullquote, added code tags
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby doktor5000 » Aug 11th, '21, 17:38

As you can see, you don't have a /var/lib/pgadmin/sessions so the error message is correct.
I've posted an interim workaround to https://bugs.mageia.org/show_bug.cgi?id=29066#c2

FWIW, the service that you want to start is only if you want to access pgadmin via web browser, it's not necessary for the regular standalone client.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17629
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby hviaene » Aug 13th, '21, 10:18

I applied the workaround, but still no joy.
Code: Select all
# ls -als /var/lib/pgadmin/
totaal 16
4 drwxrwxr-x  4 pgadmin pgadmin 4096 aug 13 10:09 ./
4 drwxr-xr-x 70 root    root    4096 aug 13 09:12 ../
4 drwxr-xr-x  2 pgadmin pgadmin 4096 aug 13 10:09 sessions/
4 drwxr-xr-x  2 pgadmin pgadmin 4096 aug 13 10:09 storage/

Code: Select all
# systemctl  start pgadmin4
# systemctl -l status pgadmin4
● pgadmin4.service - pgAdmin4
     Loaded: loaded (/usr/lib/systemd/system/pgadmin4.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Fri 2021-08-13 10:10:24 CEST; 11s ago
    Process: 28346 ExecStart=/usr/bin/python3 /usr/lib/python3.8/site-packages/pgadmin4-web/pgAdmin4.py (code=exited, status=1/FAILURE)
   Main PID: 28346 (code=exited, status=1/FAILURE)
        CPU: 323ms

aug 13 10:10:24 mach1.hviaene.thuis python3[28346]: Traceback (most recent call last):
aug 13 10:10:24 mach1.hviaene.thuis python3[28346]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgAdmin4.py", line 85, in <module>
aug 13 10:10:24 mach1.hviaene.thuis python3[28346]:     exec(open(file_quote(setup_py), 'r').read())
aug 13 10:10:24 mach1.hviaene.thuis python3[28346]:   File "<string>", line 409, in <module>
aug 13 10:10:24 mach1.hviaene.thuis python3[28346]:   File "<string>", line 341, in setup_db
aug 13 10:10:24 mach1.hviaene.thuis python3[28346]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/setup/data_directory.py", line 42, in create_app_data_directory
aug 13 10:10:24 mach1.hviaene.thuis python3[28346]:     os.chmod(config.SESSION_DB_PATH, 0o700)
aug 13 10:10:24 mach1.hviaene.thuis python3[28346]: PermissionError: [Errno 1] Operation not permitted: '/var/lib/pgadmin/sessions'
aug 13 10:10:24 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Main process exited, code=exited, status=1/FAILURE
aug 13 10:10:24 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Failed with result 'exit-code'.


And I don't get your suggestion to run pgadmin as standalone tool. I only have one executable pgAdmin4, and that straightaway drops me the error "Failed to launch the application server, server thread exiting".
Last edited by isadora on Aug 13th, '21, 10:25, edited 2 times in total.
Reason: Please place command-output between [CODE]-tags, to improve readability, thanks ahead!!! ;)
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby sturmvogel » Aug 13th, '21, 22:55

Your pgadmin group seems to don't have the correct file permissions according to several informations from web:
hviaene wrote:4 drwxr-xr-x 2 pgadmin pgadmin 4096 aug 13 10:09 sessions/
4 drwxr-xr-x 2 pgadmin pgadmin 4096 aug 13 10:09 storage/

PermissionError: [Errno 1] Operation not permitted: '/var/lib/pgadmin/sessions'


You should try
Code: Select all
chmod 0777 /var/lib/pgadmin -R
sturmvogel
 
Posts: 678
Joined: Jul 30th, '12, 00:39

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby hviaene » Aug 14th, '21, 09:56

Code: Select all
# chmod 0777 /var/lib/pgadmin -R
# systemctl  start pgadmin4
# systemctl -l status pgadmin4
● pgadmin4.service - pgAdmin4
     Loaded: loaded (/usr/lib/systemd/system/pgadmin4.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sat 2021-08-14 09:53:43 CEST; 6s ago
    Process: 24556 ExecStart=/usr/bin/python3 /usr/lib/python3.8/site-packages/pgadmin4-web/pgAdmin4.py (code=exited, status=1/FAILURE)
   Main PID: 24556 (code=exited, status=1/FAILURE)
        CPU: 321ms

aug 14 09:53:43 mach1.hviaene.thuis python3[24556]: Traceback (most recent call last):
aug 14 09:53:43 mach1.hviaene.thuis python3[24556]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgAdmin4.py", line 85, in <module>
aug 14 09:53:43 mach1.hviaene.thuis python3[24556]:     exec(open(file_quote(setup_py), 'r').read())
aug 14 09:53:43 mach1.hviaene.thuis python3[24556]:   File "<string>", line 409, in <module>
aug 14 09:53:43 mach1.hviaene.thuis python3[24556]:   File "<string>", line 341, in setup_db
aug 14 09:53:43 mach1.hviaene.thuis python3[24556]:   File "/usr/lib/python3.8/site-packages/pgadmin4-web/pgadmin/setup/data_directory.py", line 42, in create_app_data_directory
aug 14 09:53:43 mach1.hviaene.thuis python3[24556]:     os.chmod(config.SESSION_DB_PATH, 0o700)
aug 14 09:53:43 mach1.hviaene.thuis python3[24556]: PermissionError: [Errno 1] Operation not permitted: '/var/lib/pgadmin/sessions'
aug 14 09:53:43 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Main process exited, code=exited, status=1/FAILURE
aug 14 09:53:43 mach1.hviaene.thuis systemd[1]: pgadmin4.service: Failed with result 'exit-code'.

Code: Select all
# ls -als /var/lib/pgadmin/
totaal 16
4 drwxrwxrwx  4 pgadmin pgadmin 4096 aug 13 10:09 ./
4 drwxr-xr-x 70 root    root    4096 aug 14 09:21 ../
4 drwxrwxrwx  2 pgadmin pgadmin 4096 aug 13 10:09 sessions/
4 drwxrwxrwx  2 pgadmin pgadmin 4096 aug 13 10:09 storage/

Code: Select all
# ls -als /var/lib/pgadmin/storage/
totaal 8
4 drwxrwxrwx 2 pgadmin pgadmin 4096 aug 13 10:09 ./
4 drwxrwxrwx 4 pgadmin pgadmin 4096 aug 13 10:09 ../
Last edited by isadora on Aug 14th, '21, 10:32, edited 1 time in total.
Reason: Please place command-output between [CODE]-tags, to improve readability, thanks ahead!!! ;)
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby hviaene » Aug 14th, '21, 10:18

Checked /usr/lib/systemd/system/pgadmin4.service and that lists for the service as user and group apache, not pgadmin.
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby isadora » Aug 14th, '21, 10:33

Once more, it would be very much appreciated when command-output is published between [CODE]-tags, thanks ahead.
..........bird from paradise..........

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
—Antoine de Saint-Exupéry
User avatar
isadora
 
Posts: 2742
Joined: Mar 25th, '11, 16:03
Location: Netherlands

Re: Postgres 13 and pgadmin4 in Mageia 8

Postby hviaene » Aug 14th, '21, 11:29

Found something else strange: content of /etc/httpd/conf.d/pgadmin4.conf:
LoadModule wsgi_module modules/mod_wsgi.so
WSGIDaemonProcess pgadmin processes=1 threads=25
WSGIScriptAlias /pgadmin4 /usr/lib/python3.6/site-packages/pgadmin4-web/pgAdmin4.wsgi

<Directory /usr/lib/python3.6/site-packages/pgadmin4-web/>
etc......
Python reference should point to python3.8, 3.6 is not present here.
hviaene
 
Posts: 143
Joined: Oct 11th, '13, 10:41


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron