Troubleshooting¶
Common issues and solutions for DSMR Reader Docker.
Quick Diagnostics¶
# Check container status
docker compose ps
# View container logs
docker compose logs dsmr
docker compose logs dsmrdb
# Check s6 overlay services
docker exec dsmr s6-rc -a list
# Test Django database connectivity
docker exec dsmr /opt/venv/bin/python /app/manage.py check --database default
Container Won't Start¶
Check logs¶
Enable debug mode¶
Check service status¶
Common causes¶
-
Database not ready: container starts before Postgres is accepting connections Solution: ensure Postgres is in the same compose file and DSMR uses the service name as host, for example
DJANGO_DATABASE_HOST: dsmrdb -
Missing environment variables: required variables not set Solution: verify your configuration reference
-
Port conflict: host port already in use Solution: change port mapping, for example
7777:80
Database Connection Issues¶
Symptoms¶
- Web interface shows database errors
- Connection refused in logs
- FATAL: database does not exist
Solutions¶
Check database is running:
Verify credentials match:
POSTGRES_USER matches DJANGO_DATABASE_USER
POSTGRES_PASSWORD matches DJANGO_DATABASE_PASSWORD
POSTGRES_DB matches DJANGO_DATABASE_NAME
Test connection from the DSMR container:
docker exec -e PGPASSWORD="$DJANGO_DATABASE_PASSWORD" dsmr \
psql -h "$DJANGO_DATABASE_HOST" -U "$DJANGO_DATABASE_USER" -d "$DJANGO_DATABASE_NAME"
Check database host:
# For Docker Compose on the same host, use the service name
DJANGO_DATABASE_HOST: dsmrdb
# Do not use localhost or 127.0.0.1 for the database host
Web Interface Not Accessible¶
Check nginx and gunicorn are running¶
Check port mapping¶
If port 80 is in use, map a different host port:
Nginx access logs and error logs¶
This image writes nginx logs to container stdout and stderr. You can view them with:
If you want access logs enabled:
Test nginx configuration¶
Serial Device Not Accessible¶
Check device exists on the host¶
Check permissions¶
Add your user to dialout group¶
Verify device is passed to the container¶
Check inside the container:
Timestamp Issues¶
Timestamps off by one hour¶
Do not mount host localtime into the container. Use timezone env var:
Verify time:
Data Not Showing or No Readings¶
Check datalogger activity¶
Verify datalogger configuration in the UI¶
Web interface then Configuration then Datalogger
Common settings:
- DSMR version: set to your meter version
- Serial port:
/dev/ttyUSB0or/dev/dsmr_p1 - Baud rate: 115200 for DSMR 4 or 5, 9600 for DSMR 2 or 3
Test serial connection manually¶
You should see telegram data periodically. Press Ctrl C to stop.
Performance Issues¶
Slow web interface¶
Check database size:
docker exec dsmrdb psql -U dsmrreader -d dsmrreader \
-c "SELECT pg_size_pretty(pg_database_size('dsmrreader'));"
Enable vacuum on startup:
Or run vacuum manually:
High CPU usage¶
SSL Certificate Errors¶
This image expects certificates at:
/etc/ssl/private/fullchain.pem/etc/ssl/private/privkey.pem
Verify certificates are mounted:
Test nginx configuration:
Check certificate validity:
Remote Datalogger and Remote Input Issues¶
There are two different scenarios.
Remote input pull¶
DSMR Reader reads from a remote TCP source like ser2net or a P1 TCP gateway.
Check connectivity from the DSMR container:
Verify env vars:
Remote datalogger push¶
A separate forwarder container reads the meter and pushes telegrams to the server via API.
Test server reachability from the forwarder:
Check forwarder env vars:
Check server logs for API activity:
Container Upgrade Issues¶
After upgrade, container will not start¶
Check breaking changes:
Check database version:
Restore from backup if needed, see Advanced section.
Platform Specific Issues¶
Raspberry Pi¶
If you see Y2038 or libseccomp related errors, update your host packages. The exact steps depend on your Pi OS version.
Synology NAS¶
USB serial support depends on DSM version and model. If /dev/ttyUSB0 is missing, verify the driver situation on the host first.
WSL2¶
USB devices are not natively accessible. Prefer network smart meter or USB IP forwarding.
Getting More Help¶
Enable debug logging¶
Collect diagnostic information¶
docker compose ps
docker compose logs dsmr > dsmr-logs.txt
docker compose logs dsmrdb > db-logs.txt
docker version
docker compose version
uname -a
# Remove sensitive values before sharing
docker compose config > config.yaml