Help Installing Percona Server for MongoDB - Openshift permission error


I followed the instructions here: Install on OpenShift - Percona Operator for MongoDB

I have installed the operator but when I try to install the Percona server I get the following error in the initial 2 pods:

{“t”:{“$date”:“2023-04-03T20:36:28.575+00:00”},“s”:“E”, “c”:“CONTROL”, “id”:20557, “ctx”:“initandlisten”,“msg”:“DBException in initAndListen, terminating”,“attr”:{“error”:“IllegalOperation: Attempted to create a lock file on a read-only directory: /data/db”}}

I have tried adding permissions to all the service accounts defined for the namespace including percona-server-mongodb-operator but with no luck.

I didn’t see any options to cr.yaml to possibly help setting the correct permission for the directory mentioned in the error but didn’t see anything.


This error usually happens when there is some permission issues with the storage.
What CSI do you use and what type of storage is backing it?

Check the file permissions for the directory /data/db. Ensure that the service accounts used by the MongoDB pods have write permissions to this directory.