Permission denied error for redhat-operators pod in RHOCP 4
Environment
- Red Hat Openshift Container Platform 4
- Disconnected/Air-gapped Environment
Issue
-
Resulting
redhat-operatorcatalog pod with/configs/index.json: permission deniederror. -
In air-gapped/disconnected OpenShift installation,
redhat-operatorpods inopenshift-marketplaceproject does not start and fail with below error:
Error: load declarative config directory: open /configs/index.json: permission denied
Resolution
- Change umask to
0022on RHEL host machine whereoc mirrorcommands are working.
Note : Before setting umask value 022 please confirm with internal security team because all others have read access only to owner's files, and read/search access to owner's directories.
$ umask 0022
- If above umask value does not met with condition,
0077can be tried.- But depending on other security settings on the system this might not help with the issue
umask 0077assigns permissions so that only owner have read/write access for files, and read/write/search for directories owner own. All others have no access permissions to owner's files or directories.
$ umask 0077
- Check if the image has been build after the changes.
Root Cause
- The process to build catalog images significantly changed from the
RHOCP 4.10version ofoc-mirror(Tech Preview) to theRHOCP 4.11version , so the file permissions forindex.jsonhave been changed.
Diagnostic Steps
- Check if
redhat-operatorspods are withCrashLoopBackOffstate inopenshift-marketplaceproject :
$ oc get pods
NAME READY STATUS RESTARTS AGE
marketplace-operator-db78b9d5d-jznm7 1/1 Running 0 13d
redhat-operators-44qw8 0/1 CrashLoopBackOff 4 (52s ago) 2m32s
- Check logs of
redhat-operatorspod if fileindex.jsonis facing permission denied issue:
$ oc logs redhat-operators-8ms4f
Error: load declarative config directory: open /configs/index.json: permission denied
SBR
Product(s)
Tags
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.