Digging a bit deeper - and sorry for just another mail from me - Ubuntu itself ships python3-hug version 2.4.1 - which is too old for us -, but it also comes with CORSMiddleware (file /usr/lib/python3/dist-packages/hug/middleware.py).
My deb repo ships 2.6.1 (https://build.opensuse.org/package/show/home:sebix:intelmq/python-hug) which also comes with CORSMiddleware in /usr/lib/python3/dist-packages/hug/middleware.py
So can you please check which version of hug is installed, from which repository and if that file exists with the CORSMiddleware class in there?
Sebastian
On 3/25/22 3:05 PM, Sebix wrote:
Dear Christian,
Can you please check if hug-middleware-cors is installed and if not, if installing https://pypi.org/project/hug-middleware-cors/ via apt or pip solves your issue?
Regarding the (solved) wsgi problem: intelmq-api actually recommends the libapache2-mod-wsgi-py3 package, see: https://github.com/certtools/intelmq-api/blob/9f8513bb0268144b62522e67bee3c2...
kind regards Sebastian
On 3/25/22 2:49 PM, Harbich, Christian wrote:
Hi, I got one step further. Now I get the following error:
[Fri Mar 25 14:45:25.398585 2022] [wsgi:error] [pid 12422] [client 127.0.0.1:48246] Loading config from /etc/intelmq/api-config.json [Fri Mar 25 14:45:25.398851 2022] [wsgi:error] [pid 12422] [client 127.0.0.1:48246] mod_wsgi (pid=12422): Exception occurred processing WSGI script '/usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi'. [Fri Mar 25 14:45:25.399160 2022] [wsgi:error] [pid 12422] [client 127.0.0.1:48246] Traceback (most recent call last): [Fri Mar 25 14:45:25.399196 2022] [wsgi:error] [pid 12422] [client 127.0.0.1:48246] File "/usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi", line 11, in application [Fri Mar 25 14:45:25.399205 2022] [wsgi:error] [pid 12422] [client 127.0.0.1:48246] from intelmq_api.serve import __hug_wsgi__ [Fri Mar 25 14:45:25.399218 2022] [wsgi:error] [pid 12422] [client 127.0.0.1:48246] File "/usr/lib/python3/dist-packages/intelmq_api/serve.py", line 31, in <module> [Fri Mar 25 14:45:25.399225 2022] [wsgi:error] [pid 12422] [client 127.0.0.1:48246] api.http.add_middleware(hug.middleware.CORSMiddleware(api, allow_origins=api_config.allow_origins)) [Fri Mar 25 14:45:25.399254 2022] [wsgi:error] [pid 12422] [client 127.0.0.1:48246] AttributeError: module 'hug.middleware' has no attribute 'CORSMiddleware'
I found this post: https://github.com/certtools/intelmq-api/issues/28 and tried apt update && apt upgrade && systemctl restart apache2 but that didn't work for me. The problem is, that we use our own repo which is managed by our linux administrators. Can I apply the fix manually? Otherwise wich package has to be updated in our repo to get it working?
Cheers Christian
-----Ursprüngliche Nachricht----- Von: IntelMQ-users intelmq-users-bounces@lists.cert.at Im Auftrag von Bernhard Reiter Gesendet: Freitag, 25. März 2022 13:42 An: intelmq-users@lists.cert.at Betreff: Re: [IntelMQ-users] Installation problems intelmq and manager
Hi Christian,
Am Freitag, 25. März 2022, 08:20:17 CET schrieb Harbich, Christian:
root@server:~# dpkg -L intelmq-api The file /usr/lib/python3/dist-packages/intelmq_api/serve.py is listed but the error message said "No module named intelmq_api.serve"
which means that the python version called by this Apache module does not find it.
Try installing https://packages.ubuntu.com/bionic/libapache2-mod-wsgi-py3 and removing libapache2-mod-wsgi as this version is still be compiled with python2. ;) Bernhard