Error: "Could not write test file..." when installing or upgrading to 5.9

When you install 5.9 or upgrade to 5.9 on Linux, you have to install PostgreSQL 14.9 as a prerequisite. If you don't complete all steps, you may encounter the following error message:

Could not write test file to validate postgresql-related permissions, check write access for 'collibra' user to /run/postgresql

Resolution

Clean installation

If the error appears during a clean installation of 5.9, make sure that:

  • You have installed PostgreSQL 14.9 correctly.
  • You have updated the PostgreSQL configuration file, this file must contain the following line:
    d /run/postgresql 2777 postgres postgres - -
  • You have restarted the server.
Tip 

Run the command ls -l /run, this should contain a line similar to the following line:

#correct permissions:
drwxrwsrwx.  2 postgres       postgres         40 Dec 20 07:51 postgresql

#wrong permissions:
drwxr-xr-x.  2 postgres       postgres         40 Dec 20 07:46 postgresql

Upgrade from 5.8.x to 5.9.x

If the error occurs when you upgrade from 5.8.x to 5.9.x, you have to update the permissions of the PostgreSQL 11 instance as follows before restarting the upgrade:

  1. Update the file /usr/lib/tmpfiles.d/postgresql-11.conf to set the correct permissions for some PostgreSQL 11 folders. Open the file for editing, for example with vim or nano.

    d /run/postgresql 2777 postgres postgres - -

    Important Do not use the chmod command on any directories or files, edit this configuration file instead.

  2. Reboot the server.
  3. Restart the upgrade to 5.9.
  1. Update the file /usr/lib/tmpfiles.d/postgresql-common.conf to set the correct permissions for some PostgreSQL 11 folders. Open the file for editing, for example with vim or nano.
    d /run/postgresql 2777 postgres postgres - -
  2. Reboot the server.
  3. Restart the upgrade to 5.9.
  1. Update the file /usr/lib/tmpfiles.d/postgresql-11.conf to set the correct permissions for some PostgreSQL 11 folders. Open the file for editing, for example with vim or nano.
  2. d /run/postgresql 2777 postgres postgres - -
  3. Reboot the server.
  4. Restart the upgrade to 5.9.