Skip to content
Beth Skurrie edited this page Oct 13, 2017 · 7 revisions

How to check the logs

Work out how you can run your Pact Broker client (eg. maven plugin, pact-broker CLI) in debug mode to make sure you're seeing all the possible errors.

Start the docker container in debug mode by setting the PACT_BROKER_LOG_LEVEL to DEBUG. Get name of broker container by running docker ps Run docker logs -f CONTAINER_NAME Do the thing that causes the problem (eg. verification)

If you can't see anything helpful in that log, have a look at the nginx access log.

Run docker exec -it CONTAINER_NAME bash Run cat /var/log/nginx/access.log You'll see something like this:

172.17.0.1 - foo [10/Oct/2017:04:22:20 +0000] "POST /pacts/provider/Bar/consumer/Foo/pact-version/8d888dc6024e7ff236af4a72fe5efddd7d16904a/verification-results HTTP/1.1 201"

That first number after HTTP/1.1 is the response code. If it is 400, you have a validation error. If it is 401, you have incorrect credentials.

Hacking the code and restarting the phusion app server

If you want to do some serious hacking or debugging, you can modify the ruby source code. The main configuration code can be found in /home/app/pact_broker/config.ru and the ruby files in the same folder. Once you've saved your changes, restart the passenger server using passenger-config restart-app --name /home/app/pact_broker/public. Note that these changes will be lost the next time you restart the docker container.

Clone this wiki locally