Skip to content

OCPBUGS-89330: Fix cache path to avoid /var/cache/dnf conflict - #145

Closed
ericahinkleRH wants to merge 1 commit into
openshift:mainfrom
ericahinkleRH:OCPBUGS-89330-fix-cache-path
Closed

OCPBUGS-89330: Fix cache path to avoid /var/cache/dnf conflict#145
ericahinkleRH wants to merge 1 commit into
openshift:mainfrom
ericahinkleRH:OCPBUGS-89330-fix-cache-path

Conversation

@ericahinkleRH

Copy link
Copy Markdown

Problem

On OpenShift 4.19.32, catalogd pods crash on startup with:

chmod /var/cache/dnf: operation not permitted

This happens because:

  1. Default cache directory is /var/cache/
  2. RHEL base image contains /var/cache/dnf owned by root
  3. Pod runs as non-root (UID 1001)
  4. EnsureEmptyDirectory() tries to chmod root-owned directories, which fails

Solution

Change default cache directory from /var/cache/ to /var/cache/catalogd to avoid conflicts with system directories.

Testing

  • Build and deploy with new default
  • Verify pod starts successfully
  • Verify catalog cache operations work correctly

Fixes: https://redhat.atlassian.net/browse/OCPBUGS-89330

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 27, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@ericahinkleRH: This pull request references Jira Issue OCPBUGS-89330, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Problem

On OpenShift 4.19.32, catalogd pods crash on startup with:

chmod /var/cache/dnf: operation not permitted

This happens because:

  1. Default cache directory is /var/cache/
  2. RHEL base image contains /var/cache/dnf owned by root
  3. Pod runs as non-root (UID 1001)
  4. EnsureEmptyDirectory() tries to chmod root-owned directories, which fails

Solution

Change default cache directory from /var/cache/ to /var/cache/catalogd to avoid conflicts with system directories.

Testing

  • Build and deploy with new default
  • Verify pod starts successfully
  • Verify catalog cache operations work correctly

Fixes: https://redhat.atlassian.net/browse/OCPBUGS-89330

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ericahinkleRH
Once this PR has been reviewed and has the lgtm label, please assign oceanc80 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

…/var/cache/dnf conflict

The default cache directory was /var/cache/, which caused chmod failures
when running as non-root (UID 1001) because the RHEL base image contains
/var/cache/dnf owned by root.

EnsureEmptyDirectory() attempts to chmod entries in the cache directory
to make them writable before deletion, but non-root users cannot chmod
root-owned directories, resulting in:
  'chmod /var/cache/dnf: operation not permitted'

Fix: Change default from /var/cache/ to /var/cache/catalogd to avoid
conflicts with system directories in the base image.
@ericahinkleRH
ericahinkleRH force-pushed the OCPBUGS-89330-fix-cache-path branch from a4c66f6 to 4dfd672 Compare July 27, 2026 16:23
@ericahinkleRH

Copy link
Copy Markdown
Author

/test all

@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@ericahinkleRH: No presubmit jobs available for openshift/operator-framework-catalogd@main

Details

In response to this:

/test all

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ericahinkleRH

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 27, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@ericahinkleRH: This pull request references Jira Issue OCPBUGS-89330, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@ericahinkleRH

Copy link
Copy Markdown
Author

Closing this PR - catalogd functionality was merged into operator-controller upstream, so the fix only needs to go there. See upstream PR: operator-framework/operator-controller#2835

@openshift-ci-robot

Copy link
Copy Markdown

@ericahinkleRH: This pull request references Jira Issue OCPBUGS-89330. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state.

Details

In response to this:

Problem

On OpenShift 4.19.32, catalogd pods crash on startup with:

chmod /var/cache/dnf: operation not permitted

This happens because:

  1. Default cache directory is /var/cache/
  2. RHEL base image contains /var/cache/dnf owned by root
  3. Pod runs as non-root (UID 1001)
  4. EnsureEmptyDirectory() tries to chmod root-owned directories, which fails

Solution

Change default cache directory from /var/cache/ to /var/cache/catalogd to avoid conflicts with system directories.

Testing

  • Build and deploy with new default
  • Verify pod starts successfully
  • Verify catalog cache operations work correctly

Fixes: https://redhat.atlassian.net/browse/OCPBUGS-89330

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants