powa-team / powa-web

PoWA user interface
http://powa.readthedocs.io/
73 stars 31 forks source link

WSGIAdapter was removed from tornado in newer releases #168

Closed guruguruguru closed 1 year ago

guruguruguru commented 1 year ago

Hey,

I just wanted to reinstall powa on Oracle Linux 9 (coming from CentOS7). Here we get Tornado 6.1.0 which has removed WSGIAdapter (in this commit: https://github.com/tornadoweb/tornado/commit/70adb345e3dc8241f2b2438b804f19754b05f80f)

This leads to:

[Thu Apr 27 14:11:24.721799 2023] [wsgi:error] [pid 41362:tid 41548] [client 10.23.49.174:41586] mod_wsgi (pid=41362): Failed to exec Python script file '/usr/lib/python3.9/site-packages/powa/powa.wsgi'. [Thu Apr 27 14:11:24.722191 2023] [wsgi:error] [pid 41362:tid 41548] [client 10.23.49.174:41586] mod_wsgi (pid=41362): Exception occurred processing WSGI script '/usr/lib/python3.9/site-packages/powa/powa.wsgi'. [Thu Apr 27 14:11:24.723654 2023] [wsgi:error] [pid 41362:tid 41548] [client 10.23.49.174:41586] Traceback (most recent call last): [Thu Apr 27 14:11:24.723750 2023] [wsgi:error] [pid 41362:tid 41548] [client 10.23.49.174:41586] File "/usr/lib/python3.9/site-packages/powa/powa.wsgi", line 7, in <module> [Thu Apr 27 14:11:24.723783 2023] [wsgi:error] [pid 41362:tid 41548] [client 10.23.49.174:41586] from tornado.wsgi import WSGIAdapter [Thu Apr 27 14:11:24.723838 2023] [wsgi:error] [pid 41362:tid 41548] [client 10.23.49.174:41586] ImportError: cannot import name 'WSGIAdapter' from 'tornado.wsgi' (/usr/lib64/python3.9/site-packages/tornado/wsgi.py)

Is there any workaround?

Thanks, Dennis

guruguruguru commented 1 year ago

More on the Topic: https://github.com/tornadoweb/tornado/issues/2792

rjuju commented 1 year ago

Hi,

I guess the only option is to rely on tornado web server rather than a real http server.

guruguruguru commented 1 year ago

@rjuju Okay thanks, then i will have to adjust our deployment.

rjuju commented 1 year ago

I had a look at the PGDG repositories, and as far as I can see they always relied on tornado webserver (via powa-web.py) to automatically host the UI.

If that help you can look at the service definition in the repo, for instance: https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=rpm/redhat/main/non-common/powa/main/powa-15.service;h=9f4021c9cb30390cb5beb3a6245b3b4da5c56a22;hb=HEAD

guruguruguru commented 1 year ago

Hey @rjuju ,

I know that doesn fit here: but I think the main reason why we used httpd/mod_wsgi was SSL/TLS. Is there no option to use SSL/TLS with powa-web standalone?

rjuju commented 1 year ago

It's related to powa-web so it does fit here :)

There was actually some people asking for that feature and I actually implemented it, see https://github.com/powa-team/powa-web/issues/140. I just rebased the "https" branch and pushed it. If you can test it and confirm that it works I will be happy to merge it and do a quick release. If you need additional features I will also be happy to take care of it :)

rjuju commented 1 year ago

For the archives sake, documentation on various possiblities for powa-web deployment has been done (https://github.com/powa-team/powa/commit/169f0d431d463a0f9d7daa1ce3dc9debb81937ca) and support for https has also been commit to the main branch (see discussion at https://github.com/powa-team/powa-web/issues/140 and https://github.com/powa-team/powa-web/commit/7ce669da37fa8493dc431827b1d45757d6ef2227).

Documentation has also been updated to mention that wsgi has been removed from tornado 6.1.0.

Everything discussed in this issue has now been taken core of so I'm closing it. Feel free to reopen it or open a new one if needed!

rjuju commented 1 year ago

I also forgot to mention that this is available in the just released version 4.1.4: https://github.com/powa-team/powa-web/releases/tag/4.1.4