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

misp-modules v2.4.195 importlib.import_module("cv2") fails #596

Open
github-germ opened this issue Jan 4, 2023 · 17 comments
Open

misp-modules v2.4.195 importlib.import_module("cv2") fails #596

github-germ opened this issue Jan 4, 2023 · 17 comments

Comments

@github-germ
Copy link

What can be done to prevent this error from occurring when launching misp-modules v2.4.165 with MISP v2.4.167?

ERROR:root:libGL.so.1: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/misp_modules/__init__.py", line 41, in <module>
    from .modules import *  # noqa
  File "/usr/local/lib/python3.8/site-packages/misp_modules/modules/__init__.py", line 1, in <module>
    from .expansion import *  # noqa
  File "/usr/local/lib/python3.8/site-packages/misp_modules/modules/expansion/qrcode.py", line 3, in <module>
    import cv2
  File "/usr/local/lib/python3.8/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/usr/local/lib/python3.8/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
uwhois module not installed.
@github-germ
Copy link
Author

not seeing this anymore in 2.4.169

@github-germ
Copy link
Author

Seeing this again in 2.4.195...

[20240815-170828] /entrypoint.sh starting
ERROR:root:libGL.so.1: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/misp_modules/__init__.py", line 45, in <module>
    from .modules import *  # noqa
  File "/usr/local/lib/python3.8/site-packages/misp_modules/modules/__init__.py", line 1, in <module>
    from .expansion import *  # noqa
  File "/usr/local/lib/python3.8/site-packages/misp_modules/modules/expansion/qrcode.py", line 3, in <module>
    import cv2
  File "/usr/local/lib/python3.8/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/usr/local/lib/python3.8/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

@ostefano
Copy link
Collaborator

Try a more recent version.

@github-germ github-germ changed the title misp-modules v2.4.165 + MISP v2.4.167: uwhois module not installed misp-modules v2.4.195 importlib.import_module("cv2") fails Sep 27, 2024
@github-germ
Copy link
Author

Thx for the swift reply. 2.4.195 is pretty recent. You think this is fixed in 2.4.197?

@ostefano
Copy link
Collaborator

I have good reasons to think so

@github-germ
Copy link
Author

OK, I cannot hit 2.4.197 yet, as I have to revise my Dockerfile as <= 2.4.195 I built using REQUIREMENTS which is no longer. On my first revised attempt it built a bogus docker image. I'll get back to that over the next week or so.

@ostefano
Copy link
Collaborator

Why don't you try the official docker image? https://github.com/MISP/misp-docker

Also, you can now install misp-modules using pip: https://pypi.org/project/misp-modules/

@s-karberg
Copy link

Hey everyone,

I have installed 2.4.199 on a ubuntu 24.04.1.
I also had the problem with libgl1.so.1

I just found a post in another project and they said: install libgl1 so i did a sudo apt-get install libgl1 and that fixed the test through misp-modules -t

so maybe it needs to be written in the docs for a dependency

@ostefano
Copy link
Collaborator

Good point 👍

@ostefano
Copy link
Collaborator

Hey everyone,

I have installed 2.4.199 on a ubuntu 24.04.1.
I also had the problem with libgl1.so.1

I just found a post in another project and they said: install libgl1 so i did a sudo apt-get install libgl1 and that fixed the test through misp-modules -t

so maybe it needs to be written in the docs for a dependency

How did you install it?

@s-karberg
Copy link

Hey everyone,
I have installed 2.4.199 on a ubuntu 24.04.1.
I also had the problem with libgl1.so.1
I just found a post in another project and they said: install libgl1 so i did a sudo apt-get install libgl1 and that fixed the test through misp-modules -t
so maybe it needs to be written in the docs for a dependency

How did you install it?

install what? misp-modules?

@ostefano
Copy link
Collaborator

Yes, how did you install misp-modules?

@ostefano
Copy link
Collaborator

Asking because the documentation (https://misp.github.io/misp-modules/install/) specifies the following steps:

Note that the dependencies will require a number of system packages installed. On Ubuntu these packages are libpoppler-cpp-dev, libzbar0, and tesseract-ocr. For an updated list, check the github action used to test the build inside .github/workflows.

And I wonder wether libgl1 might be a dependency of one of those packages.

@s-karberg
Copy link

Yes, how did you install misp-modules?

i have "tried" both way.
pip install misp-modules but i can see it also had the git clone way.

regarding the system packages, i looked in that and workflows, the libgl1 package is not listed in there :)

@ostefano
Copy link
Collaborator

@s-karberg yes, I know, I am asking whether you tried to install libpoppler-cpp-dev, libzbar0, and tesseract-ocr as specified in the readme, since libgl1 might actually be a dependency (let's just say that I have a strong feeling that is the case).

@s-karberg
Copy link

@s-karberg yes, I know, I am asking whether you tried to install libpoppler-cpp-dev, libzbar0, and tesseract-ocr as specified in the readme, since libgl1 might actually be a dependency (let's just say that I have a strong feeling that is the case).

i did, didn't work :) they are installed.

@ostefano
Copy link
Collaborator

In that case I agree we need to add it to the readme :)

I wonder why the CI/CD doesn't break though, that is weird.
Would you be open to adding a test to reproduce the issue at test time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants