dmarc-visualizer
dmarc-visualizer copied to clipboard
ModuleNotFoundError: No module named 'msgraph' parsedmarc Docker getting restarting
Error
ModuleNotFoundError: No module named 'msgraph'
Traceback (most recent call last):
File "/usr/local/bin/parsedmarc", line 5, in <module>
from parsedmarc.cli import _main
File "/usr/local/lib/python3.9/site-packages/parsedmarc/__init__.py", line 31, in <module>
from parsedmarc.mail import MailboxConnection
File "/usr/local/lib/python3.9/site-packages/parsedmarc/mail/__init__.py", line 2, in <module>
from parsedmarc.mail.graph import MSGraphConnection
File "/usr/local/lib/python3.9/site-packages/parsedmarc/mail/graph.py", line 10, in <module>
from msgraph.core import GraphClient
ModuleNotFoundError: No module named 'msgraph'``
got this error even changed the
RUN apk add --update --no-cache --virtual .build_deps build-base libffi-dev \
&& pip install parsedmarc 'msgraph-core<1.0.0' \
docker ps | grep dmarc
9f4c981247a7 d715d60fffa8 "parsedmarc -c /pars…" 58 minutes ago Restarting (1) 44 seconds ago dmarc_parsedmarc
ed59739f918d docker.elastic.co/elasticsearch/elasticsearch:7.17.5 "/bin/tini -- /usr/l…" 58 minutes ago Up 54 minutes 9200/tcp, 9300/tcp dmarc_elasticsearch
90bfc2b8a257 7ba0f5152237 "/run.sh" About an hour ago Up About an hour 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp dmarc_grafana
docker-compose file
version: '3.5'
services:
parsedmarc:
container_name: dmarc_parsedmarc
build: ./parsedmarc/
volumes:
- ./files:/input:ro
- ./output_files:/output
command: parsedmarc -c /parsedmarc.ini /input/* --debug
depends_on:
- elasticsearch
restart: always
elasticsearch:
container_name: dmarc_elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.5
environment:
- discovery.type=single-node
volumes:
- ./elastic_data:/usr/share/elasticsearch/data
restart: always
grafana:
container_name: dmarc_grafana
build: ./grafana/
ports:
- 3000:3000
user: root
environment:
GF_INSTALL_PLUGINS: grafana-piechart-panel,grafana-worldmap-panel
GF_AUTH_ANONYMOUS_ENABLED: 'true'
restart: always
parsedmarc/Dockerfile
# Use the official Python 3.9 Alpine image
FROM python:3.9-alpine3.16
# Install system dependencies
RUN apk add --update --no-cache libxml2-dev libxslt-dev
# Install build dependencies
RUN apk add --update --no-cache --virtual .build_deps build-base libffi-dev \
&& pip install parsedmarc msgraph-core==0.2.2 \
&& apk del .build_deps
# Copy configuration file
COPY parsedmarc.ini /
# Command to run the parsedmarc tool
CMD ["parsedmarc"]
Please refer to the comment on another thread about mitigating: https://github.com/debricked/dmarc-visualizer/issues/55#issue-2111500761