Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial fetch of shadowserver-schema.json fails even in auto_update mode #2480

Closed
barbich opened this issue Mar 18, 2024 · 0 comments · Fixed by #2482
Closed

Initial fetch of shadowserver-schema.json fails even in auto_update mode #2480

barbich opened this issue Mar 18, 2024 · 0 comments · Fixed by #2482
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior component: bots
Milestone

Comments

@barbich
Copy link

barbich commented Mar 18, 2024

hi
running latest intelmq via docker-compose and using latest shadowserver api and parser versions.

Observed behavior:

The shadowserver parser bot fails to start if the initial fetch of shadowserver-schema.json has not been done manually even if auto_update is set to True:

root@fe8423630f14:/opt# intelmqctl run Shadowserver-Parser process
Starting Shadowserver-Parser...
Shadowserver-Parser: ShadowserverParserBot initialized with id Shadowserver-Parser and intelmq 3.3.0 and python 3.9.2 (default, Feb 28 2021, 17:03:44) as process 5157. Standalone mode: True.
Shadowserver-Parser: Bot is starting.
Shadowserver-Parser: Loading source pipeline and queue 'Shadowserver-Parser-queue'.
Shadowserver-Parser: Connected to source queue.
Shadowserver-Parser: Loading destination pipeline and queues {'_default': ['File-Output-queue']}.
Shadowserver-Parser: Connected to destination queues.
Shadowserver-Parser: Bot initialization failed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/intelmq/lib/bot.py", line 241, in __init__
    self.init()
  File "/usr/local/lib/python3.9/dist-packages/intelmq/bots/parsers/shadowserver/parser.py", line 61, in init
    config.reload()
  File "/usr/local/lib/python3.9/dist-packages/intelmq/bots/parsers/shadowserver/_config.py", line 339, in reload
    raise ValueError("The schema file does not exist: %r.", __config.schema_file)
ValueError: ('The schema file does not exist: %r.', '/opt/intelmq/var/lib/bots/shadowserver-schema.json')
Shadowserver-Parser: Bot stopped.
Bot exited with code 1.
Shadowserver-Parser: Bot stopped.
Exception ignored in: <function Bot.__del__ at 0x7fd6a6797af0>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/intelmq/lib/bot.py", line 566, in __del__
    return self.stop(exitcode=0)
  File "/usr/local/lib/python3.9/dist-packages/intelmq/lib/bot.py", line 599, in stop
    sys.exit(exitcode)
SystemExit: 0

Note:
intelmq.bots.parsers.shadowserver.parser --update-schema works fine

Expected behavior:

As per documentation "The parser will attempt to download a schema update on startup when the auto_update option is enabled"
Therefore it would be expected that with auto_enabled set to True the parser would download the schema file and move on (even if it has never been downloaded before).

This seems to be due to the fact that the parser raises a ValueError on line 339 instead of just logging an error message (IMHO).

Fix

  • run intelmq.bots.parsers.shadowserver.parser --update-schema
  • replace the error raise at line 339 by a __config.logger.error
@sebix sebix added bug Indicates an unexpected problem or unintended behavior component: bots labels Mar 18, 2024
@sebix sebix added this to the 3.3.1 milestone Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: bots
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants