Skip to main content
This page describes what to do in case of an Icinga alert. For more information you could search the govuk-puppet repo for the source of the alert
Last updated: 5 Apr 2022

Unknown error with postgresql in mapit

We have seen an error previously where postgresql services appear to have failed on the mapit server, yet calling a restart command for the service does not seem to fix the issue.

This document is intended on pointing you in the right direction should this occur again.

Are you sure postgresql is running?

Check the status of the service with

$ sudo service --status-all

If postgresql is not running, attempt

$ sudo service postgresql start

Check the status again. If it’s still not running…

Using puppet to find errors

You can usually find if there is a bigger issue by running

$ sudo govuk_puppet --test

Previously we have found that somehow, somewhen, postgresql was uninstalled (or perhaps not correctly initialised) on the mapit box, preventing some tests from completing (typically those relying on the database for items such as postcodes) with no clear reason.

If you ensure that you follow any extra steps as needed upon running the above puppet command - such as installing dependencies manually to assist in govuk_puppet installing the correct gems - you may find the errors will disappear upon a subsequent run of the above command.


You may find that there are permission errors on the /var/run/postgresql/ directory. You can solve this by calling

$ sudo chown postgres:postgres /var/run/postgresql/