[Patch] - Bug #7580 - uwsgi + nginx db backup does not work

From: Yogesh Mahajan <yogesh(dot)mahajan(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: [Patch] - Bug #7580 - uwsgi + nginx db backup does not work
Date: 2022-09-02 07:20:58
Message-ID: CAMa=N=Oxf8OdCxEXskDzemNCdoXjDb00P000BCZ+Jyx_VH481Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
<https://docs.python.org/3/library/subprocess.html>)

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 Content-Type Size
RM_7580_v1.patch application/octet-stream 1.2 KB

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Akshay Joshi 2022-09-02 07:43:32 pgAdmin 4 commit: Fixed an issue where backup does not work due to para
Previous Message Akshay Joshi 2022-09-01 07:31:18 Re: [pgAdmin 4][Patch]: #7314 - psycopg2 to psycopg3 migration