Troubleshooting
Manually creating a new administrator
It happens to the best of us. Perhaps you’re locked out because your only Administrator has left, or maybe you disabled them. Whatever it is, here’s how you can get back on track:
-
Login to your Postgres database with the credentials you’ve setup
-
Find the ID of the user you wish to make an Administrator:
select * from saas_users;
Grab the ID for the user(s) you wish to make an Administrator. It may be simpler to just initially assign yourself as an Administrator and then add others via the UI.
-
Grab the ID of the Administrator role. It should have an ID of 1 and a uuid of
cf75d7c2-416b-11ea-af5e-53c3b1a4efd8, but best to be sure:select * from pactflow_roles; -
Add a role mapping for the user:
insert into pactflow_user_roles ("user_id","role_id") values (<user_id>, <role_id>);
You are now an Administrator and - assuming you didn’t tell anyone - have spared yourself shame and embarrassment.
Container exits during startup
This section applies to -lic2 images. It doesn’t apply to standard images.
Before Contract Testing On-Premises starts, the container checks its configuration, its dependencies, the license, and the application files. If a check fails, the container writes a message that starts with !! FATAL: pactflow-init: to the startup log and exits with a specific exit code.
To find the exit code:
-
Docker: run
docker inspect --format '{{.State.ExitCode}}' <container>. -
Kubernetes: run
kubectl describe pod <pod>and check Last State for Exit Code.
| Exit code | Meaning | What to do |
|---|---|---|
1 |
The container couldn’t load its startup configuration or start the application. | Contact Support with the full startup log. |
2 |
No license file was found, and PACTFLOW_LICENSE doesn’t contain valid base64-encoded license contents. |
Mount the license file at /home/pactflow/pactflow.lic, or set PACTFLOW_LICENSE. Make sure you mounted the license as a file, not as a directory. See License file. |
3 |
The license file exists but can’t be read. | Check that the user the container runs as has read permission on the license file. |
4 |
The file isn’t a license file in the new format. | -lic2 images need a license file in the new format. License files for standard images don’t work. See Moving to the new license format. |
5 |
The license file is corrupted. | Copy the license file again from the original you received. If you use PACTFLOW_LICENSE, encode the file again. |
6 |
This version doesn’t support the license file format. | Upgrade to the latest version, or contact your Account Manager. |
7 |
This version doesn’t recognize the key that signed the license. | Upgrade to the latest version. If the problem continues, contact Support. |
8 |
The license file was modified. | Use the original, unmodified license file. If the problem continues, contact your Account Manager. |
9 |
The license has expired. | Contact your Account Manager to renew your license, then replace the license file. |
10–19 |
The application failed an integrity check. | Pull the image again from Quay.io and deploy it without changes. If the problem continues, contact Support with the full startup log. |
20 |
A required environment variable is missing or invalid, or a required file or directory isn’t available. | The log lists each problem, including the variable name, what’s wrong, and what’s required. Fix the configuration and restart. See Environment variables. |
21 |
A required service, such as PostgreSQL or Redis, couldn’t be reached during startup. | Check the network connection and connection settings for the service named in the log. If the service is slow to respond, increase PACTFLOW_STARTUP_PROBE_TIMEOUT_SECS. |
The startup log can also include warnings, for example about deprecated environment variables. Warnings don’t stop the container.
Segmentation fault on launch
This section applies to standard images. It doesn’t apply to -lic2 images.
/home/pact_broker_fork/lib/pact_broker/version.rb:2: [BUG] Segmentation fault at 0x00007efdfbffa000
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux-musl]
-- Control frame information -----------------------------------------------
c:0052 p:---- s:0316 e:000315 CFUNC :RGLoader_load
c:0051 p:0193 s:0311 e:000310 TOP /home/pact_broker_fork/lib/pact_broker/version.rb:2 [FINISH]
This most frequently happens when your license file isn’t mounted correctly. ie. you’re trying to mount a file as a folder, or vice-versa. Be sure to mount your license file as a file inside the running container. For example, in Docker Compose, you need to have:
version: "3"
services:
pactflow:
image: quay.io/pactflow/enterprise
volumes:
- ./pactflow-onprem.lic:/home/pactflow-onprem.lic
Adjust accordingly depending on your container runtime.