certtools / intelmq-api

FastAPI-based API for the IntelMQ project
https://docs.intelmq.org/latest/user/api/
1 stars 7 forks source link

Login issue to intelmq-manager/api [ IntelMQ 3.1.0, IntelMQ API 3.0.1, IntelMQ Manager 3.0.1] #43

Closed kodebrain closed 1 year ago

kodebrain commented 1 year ago
tail -f /var/log/apache2/error.log
[Tue Feb 14 15:34:42.612521 2023] [wsgi:error] [pid 724:tid 139824119928384] [client 192.168.1.248:5043]   File "/usr/lib/python3/dist-packages/intelmq_api/serve.py", line 31, in <module>, referer: http://192.168.1.143/intelmq-manager/
[Tue Feb 14 15:34:42.612525 2023] [wsgi:error] [pid 724:tid 139824119928384] [client 192.168.1.248:5043]     api.http.add_middleware(hug.middleware.CORSMiddleware(api, allow_origins=api_config.allow_origins)), referer: http://192.168.1.143/intelmq-manager/
[Tue Feb 14 15:34:42.612530 2023] [wsgi:error] [pid 724:tid 139824119928384] [client 192.168.1.248:5043]   File "falcon/middleware.py", line 39, in falcon.middleware.CORSMiddleware.__init__, referer: http://192.168.1.143/intelmq-manager/
[Tue Feb 14 15:34:42.612549 2023] [wsgi:error] [pid 724:tid 139824119928384] [client 192.168.1.248:5043] TypeError: __init__() got multiple values for keyword argument 'allow_origins', referer: http://192.168.1.143/intelmq-manager/
[Tue Feb 14 15:46:19.172063 2023] [mpm_event:notice] [pid 717:tid 139824275429248] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Tue Feb 14 15:46:19.184567 2023] [mpm_event:notice] [pid 717:tid 139824275429248] AH00489: Apache/2.4.52 (Ubuntu) mod_wsgi/4.9.0 Python/3.10 configured -- resuming normal operations
[Tue Feb 14 15:46:19.184573 2023] [core:notice] [pid 717:tid 139824275429248] AH00094: Command line: '/usr/sbin/apache2'
[Tue Feb 14 15:47:38.737702 2023] [wsgi:error] [pid 2049:tid 139824253675072] [client 192.168.1.248:5082] Loading config from /etc/intelmq/api-config.json, referer: http://192.168.1.143/intelmq-manager/
[Tue Feb 14 15:47:38.738585 2023] [wsgi:error] [pid 2049:tid 139824253675072] [client 192.168.1.248:5082] sys:1: DeprecatedWarning: Call to deprecated function __init__(...). API class may be removed in a future release, use falcon.App instead., referer: http://192.168.1.143/intelmq-manager/ 
/usr/lib/python3/dist-packages/intelmq_api$ hug -m intelmq_api.serve
Loading config from /etc/intelmq/api-config.json
Traceback (most recent call last):
  File "/usr/bin/hug", line 33, in <module>
    sys.exit(load_entry_point('hug==2.6.0', 'console_scripts', 'hug')())
  File "hug/interface.py", line 649, in hug.interface.CLI.__call__
  File "hug/interface.py", line 645, in hug.interface.CLI.__call__
  File "hug/interface.py", line 129, in hug.interface.Interfaces.__call__
  File "hug/development_runner.py", line 68, in hug.development_runner.hug
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/intelmq_api/serve.py", line 31, in <module>
    api.http.add_middleware(hug.middleware.CORSMiddleware(api, allow_origins=api_config.allow_origins))
  File "falcon/middleware.py", line 39, in falcon.middleware.CORSMiddleware.__init__
TypeError: __init__() got multiple values for keyword argument 'allow_origins'

Commenting out the below allowed the log in to the intelmq-manager

api = hug.API(name)

api.http.add_middleware(hug.middleware.CORSMiddleware(api, allow_origins=api_config.allow_origins))

sebix commented 1 year ago

Thanks for reporting this bug. Unfortunately the used library has been abandoned upstream. @kamil-certat is working on a replacement, to be released in the next days/weeks (?) as intelmq-api version 3.1.0

Duplicate of https://github.com/certtools/intelmq-api/issues/40