Troubleshooting Polarity v5
  • 24 Dec 2024
  • 4 Minutes to read
  • Dark
    Light

Troubleshooting Polarity v5

  • Dark
    Light

Article summary

This page is for overall troubleshooting of Polarity Server v5.

General Troubleshooting Tips

Check if containers are running

To check if the containers are running run the following command and check for the up time of the containers: 

cd /app
./health_check.sh

If the up time is only a few seconds then the container is failing to start up. 

Checking logs of the containers

Polarity's logs are now stored within the docker containers and can be tailed or grepped with the following command: 

Polarity Platform Container

docker logs polarity_platform 
docker logs polarity_platform |& grep -i "your search term"

Polarity Web Container

docker logs polarity_web 
docker logs polarity_web |& grep -i "your search term"

Polarity Platform doesn't start

This section will walk through what to do if the polarity_platform container is not starting or is constantly restarting: 

The first thing to do is to check the /app/.env file to ensure the hostname is set correctly: 

  1. Open the /app/.env file for editing.
  2. Check that the following lines are set to the correct FQDN for your server:
POLARITY_HOSTNAME={{Correct Hostname}}
POLARITY_WEB_HOSTNAME={{Correct Hostname}}

If the hostname is set correctly, check for errors in the logs of the polarity_platform container.  The error will typically show at the end of the logs. 

docker logs polarity_platform

If there is an error not able to read license key then please check if the server.crt and polarity.pem files exist in the correct locations. 

If the errors seems unknown, please reach out to support@polarity.io 

Polarity Web doesn't start

This section will walk through what to do if the polarity_web container is not starting or is just constantly restarting: 

The first thing to do is to check the /app/.env file to ensure the hostname is set correctly: 

  1. Open the /app/.env file for editing.
  2. Check that the following lines are set to the correct FQDN for your server:
POLARITY_HOSTNAME={{Correct Hostname}}
POLARITY_WEB_HOSTNAME={{Correct Hostname}}

If the hostnames are all set, check the errors in the logs for the polarity_web container. The error will typically show at the end of the logs. 

docker logs polarity_web

If you are seeing an error like "Private Key does not match Public Key."  this typically indicates an issue with the SSL certificates causing the web container to fail to start. 

See the following page for more troubleshooting details: 

As always, please reach out to support@polarity.io for support.

Integration Store Errors  

Integration store fails to load

If the integration store is failing to load completely, there might be a few issues causing the problem. 

Check and ensure the global proxy is setup

See Configuring a Proxy for more details:

Check to ensure the polarity_web container can access the Integration Store

docker exec -it polarity_web bash
curl -v https://integration-store.polarity.io/api/repos

If there is a successful connection, please check the certificates to ensure they are valid and that the full CA cert chain is added to the server. 

Check and hostnames/IPs in the .env file 

If the Store is not loading or not downloading integrations then there can be a hostname/IP mismatch in the /app/.env file. Please check the /app/.env file to ensure the POLARITY_HOSTNAME and POLARITY_WEB_HOSTNAME variables are set correctly. 

Integration Store loads but fails to install integrations

If you are able to access the integration store, however are not able install integrations and are getting an error, then there is most likely a missing cert in the CA cert chain path. 

Recommend re-checking your CA certificates to ensure the full paths are contained. 

See the CA Certificate section in the guide below:

Docker images are loaded but still getting an error logging in

Postgres and Redis listening for Docker IP 

This is typically due to either Postgres or Redis not listening for the docker IP addresses. To check if this is occurring run the following commands: 

Check the Docker IP address: 

docker network inspect polarity_platform_net

Locate the "IPAM.Config" block to find the Gateway IP address (probably 172.18.0.1).

Once you have the IP address, run the following command to check and ensure Postgres and Redis are listening on the Docker Gateway IP: 

netstat -anptu | grep “LISTEN”

You are looking for the following lines: 

Postgres: {{gatewayIP}}:5432
Redis Metric Cache: {{gatewayIP}}:7379
Redis Integration Cache: {{gatewayIP}}:8379

If any of those lines are missing then we will need to add the Docker gateway IP to the configurations for Postgres or Redis. 

Edit the Postgres Config File

Open the /var/lib/pgsql/15/data/postgresql.conf file for editing to configure Postgres to listen for the Docker gateway IP: 

Locate the line that starts with "listen_addresses = ", and add the gateway IP: 

listen_addresses = ‘127.0.0.1,{{gatewayIP address}}’

Restart Postgres:

systemctl restart postgresql

Redis Not listening

If Redis is not listening on those ports, then the most likely issue is that Redis is not running.  Restart the Redis caches: 

systemctl restart polarity-integration-cache 
systemctl restart polarity-metrics-cache

Specific Error Troubleshooting

Integration Cache Connectivity Lost

If when searching for integrations you see the following integration error:

connection has been lost with the integration cache

the Integration Cache is likely not running, or Docker is unable to connect to it.

You can re-establish the connection by restarting both caches:

systemctl restart polarity-integration-cache 
systemctl restart polarity-metrics-cache

The above error typically occurs after a server reboot if the Docker service starts before the Redis and/or PostgreSQL services.  We recommend following this guide to ensure that the Redis cache services (including the integration cache) start after the Docker service on a server reboot to prevent this error from happening in the future:


Was this article helpful?