Skip to content

Troubleshooting ​

Problems already met, or likely, with their cause and fix.

The pipeline ​

SymptomLikely causeFix
A job stays pendingno online runner with the right tagcheck the dots in Settings → CI/CD → Runners, then sudo gitlab-runner verify on the server
deploy-prod pendingthe trinity-prod-deploy runner is stopped, or lacks the prod tagsystemctl status gitlab-runner on trinity-prod
api:lint runs on a deploy runnera deploy runner accepts untagged jobsuncheck "Run untagged jobs" on the deploy runners
No *:lint / *:test job runsno file in api/ or web/ changedexpected: see The pipeline
*:build: Cannot connect to the Docker daemonthe CI runner is not privileged, or /certs/client is not sharedre-run the gitlab-runner role; check privileged = true in config.toml
web:test green but nothing in the Tests tabjunit.xml not producedrun npm run test:ci (not npm test)

Runners ​

SymptomLikely causeFix
Every shell job fails with prepare environment: exit status 1Ubuntu's /home/gitlab-runner/.bash_logoutthe Ansible role deletes it; re-run it
Shell job: permission denied … docker.sockgitlab-runner is not in the docker groupre-run the role, then sudo systemctl restart gitlab-runner
A runner appears twice in GitLabregistered by hand on top of Ansibledelete the duplicate in GitLab and in /etc/gitlab-runner/config.toml

Deployment ​

SymptomLikely causeFix
deploy-prod: manifest unknown or pull access deniedthe …:<sha> image does not exist: a *:build job did not run or failedlook at the build stage of the same pipeline
deploy-prod fails on the test … = 3 lineSwarm rolled back: the new image fails its health checkdocker service ps trinity_api --no-trunc and docker service logs trinity_api
deploy-dev fails on curl … /health after 20 attemptsthe container crashes at startupdocker logs trinity_api on trinity-dev
The prod API crashes with PermissionError: '/app/staticfiles'/app does not belong to appuserfixed in api/Dockerfile.prod: see Configuration and startup
The API refuses to start: SECRET_KEY must be setDJANGO_SECRET_KEY variable missing, or not available to this branchcheck Settings → CI/CD → Variables
password authentication failed for user "trinity"POSTGRES_PASSWORD changed after the volume was createdsee Secrets

Traefik and HTTPS ​

SymptomLikely causeFix
404 page not foundno route for this domain, or the service is not on the trinity networkcheck the file in /opt/trinity/traefik/dynamic/ and docker network inspect trinity
502 Bad Gatewaythe target container does not answer on its portservice logs; check the port (3000 or 8000)
Invalid "TRAEFIK DEFAULT CERT" certificateLet's Encrypt could not issue the certificatedocker logs trinity-traefik; check the DNS points to the right IP and port 80 is open
Traefik: permissions 644 for /acme.json are too openwrong permissions on acme.jsonchmod 600 /opt/trinity/traefik/acme.json, then restart Traefik
A changed route is not appliedthe file was not copied to the serverre-run ansible-playbook … --tags traefik

The application ​

SymptomLikely causeFix
Every API request answers 400 Bad Requestthe domain is not in ALLOWED_HOSTSfix ALLOWED_HOSTS in the Compose file
The web shows "API indisponible : fetch failed"wrong API_URL, or the API is stoppedcheck API_URL and the API's /health
The Django admin has no styling in prodGunicorn does not serve static filesknown: see Limits