[Patch] - Bug #7580 - uwsgi + nginx db backup does not work - Mailing list pgadmin-hackers

From Yogesh Mahajan
Subject [Patch] - Bug #7580 - uwsgi + nginx db backup does not work
Date
Msg-id CAMa=N=Oxf8OdCxEXskDzemNCdoXjDb00P000BCZ+Jyx_VH481Q@mail.gmail.com
Whole thread Raw
Responses Re: [Patch] - Bug #7580 - uwsgi + nginx db backup does not work  (Akshay Joshi <akshay.joshi@enterprisedb.com>)
List pgadmin-hackers
Hello,

Please find the attached path which fixes the error while taking backup using pgadmin configured using uWSGI & NGINX.
Actually error is - 
2022-09-01 15:17:29,897: ERROR  pgadmin:        preexec_fn not supported within subinterpreters
Traceback (most recent call last):  File "/opt/pgadmin/venv/lib/python3.8/site-packages/pgadmin4/pgadmin/tools/backup/__init__.py", line 451, in create_backup_objects_job    p.start()  File "/opt/pgadmin/venv/lib/python3.8/site-packages/pgadmin4/pgadmin/misc/bgprocess/processes.py", line 336, in start    p = self.get_process_output(cmd, env)  File "/opt/pgadmin/venv/lib/python3.8/site-packages/pgadmin4/pgadmin/misc/bgprocess/processes.py", line 374, in get_process_output    p = Popen(  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__    self._execute_child(args, executable, preexec_fn, close_fds,  File "/usr/lib/python3.8/subprocess.py", line 1639, in _execute_child    self.pid = _posixsubprocess.fork_exec(
RuntimeError: preexec_fn not supported within subinterpreters
Which is causing due to change in version 3.8 - 'The preexec_fn parameter is no longer supported in subinterpreters.'. (Refer this link)


I have tested the attached patch with dev env on Mac & centos platform. Also tested with installed pgadmin version with pip by manipulating corresponding files.


Thanks,
Yogesh Mahajan
EnterpriseDB
Attachment

pgadmin-hackers by date:

Previous
From: Akshay Joshi
Date:
Subject: Re: [pgAdmin 4][Patch]: #7314 - psycopg2 to psycopg3 migration
Next
From: Akshay Joshi
Date:
Subject: pgAdmin 4 commit: Fixed an issue where backup does not work due to para