Troubleshooting
Common setup, runtime, deployment, and testing issues when running Pengin-Pi-3 locally or behind Docker Compose.
For installation steps, see Install. For Docker and Traefik architecture, see Deployment. For environment variables, see Configuration.
Startup & Environment Fallbacks
App starts with [settings] SES credentials not found or uses SQLite unexpectedly
Pengin-Pi-3 is designed to boot cleanly without external credentials:
- Email (
AWS_SES_ENABLED): RequiresSES_USERNAME_SMTP,SES_PASSWORD_SMTP, andSES_SENDERto all be set. If any one is missing,EMAIL_BACKENDfalls back to Django's console backend andsend_mail()skips delivery. - Media (
AWS_S3_ENABLED): RequiresS3_KEY,S3_SECRET, andS3_BUCKETto all be set; otherwise uploads fall back to local storage. - Database (
DB_ENGINE): IfDB_ENGINEis set to PostgreSQL but any ofDB_NAME,DB_USER,DB_PASSWORD, orDB_HOSTis blank,main/settings.pyprints a notice and falls back to localdb.sqlite3. - reCAPTCHA (
RECAPTCHA_ENABLED): Disabled unless bothRECAPTCHA_SITE_KEYandRECAPTCHA_SECRET_KEYare set.
Check python manage.py check locally or docker compose logs web in production to see which fallbacks were triggered at startup.
Running tests locally without a .env or external services
Run Django's test runner directly (do not run test modules via python -m unittest):
python manage.py test
Tests run against SQLite, and suites that touch Django's cache (such as main/tests/test_wiki_permissions.py) override CACHES with LocMemCache via @override_settings so no external Postgres or Redis server is required.
Docker Compose & Traefik
network root_proxy not found on docker compose up
docker-compose.yml expects an external Docker network named root_proxy owned by Traefik. Either:
- Connect your existing host Traefik instance to a
root_proxynetwork, or - Start the bundled Traefik stack once first:
docker compose -f docker-compose.traefik.yml up -d(or run./deploy.sh, which handles this interactively).
TLS / Let's Encrypt certificate fails for www
The Nginx router rule in docker-compose.yml serves the bare domain, www.<domain>, and URL2, and requests certificates covering both. Ensure a DNS record exists for www as well as the root domain (see FAQ).
502 Bad Gateway behind Traefik
Traefik matched the hostname route, but the upstream nginx or web container is not responding yet:
- Check container status and startup logs with
docker compose psanddocker compose logs -f web. - On first boot, migrations and
collectstaticrun before Gunicorn/uWSGI begins serving.
FerretDB errors with schema "documentdb_api" does not exist
docker-compose.yml bind-mounts ./docker-entrypoint-initdb/01-create-app-db.sh as a single file at /docker-entrypoint-initdb.d/30-create-app-db.sh rather than replacing the directory. If the database volume was initialized without the image's built-in preload/install scripts (10-preload.sh, 20-install.sql), check the postgres container initialization logs and ensure the single-file mount wasn't replaced with a directory mount.
Redis & Caching
Redis connection errors in local development
CACHES in main/settings.py defaults to django_redis.cache.RedisCache at REDIS_URL (redis://127.0.0.1:6379). If Redis is not running locally:
SuperTemplateViewdegrades gracefully onSlugGET requests when Redis is unavailable rather than raising a 500 on every page.- Features or tests that directly read/write
django.core.cache.cacherequire either a running Redis instance or@override_settings(CACHES=...)in tests.
macOS Local Development
Port 8000 already in use
On macOS, AirPlay Receiver frequently occupies port 8000 or 5000. Identify the process with lsof -i :8000 or start Django on another port:
python manage.py runserver 8080
Git mmap failed / stalled reads inside ~/Documents
If iCloud Drive Desktop & Documents Folders syncing is enabled on macOS, iCloud can evict .git/objects/pack files to cloud-only ("dataless") stubs, causing git commands to stall or fail with mmap failed. Clone repositories outside iCloud-synced folders (for example ~/Developer/ or ~/Projects/).
Wiki & Slug Routing
Reserved slug names rejected (wiki, create, edit, static, media, ...)
Slug.clean() and the wiki views reject child slugs named create or edit, as well as top-level slugs colliding with core routes (admin, login, signup, staff, wiki, create, edit, static, media, etc.) so pages do not become unreachable. The top-level home slug is explicitly allowed and maps to /.
403 Forbidden when trying to create or edit wiki pages
Wiki creation and editing require a signed-in staff account (is_staff=True, enforced via StaffRequiredMixin). Anonymous or non-staff accounts cannot create wikis or edit pages.
Next
- Install — Docker and local setup paths
- Deployment — full production Docker Compose and Traefik details
- Configuration — all environment variables and defaults
- Wiki Module — how the built-in wiki works
Contents
- Troubleshooting
- Startup & Environment Fallbacks
- App starts with `[settings] SES credentials not found` or uses SQLite unexpectedly
- Running tests locally without a `.env` or external services
- Docker Compose & Traefik
- `network root_proxy not found` on `docker compose up`
- TLS / Let's Encrypt certificate fails for `www`
- `502 Bad Gateway` behind Traefik
- FerretDB errors with `schema "documentdb_api" does not exist`
- Redis & Caching
- Redis connection errors in local development
- macOS Local Development
- Port 8000 already in use
- Git `mmap failed` / stalled reads inside `~/Documents`
- Wiki & Slug Routing
- Reserved slug names rejected (`wiki`, `create`, `edit`, `static`, `media`, ...)
- `403 Forbidden` when trying to create or edit wiki pages
- Next
Pages Here
No sub-pages yet.
Page Info
Wiki: Docs
Created on Dec 3, 2026 by Chafic Al Hakim
Maintainers
| Editor | Last Activity |
|---|---|
| Chafic Al Hakim creator | Dec 3, 2026 |