Hi Guys,
I followed the installation guide and run into a problem while using the intelmq-api to get a login token as mentioned here: https://intelmq.readthedocs.io/en/maintenance/user/intelmq-api.html
I executed curl --location --request POST http://localhost/intelmq/v1/api/login/%5C --header "Content-Type: application/x-www-form-urlencoded"\ --data-urlencode "username=$username"\ --data-urlencode "password=$password"
And got the answer
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL was not found on this server.</p> <hr> <address>Apache/2.4.29 (Ubuntu) Server at localhost Port 80</address> </body></html>
I'm running on Ubuntu 18.04 and used the native packages which I downloaded manually and installed them using dpkg. I also noticed that my apache2 only got a conf file for intelmq-api.conf ... shouldnt there be one for the intelmq itself when the curl statement on top is called?
PS: I'm new to intelmq and also not an Ubuntu specialist so please be gentle :D
Cheers Chris
Aufsichtsratsvorsitzender: Norbert Rotter Geschäftsführung: Heino Feige, Michael Krüger Sitz der Gesellschaft: Halle/Saale Registergericht: Amtsgericht Stendal | Handelsregister-Nr. HRB 208414 UST-ID-Nr. DE 158253683
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Empfänger sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail oder des Inhalts dieser Mail sind nicht gestattet. Diese Kommunikation per E-Mail ist nicht gegen den Zugriff durch Dritte geschützt. Die GISA GmbH haftet ausdrücklich nicht für den Inhalt und die Vollständigkeit von E-Mails und den gegebenenfalls daraus entstehenden Schaden. Sollte trotz der bestehenden Viren-Schutzprogramme durch diese E-Mail ein Virus in Ihr System gelangen, so haftet die GISA GmbH - soweit gesetzlich zulässig - nicht für die hieraus entstehenden Schäden.
Hi Chris,
Am Mittwoch, 23. März 2022, 16:36:18 CET schrieb Harbich, Christian:
https://intelmq.readthedocs.io/en/maintenance/user/intelmq-api.html
(haven't personally set this version up recently myself, but maybe I can give hints for you to analyse further.)
curl --location --request POST http://localhost/intelmq/v1/api/login/%5C
[..]
<title>404 Not Found</title>
I'm running on Ubuntu 18.04 and used the native packages which I downloaded manually and installed them using dpkg.
I also noticed that my apache2 only got a conf file for intelmq-api.conf ... shouldnt there be one for the intelmq itself when the curl statement on top is called?
If this is the file you are looking at https://github.com/certtools/intelmq-api/blob/develop/contrib/api-apache.con... WSGIScriptAlias /intelmq /usr/lib/python3/dist-packages/intelmq_api/intelmq- api.wsgi it seems that all with the prefix path "/intelmq" is passed in to the wsgi Skript. (You should check your apache logs to see if there are other errors coming from this wsgi or elsewhere.)
So next stop https://github.com/certtools/intelmq-api/blob/develop/intelmq_api/intelmq-ap... and then it goes into https://github.com/certtools/intelmq-api/blob/develop/intelmq_api/serve.py where it initialises and goes to https://github.com/certtools/intelmq-api/blob/develop/intelmq_api/api.py where it should end up at https://github.com/certtools/intelmq-api/blob/ 9f8513bb0268144b62522e67bee3c290eb6eac8a/intelmq_api/api.py#L186 @hug.post("/api/login", versions=1) somehow not all of these connections work, again I'd start at the apache configuration and logs, possibily adding debugging infos there for calling the wsgi Skript.
Best Bernhard
Am Mittwoch, 23. März 2022, 17:12:47 CET schrieb Bernhard Reiter:
I'm running on Ubuntu 18.04
BTW: any reason for not using 20.04?
Hi Bernhard,
I set the log level to debug as no error was shown before and after that I found the following line:
[Thu Mar 24 09:46:19.503761 2022] [core:info] [pid 23067] [client 127.0.0.1:43270] AH00128: File does not exist: /var/www/html/intelmq/v1/api/login/
And indeed there is no intelmq directory under /var/www/html. Shouldn't the installer create that folder if needed? I couldn't find a step in the docu neither which pointed out that this must be created.
The following directories with the name "intelmq" exist on my system: /run/intelmq /usr/share/doc/intelmq /usr/lib/python3/dist-packages/intelmq /etc/intelmq /var/lib/intelmq /var/log/intelmq
I also couldn't find anything like v1/api/ on the whole server and I think thats the main problem here?!
My intelmq-api.wsgi looks like the one on github:
""" WSGI file for intelmq-api
SPDX-FileCopyrightText: 2020 Birger Schacht SPDX-License-Identifier: AGPL-3.0-or-later """ import os
def application (environ, start_response): if 'INTELMQ_API_CONFIG' in environ: os.environ['INTELMQ_API_CONFIG'] = environ['INTELMQ_API_CONFIG'] from intelmq_api.serve import __hug_wsgi__ return __hug_wsgi__(environ, start_response)
and I also see the environment variable is set INTELMQ_API_CONFIG=/etc/intelmq/api-config.json
Regards Chris
-----Ursprüngliche Nachricht----- Von: IntelMQ-users intelmq-users-bounces@lists.cert.at Im Auftrag von Bernhard Reiter Gesendet: Mittwoch, 23. März 2022 17:13 An: intelmq-users@lists.cert.at Betreff: Re: [IntelMQ-users] Installation problems intelmq and manager
Hi Chris,
Am Mittwoch, 23. März 2022, 16:36:18 CET schrieb Harbich, Christian:
https://intelmq.readthedocs.io/en/maintenance/user/intelmq-api.html
(haven't personally set this version up recently myself, but maybe I can give hints for you to analyse further.)
curl --location --request POST http://localhost/intelmq/v1/api/login/%5C
[..]
<title>404 Not Found</title>
I'm running on Ubuntu 18.04 and used the native packages which I downloaded manually and installed them using dpkg.
I also noticed that my apache2 only got a conf file for intelmq-api.conf ... shouldnt there be one for the intelmq itself when the curl statement on top is called?
If this is the file you are looking at https://github.com/certtools/intelmq-api/blob/develop/contrib/api-apache.con... WSGIScriptAlias /intelmq /usr/lib/python3/dist-packages/intelmq_api/intelmq- api.wsgi it seems that all with the prefix path "/intelmq" is passed in to the wsgi Skript. (You should check your apache logs to see if there are other errors coming from this wsgi or elsewhere.)
So next stop https://github.com/certtools/intelmq-api/blob/develop/intelmq_api/intelmq-ap... and then it goes into https://github.com/certtools/intelmq-api/blob/develop/intelmq_api/serve.py where it initialises and goes to https://github.com/certtools/intelmq-api/blob/develop/intelmq_api/api.py where it should end up at https://github.com/certtools/intelmq-api/blob/ 9f8513bb0268144b62522e67bee3c290eb6eac8a/intelmq_api/api.py#L186 @hug.post("/api/login", versions=1) somehow not all of these connections work, again I'd start at the apache configuration and logs, possibily adding debugging infos there for calling the wsgi Skript.
Best Bernhard
Hi Christian,
Am Donnerstag, 24. März 2022, 11:34:01 CET schrieb Harbich, Christian:
127.0.0.1:43270] AH00128: File does not exist: /var/www/html/intelmq/v1/api/login/
I also couldn't find anything like v1/api/ on the whole server and I think thats the main problem here?!
The patch "v1/api/login" is virutal, so it does not reside on the file system, but instead is defined in the wsgi application (in the files I've outlined in my first answer.)
My intelmq-api.wsgi looks like the one on github: """ WSGI file for intelmq-api
But this is not called, (assuming from the error message) so the problem is likely to be one step earlier in the Apache configuration.
Somehow the Apache wsgi configuration seems not to be active on that port or domain that you are calling. Maybe you have a colleague with some Apache experience that can help you to track this down faster.
If this is the file you are looking at https://github.com/certtools/intelmq-api/blob/develop/contrib/api-apache.con...
^ something like this should be in the right place, machting your machine and being activated. General Apache docs for your version may help to find out what this all should do.
Regards Bernhard
Hi Bernhard,
thanks for your reply!
I found out the I dont have installed the wsgi module for apache2. After installing libapache2-mod-wsgi I now get a 500 back from the curl and the following lines appear in the error log of apache
[Thu Mar 24 16:04:46.595662 2022] [wsgi:info] [pid 6604] [client 127.0.0.1:35488] mod_wsgi (pid=6604, process='', application=''): Loading WSGI script '/usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi'. [Thu Mar 24 16:04:46.596093 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] mod_wsgi (pid=6604): Exception occurred processing WSGI script '/usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi'. [Thu Mar 24 16:04:46.596121 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] Traceback (most recent call last): [Thu Mar 24 16:04:46.596148 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] File "/usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi", line 11, in application [Thu Mar 24 16:04:46.596224 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] from intelmq_api.serve import __hug_wsgi__ [Thu Mar 24 16:04:46.596253 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] ImportError: No module named intelmq_api.serve
I tried to find out how I can install the intelmq_api.serve module but I didn't find out how.
Btw it was not mentioned in the docu that the apache needs the wsgi module. Maybe this could be added in the prerequirement section or I'm the only one not knowing that this needs to be installed 😊.
Grüße Christian
Tel.: 7274
-----Ursprüngliche Nachricht----- Von: IntelMQ-users intelmq-users-bounces@lists.cert.at Im Auftrag von Bernhard Reiter Gesendet: Donnerstag, 24. März 2022 13:13 An: intelmq-users@lists.cert.at Cc: Harbich, Christian Christian.Harbich@gisa.de Betreff: Re: [IntelMQ-users] Installation problems intelmq and manager
Hi Christian,
Am Donnerstag, 24. März 2022, 11:34:01 CET schrieb Harbich, Christian:
127.0.0.1:43270] AH00128: File does not exist: /var/www/html/intelmq/v1/api/login/
I also couldn't find anything like v1/api/ on the whole server and I think thats the main problem here?!
The patch "v1/api/login" is virutal, so it does not reside on the file system, but instead is defined in the wsgi application (in the files I've outlined in my first answer.)
My intelmq-api.wsgi looks like the one on github: """ WSGI file for intelmq-api
But this is not called, (assuming from the error message) so the problem is likely to be one step earlier in the Apache configuration.
Somehow the Apache wsgi configuration seems not to be active on that port or domain that you are calling. Maybe you have a colleague with some Apache experience that can help you to track this down faster.
If this is the file you are looking at https://github.com/certtools/intelmq-api/blob/develop/contrib/api-apac he.conf
^ something like this should be in the right place, machting your machine and being activated. General Apache docs for your version may help to find out what this all should do.
Regards Bernhard
Hi Christian,
Am Donnerstag, 24. März 2022, 17:05:51 CET schrieb Harbich, Christian:
Thu Mar 24 16:04:46.596148 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] File "/usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi", line 11, in application [Thu Mar 24 16:04:46.596224 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] from intelmq_api.serve import __hug_wsgi__ [Thu Mar 24 16:04:46.596253 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] ImportError: No module named intelmq_api.serve
I tried to find out how I can install the intelmq_api.serve module but I didn't find out how.
it is part of https://github.com/certtools/intelmq-api/tree/develop/intelmq_api (in particular it is file https://github.com/certtools/intelmq-api/blob/develop/intelmq_api/serve.py)
So the /usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi has to find this python module, when it is called from Apache (and the Apache environment). There are many methods how to potentially achieve this. Remembered correctly, you have used the native packages. What does dpkg -L intelmq-api say?
Btw it was not mentioned in the docu that the apache needs the wsgi module. Maybe this could be added in the prerequirement section
Ideally, if you have used the packages, it could have been a dependency. Otherwise it would be cool if you'd create a pull request with an improvement of the documentation where you would have expected the hint.
Thanks! Bernhard
Good Morning,
this ist he result you asked for:
root@server:~# dpkg -L intelmq-api /. /etc /etc/apache2 /etc/apache2/conf-available /etc/intelmq /etc/intelmq/api-apache.conf /etc/intelmq/api-config.json /etc/intelmq/api-sudoers.conf /etc/intelmq/manager /etc/intelmq/manager/positions.conf /etc/sudoers.d /etc/sudoers.d/01_intelmq-api /usr /usr/bin /usr/bin/intelmq-api-adduser /usr/lib /usr/lib/python3 /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages/intelmq_api /usr/lib/python3/dist-packages/intelmq_api/__init__.py /usr/lib/python3/dist-packages/intelmq_api/api.py /usr/lib/python3/dist-packages/intelmq_api/config.py /usr/lib/python3/dist-packages/intelmq_api/files.py /usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi /usr/lib/python3/dist-packages/intelmq_api/runctl.py /usr/lib/python3/dist-packages/intelmq_api/serve.py /usr/lib/python3/dist-packages/intelmq_api/session.py /usr/lib/python3/dist-packages/intelmq_api/util.py /usr/lib/python3/dist-packages/intelmq_api/version.py /usr/lib/python3/dist-packages/intelmq_api-3.0.1.egg-info /usr/lib/python3/dist-packages/intelmq_api-3.0.1.egg-info/PKG-INFO /usr/lib/python3/dist-packages/intelmq_api-3.0.1.egg-info/dependency_links.txt /usr/lib/python3/dist-packages/intelmq_api-3.0.1.egg-info/requires.txt /usr/lib/python3/dist-packages/intelmq_api-3.0.1.egg-info/top_level.txt /usr/share /usr/share/dbconfig-common /usr/share/dbconfig-common/data /usr/share/dbconfig-common/data/intelmq-api /usr/share/dbconfig-common/data/intelmq-api/install /usr/share/dbconfig-common/data/intelmq-api/install/sqlite3 /usr/share/doc /usr/share/doc/intelmq-api /usr/share/doc/intelmq-api/changelog.Debian.gz /usr/share/doc/intelmq-api/copyright /etc/apache2/conf-available/intelmq-api.conf
The file /usr/lib/python3/dist-packages/intelmq_api/serve.py is listed but the error message said "No module named intelmq_api.serve"
Cheers Chris
-----Ursprüngliche Nachricht----- Von: IntelMQ-users intelmq-users-bounces@lists.cert.at Im Auftrag von Bernhard Reiter Gesendet: Donnerstag, 24. März 2022 19:11 An: intelmq-users@lists.cert.at Betreff: Re: [IntelMQ-users] Installation problems intelmq and manager
Hi Christian,
Am Donnerstag, 24. März 2022, 17:05:51 CET schrieb Harbich, Christian:
Thu Mar 24 16:04:46.596148 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] File "/usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi", line 11, in application [Thu Mar 24 16:04:46.596224 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] from intelmq_api.serve import __hug_wsgi__ [Thu Mar 24 16:04:46.596253 2022] [wsgi:error] [pid 6604] [client 127.0.0.1:35488] ImportError: No module named intelmq_api.serve
I tried to find out how I can install the intelmq_api.serve module but I didn't find out how.
it is part of https://github.com/certtools/intelmq-api/tree/develop/intelmq_api (in particular it is file https://github.com/certtools/intelmq-api/blob/develop/intelmq_api/serve.py)
So the /usr/lib/python3/dist-packages/intelmq_api/intelmq-api.wsgi has to find this python module, when it is called from Apache (and the Apache environment). There are many methods how to potentially achieve this. Remembered correctly, you have used the native packages. What does dpkg -L intelmq-api say?
Btw it was not mentioned in the docu that the apache needs the wsgi module. Maybe this could be added in the prerequirement section
Ideally, if you have used the packages, it could have been a dependency. Otherwise it would be cool if you'd create a pull request with an improvement of the documentation where you would have expected the hint.
Thanks! Bernhard
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
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
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
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