<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>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).</p>
<p>My deb repo ships 2.6.1
(<a class="moz-txt-link-freetext" href="https://build.opensuse.org/package/show/home:sebix:intelmq/python-hug">https://build.opensuse.org/package/show/home:sebix:intelmq/python-hug</a>)
which also comes with CORSMiddleware in
/usr/lib/python3/dist-packages/hug/middleware.py<br>
</p>
<p>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?</p>
<p>Sebastian<br>
</p>
<div class="moz-cite-prefix">On 3/25/22 3:05 PM, Sebix wrote:<br>
</div>
<blockquote type="cite"
cite="mid:9151a551-cc92-fe66-6e64-dcd60951ab1e@sebix.at">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<p>Dear Christian,<br>
</p>
<p>Can you please check if hug-middleware-cors is installed and if
not, if installing <a class="moz-txt-link-freetext"
href="https://pypi.org/project/hug-middleware-cors/"
moz-do-not-send="true">https://pypi.org/project/hug-middleware-cors/</a>
via apt or pip solves your issue?</p>
<p>Regarding the (solved) wsgi problem: intelmq-api actually
recommends the libapache2-mod-wsgi-py3 package, see:
<a class="moz-txt-link-freetext"
href="https://github.com/certtools/intelmq-api/blob/9f8513bb0268144b62522e67bee3c290eb6eac8a/debian/control#L27"
moz-do-not-send="true">https://github.com/certtools/intelmq-api/blob/9f8513bb0268144b62522e67bee3c290eb6eac8a/debian/control#L27</a></p>
<p>kind regards<br>
Sebastian<br>
</p>
<div class="moz-cite-prefix">On 3/25/22 2:49 PM, Harbich,
Christian wrote:<br>
</div>
<blockquote type="cite"
cite="mid:04bc7650b04845ceac9b23d55c9cc76d@gisa.de">
<pre class="moz-quote-pre" wrap="">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: <a class="moz-txt-link-freetext" href="https://github.com/certtools/intelmq-api/issues/28" moz-do-not-send="true">https://github.com/certtools/intelmq-api/issues/28</a> 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 <a class="moz-txt-link-rfc2396E" href="mailto:intelmq-users-bounces@lists.cert.at" moz-do-not-send="true"><intelmq-users-bounces@lists.cert.at></a> Im Auftrag von Bernhard Reiter
Gesendet: Freitag, 25. März 2022 13:42
An: <a class="moz-txt-link-abbreviated" href="mailto:intelmq-users@lists.cert.at" moz-do-not-send="true">intelmq-users@lists.cert.at</a>
Betreff: Re: [IntelMQ-users] Installation problems intelmq and manager
Hi Christian,
Am Freitag, 25. März 2022, 08:20:17 CET schrieb Harbich, Christian:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">root@server:~# dpkg -L intelmq-api
</pre>
</blockquote>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">The file /usr/lib/python3/dist-packages/intelmq_api/serve.py is listed
but the error message said "No module named intelmq_api.serve"
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">which means that the python version called by this Apache module does not find it.
Try installing
<a class="moz-txt-link-freetext" href="https://packages.ubuntu.com/bionic/libapache2-mod-wsgi-py3" moz-do-not-send="true">https://packages.ubuntu.com/bionic/libapache2-mod-wsgi-py3</a>
and removing libapache2-mod-wsgi
as this version is still be compiled with python2. ;) Bernhard
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
</blockquote>
</body>
</html>