Troubleshooting¶
Solutions to common problems when installing, operating, and using Kamerplanter. The steps below apply to both the Docker Compose and Kubernetes environments.
Backend and Services Won't Start¶
The backend won't start — how do I diagnose the problem?
Step 1 — Check the logs:
Common error messages and solutions:
| Error message | Cause | Solution |
|---|---|---|
Connection refused: arangodb:8529 | ArangoDB not reachable | Check ArangoDB container (docker compose ps) |
AUTH_EXCEPTION | Wrong ArangoDB password | Verify ARANGODB_PASSWORD in .env |
redis.exceptions.ConnectionError | Redis/Valkey not reachable | Restart Redis container |
pydantic_settings.SettingsError | Missing required environment variable | Set all required variables in .env |
Cannot import name 'X' | Missing Python dependency | pip install -r requirements.txt inside container |
ArangoDB container won't start
The most common cause is a data volume from an older ArangoDB version. Check:
If "Invalid version" or "upgrade required" appears:
Data loss warning
Removing the volume deletes all database data. Only do this in development environments without important data.
Celery worker is not running — tasks are not being generated
Check worker status:
Common cause: REDIS_URL not set or Redis not reachable. Test the Redis connection:
Database Problems¶
Database collections missing or 'collection not found' errors
Kamerplanter automatically creates all collections on startup. If collections are missing, the startup hook was not executed. Restart the backend:
Alternatively, check the ArangoDB web UI (default: http://localhost:8529) to verify that the kamerplanter database and kamerplanter_graph exist.
Migration fails — seed data is not loaded
Kamerplanter runs seed migrations at startup (seed_data, seed_starter_kits, seed_location_types). On failure, check the backend logs for the full stack trace.
Common cause: ArangoDB starts slower than the backend. Increase the healthcheck interval or use depends_on with condition: service_healthy. Restart the backend after ArangoDB is fully started.
'graph not found' error in AQL queries
The named graph kamerplanter_graph is created on first startup. If it is missing, ensure_collections() initialization was skipped. Restart the backend or create the graph manually in the ArangoDB web UI under "Graphs".
Authentication and Users¶
Login fails — 401 Unauthorized
Check:
- Correct email and password? Demo account:
demo@kamerplanter.local/demo-passwort-2024 - Email verification required? If
REQUIRE_EMAIL_VERIFICATION=trueis set, the email must be confirmed. Set tofalsefor development. - JWT secret key changed? All active tokens become invalid. Users must log in again.
Registration fails — 'Email already registered'
The email address already exists in the system. Use the password reset flow, or check the email in the ArangoDB web UI under the users collection.
Token expires — constant logouts
JWT access tokens expire after 15 minutes (default). The frontend client automatically renews the token using the refresh token (valid 30 days). If refresh token renewal fails:
- Check
JWT_SECRET_KEYin the environment — if this value was changed, all refresh tokens become invalid. - Check browser cookies — the HttpOnly cookie
refresh_tokenmust be set.
CORS Errors in the Browser¶
CORS errors when making API calls from the browser
CORS errors appear in the browser console as:
Solution: Add the frontend origin to CORS_ORIGINS:
Format: JSON array as a string. Separate multiple entries with commas.
No wildcards in production
CORS_ORIGINS=["*"] allows all origins — only suitable for local development. Always specify concrete URLs in production environments.
CORS error despite correct CORS_ORIGINS configuration
Check the Origin header actually being sent:
- Browser DevTools → Network → Request Headers →
Origin - Add this exact value (including
http://vs.https://and port) toCORS_ORIGINS. - Restart the backend after the configuration change.
Harvest and IPM¶
Harvest is blocked (422 pre-harvest interval violation)
An active IPM treatment has an open pre-harvest interval (PHI). The harvest is blocked until the PHI has passed.
Steps:
- Navigate to Pest Management > Treatment Applications.
- Check active treatments with status "active" or "pre-harvest interval".
- The system shows the earliest possible harvest date.
Do not bypass the pre-harvest interval
The PHI is a legal requirement (CanG, PflSchG). The system intentionally prevents the harvest — manual bypass is not provided.
Observation cannot be marked as harvest-ready
Check whether harvest indicators are configured for the plant species. Navigate to Master Data > [Species] > Harvest Indicators and add at least one indicator.
Calendar and iCal¶
iCal feed shows no events
Check:
- Feed token valid? Under Calendar > iCal Feeds, verify the feed is active.
- Calendar app: URL must follow the format
https://[host]/api/v1/calendar/ical/[token]. - Time zone: iCal feeds use UTC. Check whether your calendar application interprets time zones correctly.
Calendar view does not load or shows no data
Navigate to Calendar and check:
- Are there planting runs or tasks in the selected period?
- Are the filters (phase, category) set too narrowly?
- Any backend API errors in browser DevTools (F12 → Network →
/api/v1/...)?
Onboarding Wizard¶
Onboarding wizard fails at step 3 (Starter Kit)
Check whether starter kit seed data was loaded:
If "0 starter kits loaded" appears, trigger the seed migration manually:
After onboarding, no tenant appears in the selection
The personal tenant is automatically created at registration. If it is missing:
GET /api/v1/t/— check whether the tenant endpoint returns data.- If empty: run through the onboarding again or create a tenant manually under Settings > Tenants.
Performance and Connection Issues¶
API requests are slow (> 2 seconds)
Common causes:
| Cause | Check | Solution |
|---|---|---|
| Missing ArangoDB index | ArangoDB web UI → Collection → Indexes | Re-run ensure_collections() |
| Too many graph traversal steps | AQL EXPLAIN in web UI | Reduce traversal depth |
| Redis cache cold | First request after restart | Normal — cache warms up |
503 Service Unavailable when accessing the API
The backend container is not running or is failing its health check:
Test the health check endpoint directly:
Light Mode vs. Full Mode¶
Authentication is required even though Light Mode is configured
In Light Mode (KAMERPLANTER_MODE=light), token authentication is disabled for most endpoints. Check:
- Is
KAMERPLANTER_MODE=lightset in the backend environment? - Was the backend restarted after the change?
- Is the request actually reaching the backend port (8000) and not a proxy?
Common Issues After an Update¶
Database queries fail after a version update
New collections or edge definitions are handled by ensure_collections() on startup. If collections are missing or newly added:
- Check backend logs for startup errors.
- Make sure the backend container was fully restarted during the update.
- Verify ArangoDB collections manually via the web UI.
Frontend shows '404 Not Found' after deployment
In Kubernetes deployments, the frontend build is served as static files by the backend. Check:
Alternatively: deploy the frontend as a separate Nginx container.
Diagnostic Tools¶
Check API health¶
Query ArangoDB directly¶
Open http://localhost:8529 in your browser (default credentials: root / value from ARANGO_ROOT_PASSWORD).