Open legoguy1000 opened 1 year ago
Hi @legoguy1000
Thanks for raising that up. IRIS_WORKER was removed from the v2.0.0. The migration script upgrade_to_2.0.0.py
should have commented this one out if you used it to upgrade.
The fact that post init runs again is not an issue per say it/s not overwriting, just filling gaps. However there seems to be a miss since this IRIS_WORKER env should have been set in the worker instance (but not via the .env).
We'll take a look 👍
We use kubernetes so the upgrade script wasn't used. I did see that though and I assumed as much that it wasn't being used anymore but it was still the the configuration.md file and didn't know if the running of the post_init was expected or not. Sounds like it is not a problem so, i'll just make sure the IRIS_WORKER env is completely removed from our deployment and call it a day.
We have a similar issue with a fresh deployment using docker-compose. Except we get this kind of error for all modules in version v2.3.0.
This is a sample of the log:
[2023-07-12 16:48:48,153: INFO/MainProcess] Task app.iris_engine.module_handler.module_handler.task_hook_wrapper[f0ff8c9e-f105-4a4d-a974-378e2c1fbca8] received
[2023-07-12 16:48:48,158: ERROR/ForkPoolWorker-8] Class 'builtins.int' is not mapped
Traceback (most recent call last):
File "/iriswebapp/app/iris_engine/module_handler/module_handler.py", line 455, in task_hook_wrapper
obj = db.session.merge(dse_data)
File "<string>", line 2, in merge
File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2969, in merge
object_mapper(instance) # verify mapped
File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/orm/base.py", line 296, in object_mapper
return object_state(instance).mapper
File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/orm/base.py", line 318, in object_state
raise exc.UnmappedInstanceError(instance)
sqlalchemy.orm.exc.UnmappedInstanceError: Class 'builtins.int' is not mapped
Describe the bug I have DFIR IRIS 2.0.2 setup but when i have DFIR query MISP to enrich an IOC the worker errors out.
To Reproduce Steps to reproduce the behavior:
Expected behavior DFIR queries MISP and adds results to IOC
Screenshots If applicable, add screenshots to help explain your problem.
Additional context The error indicates when
app.config.get("SECRET_KEY")
is empty. This only seems to happen whenIRIS_WORKER=1
on the worker container. The variable is empty due to https://github.com/dfir-iris/iris-web/blob/v2.0.2/source/app/configuration.py#L278. If I comment outIRIS_WORKER=1
, the module works just fine however the worker also runs the all the Post Init functions that is also run in teh main container, https://github.com/dfir-iris/iris-web/blob/v2.0.2/source/app/post_init.py#L82.