patschi / parsedmarc-dockerized

Dockerized self-initializing parsedmarc docker stack for lazy people
GNU General Public License v3.0
78 stars 21 forks source link

Container parsedmarc error: "ModuleNotFoundError: No module named 'msgraph'" #22

Closed joeplaa closed 9 months ago

joeplaa commented 9 months ago

As of today, Februari 15, the parsedmarc container doesn't start. I tried building the image myself, but it gives the same error.

Traceback (most recent call last):
  File "/opt/pypy/bin/parsedmarc", line 5, in <module>
    from parsedmarc.cli import _main
  File "/opt/pypy/lib/pypy3.10/site-packages/parsedmarc/__init__.py", line 31, in <module>
    from parsedmarc.mail import MailboxConnection
  File "/opt/pypy/lib/pypy3.10/site-packages/parsedmarc/mail/__init__.py", line 2, in <module>
    from parsedmarc.mail.graph import MSGraphConnection
  File "/opt/pypy/lib/pypy3.10/site-packages/parsedmarc/mail/graph.py", line 10, in <module>
    from msgraph.core import GraphClient
ModuleNotFoundError: No module named 'msgraph'
ggrzeczkowicz commented 9 months ago

It's link to https://github.com/domainaware/parsedmarc/issues/464

ggrzeczkowicz commented 9 months ago

While waiting for parsedmarc fix, you can use the follow Dockerfile to build your latest image :

FROM patschi/parsedmarc:latest

RUN pip3 uninstall msgraph-core --break-system-package -y
RUN pip3 install msgraph-core==0.2.2 --break-system-packages

cf. https://github.com/domainaware/parsedmarc/issues/464#issuecomment-1908370023

joeplaa commented 9 months ago

That works. Thanks!

patschi commented 9 months ago

Interesting. Thanks for the workaround, @ggrzeczkowicz!

Would you mind to open a PR editing the files in this repo with the workaround for the time being? Thanks!

ggrzeczkowicz commented 9 months ago

@patschi normaly the error has been fix in last release (cf. https://github.com/domainaware/parsedmarc/commit/77132b3fc57358da6ea01fa9bb54034254c99c5e). Can you build and push a new image to the docker hub please ?

patschi commented 9 months ago

Ok, thanks. Pushed the workflow and image is pushed. Let me know if this fixes the issue.

xjimbob commented 9 months ago

@patschi I can see the data that was already there but for some reason I am getting this error and it can not get access to the email:

ERROR:cli.py:1086:MS Graph Error Traceback (most recent call last): File "/opt/pypy/lib/pypy3.10/site-packages/parsedmarc/cli.py", line 1073, in _main mailbox_connection = MSGraphConnection( File "/opt/pypy/lib/pypy3.10/site-packages/parsedmarc/mail/graph.py", line 109, in init auth_record = credential.authenticate(scopes=scopes) File "/opt/pypy/lib/pypy3.10/site-packages/azure/identity/internal/interactive.py", line 205, in authenticate = self.get_token(*scopes, _allow_prompt=True, **kwargs) File "/opt/pypy/lib/pypy3.10/site-packages/azure/identity/_internal/interactive.py", line 166, in get_token raise ClientAuthenticationError(message=message, response=response) azure.core.exceptions.ClientAuthenticationError: Authentication failed: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.

It was working before last updates and I changed nothing. After the first try I did update the client secret just to be sure but it still does not work.

ggrzeczkowicz commented 9 months ago

Ok, thanks. Pushed the workflow and image is pushed. Let me know if this fixes the issue.

It works perfectly for me !

patschi commented 9 months ago

Perfect. Thanks for confirming!

I'll need to get some time soon to work through all issues/PRs... Honestly didn't expect people using this so much.

Closing this now. Thanks for all your help!