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

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

Closed
joeplaa opened this issue Feb 15, 2024 · 9 comments
Closed

Comments

@joeplaa
Copy link

joeplaa commented Feb 15, 2024

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
Copy link

It's link to domainaware/parsedmarc#464

@ggrzeczkowicz
Copy link

ggrzeczkowicz commented Feb 19, 2024

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. domainaware/parsedmarc#464 (comment)

@joeplaa
Copy link
Author

joeplaa commented Feb 19, 2024

That works. Thanks!

@patschi
Copy link
Owner

patschi commented Feb 20, 2024

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
Copy link

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

@patschi
Copy link
Owner

patschi commented Feb 20, 2024

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

@xjimbob
Copy link

xjimbob commented Feb 20, 2024

@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
Copy link

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

It works perfectly for me !

@patschi
Copy link
Owner

patschi commented Feb 20, 2024

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!

@patschi patschi closed this as completed Feb 20, 2024
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

4 participants