I have been running three successful builds with the same config file but now the builds are failing. Not sure why but the error returned is django.db.utils.OperationalError: terminating connection due to administrator command
Here are my config defaults
defaults: &defaults
working_directory: ~/django-env
docker:
- image: circleci/python:3.6.4
environment:
PIPENV_VENV_IN_PROJECT: true
DATABASE_URL: postgres://postgres:postgres@localhost:5432/circle_test
- image: circleci/postgres:9.6.2 # an example of how to specify a service container
environment:
POSTGRES_USER: postgres
POSTGRES_DB: circle_test
I don’t have a ready answer for this, as I don’t do Python. However, there are a couple of ways you can debug this:
Get a post-build SSH session on the build server and debug it as if it were a local problem. CI build servers are pretty much a standard virtual server. There is some environmental thing that is upsetting your tests. Maybe you have a listener component that has run out of memory? However you would debug this on your laptop, do that on the server.
Convert your tests to run in Docker. When you are happy they run nicely, set that up on CircleCI as Docker-in-Docker. Not only are your projects more portable from a CI perspective - handy if you decide to self-host your CI in the future, say - but you can debug most of your CI problems locally.