Обсуждение: [pgAdmin4][PATCH] Error running restore/backup etc utilities in WSGI mode
[pgAdmin4][PATCH] Error running restore/backup etc utilities in WSGI mode
[Mon Apr 03 05:22:26.641789 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] File "/opt/web/pgadmin/utils/driver/psycopg2/__init__.py", line 1664, in utility
[Mon Apr 03 05:22:26.641818 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] return self.server_cls.utility(operation, self.sversion)
[Mon Apr 03 05:22:26.641883 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] File "/opt/web/pgadmin/browser/server_groups/servers/types.py", line 120, in utility
[Mon Apr 03 05:22:26.641921 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] bin_path = self.utility_path.get().replace("$DIR", os.path.dirname(sys.modules['__main__'].__file__))
[Mon Apr 03 05:22:26.641958 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] AttributeError: 'module' object has no attribute '__file__'
In WSGI, we get sys.modules['__main__'] as built-in object.
'__main__': <module '__main__' (built-in)>,
'pgadmin.browser.server_groups.servers.databases.schemas.tables.rules': <module 'pgadmin.browser.server_groups.servers.databases.schemas.tables.rules' from '/opt/PEM/server/share/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/__init__.py'>,
Вложения
Hi,PFA minor patch to fix the issue where user gets error when try to run backup/restore etc in pgAdmin4 WSGI mode.Error in Apache log:
[Mon Apr 03 05:22:26.641789 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] File "/opt/web/pgadmin/utils/
driver/psycopg2/__init__.py", line 1664, in utility
[Mon Apr 03 05:22:26.641818 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] return self.server_cls.utility(operation, self.sversion)
[Mon Apr 03 05:22:26.641883 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] File "/opt/web/pgadmin/browser/server_groups/servers/types. py", line 120, in utility
[Mon Apr 03 05:22:26.641921 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] bin_path = self.utility_path.get().replace("$DIR", os.path.dirname(sys.modules['_ _main__'].__file__))
[Mon Apr 03 05:22:26.641958 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] AttributeError: 'module' object has no attribute '__file__'
In WSGI, we get sys.modules['__main__'] as built-in object.
'__main__': <module '__main__' (built-in)>,
'pgadmin.browser.server_groups.servers.databases. schemas.tables.rules': <module 'pgadmin.browser.server_ groups.servers.databases. schemas.tables.rules' from '/opt/PEM/server/share/web/ pgadmin/browser/server_groups/ servers/databases/schemas/ tables/rules/__init__.py'>, --Regards,
--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
On Mon, Apr 3, 2017 at 6:33 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
Thanks - committed!
On Mon, Apr 3, 2017 at 6:23 PM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: --Hi,PFA minor patch to fix the issue where user gets error when try to run backup/restore etc in pgAdmin4 WSGI mode.Error in Apache log:
[Mon Apr 03 05:22:26.641789 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] File "/opt/web/pgadmin/utils/driver
/psycopg2/__init__.py", line 1664, in utility
[Mon Apr 03 05:22:26.641818 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] return self.server_cls.utility(operation, self.sversion)
[Mon Apr 03 05:22:26.641883 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] File "/opt/web/pgadmin/browser/server_groups/servers/types.py", line 120, in utility
[Mon Apr 03 05:22:26.641921 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] bin_path = self.utility_path.get().replace("$DIR", os.path.dirname(sys.modules['_ _main__'].__file__))
[Mon Apr 03 05:22:26.641958 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] AttributeError: 'module' object has no attribute '__file__'
In WSGI, we get sys.modules['__main__'] as built-in object.
'__main__': <module '__main__' (built-in)>,
'pgadmin.browser.server_groups.servers.databases.schemas. tables.rules': <module 'pgadmin.browser.server_groups .servers.databases.schemas. tables.rules' from '/opt/PEM/server/share/web/pga dmin/browser/server_groups/ser vers/databases/schemas/tables/ rules/__init__.py'>, --Regards,
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
On Mon, Apr 3, 2017 at 6:33 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com
> wrote: Thanks - committed!Committed a lot better solution.User can set '$DIR' in the bin_path.We needed to check existence of the '__file__' attribute in the '__main__' module, when running as a WSGI application.
On Mon, Apr 3, 2017 at 6:23 PM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: --Hi,PFA minor patch to fix the issue where user gets error when try to run backup/restore etc in pgAdmin4 WSGI mode.Error in Apache log:
[Mon Apr 03 05:22:26.641789 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] File "/opt/web/pgadmin/utils/driver
/psycopg2/__init__.py", line 1664, in utility
[Mon Apr 03 05:22:26.641818 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] return self.server_cls.utility(operation, self.sversion)
[Mon Apr 03 05:22:26.641883 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] File "/opt/web/pgadmin/browser/server_groups/servers/types.py", line 120, in utility
[Mon Apr 03 05:22:26.641921 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] bin_path = self.utility_path.get().replace("$DIR", os.path.dirname(sys.modules['_ _main__'].__file__))
[Mon Apr 03 05:22:26.641958 2017] [wsgi:error] [pid 72351:tid 140303938864896] [remote ::1:28430] AttributeError: 'module' object has no attribute '__file__'
In WSGI, we get sys.modules['__main__'] as built-in object.
'__main__': <module '__main__' (built-in)>,
'pgadmin.browser.server_groups.servers.databases.schemas.tab les.rules': <module 'pgadmin.browser.server_groups .servers.databases.schemas.tab les.rules' from '/opt/PEM/server/share/web/pga dmin/browser/server_groups/ser vers/databases/schemas/tables/ rules/__init__.py'>, --Regards,
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers