Skip to content

chown the definitions to the rabbit user after our script edits them#3735

Merged
MoralCode merged 1 commit intomainfrom
fix/rabbit_build_permissions
Mar 4, 2026
Merged

chown the definitions to the rabbit user after our script edits them#3735
MoralCode merged 1 commit intomainfrom
fix/rabbit_build_permissions

Conversation

@MoralCode
Copy link
Copy Markdown
Collaborator

Description

  • This makes a small adjustment to our container build order for rabbitmq such that the permissions are changed after our script that adjusts rabbit config is run

This PR fixes #3734

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Adrian Edwards <adredwar@redhat.com>
@MoralCode MoralCode added the containers Related to augur in containers, container images, or the compose file, either in podman or in docker label Feb 24, 2026

RUN exec python3 update_config.py

RUN chown rabbitmq:rabbitmq /etc/rabbitmq/definitions.json
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the issue is that update_config.py cannot write to definitions.json ... just trying to wrap my head around whether or not this "should" work.

Given this error:

PermissionError: [Errno 13] Permission denied: '/etc/rabbitmq/definitions.json'
Error: building at STEP "RUN exec python3 update_config.py": while running runtime: exit status 

it would seem like /etc/rabbitmq, if owned by the rabbitmq user, would then allow for the definitions.json file to be written.

I have not tested this, just thinking about the logic I see, @MoralCode .

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would again seem to me that changing permissions on a file that can't be written won't work ... but this may be something I don't understand.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you asking?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the file can't be written due to permissions issues adjusting the permissions seems like it would help

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the file already exist though?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's in the same folder as the Dockerfile. I think one of the previous Dockerfile steps is that we copy the file into the container before we run this script to make the final adjustments to it.

The problem here is essentially that if we run this chown line before we run the script that changes the file, we change the permissions such that the script can no longer edit the file, causing the crash.

I still need to run some builds with this new ordering of the build steps to make sure that the problem goes away, but I'm pretty confident that this is what's happening.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you comfortable its working?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@MoralCode
Copy link
Copy Markdown
Collaborator Author

can confirm this fixes the build on my machine. will run it while testing other stuff to make sure rabbit behavior is unchanged as anticipated

@MoralCode MoralCode added the ready Items tested and seeking additional approvals or a merge. Usually for items under active development label Mar 2, 2026
@MoralCode MoralCode moved this to Dev Testing in Augur TSC Mar 2, 2026
@MoralCode MoralCode added this to the v0.93.0 milestone Mar 4, 2026
@MoralCode MoralCode requested a review from shlokgilda March 4, 2026 20:49
Copy link
Copy Markdown
Collaborator

@shlokgilda shlokgilda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MoralCode
Copy link
Copy Markdown
Collaborator Author

MoralCode commented Mar 4, 2026

This is a relatively important as it would likely prevent a newcomer from successfully building the container. But its also simple, well tested fix that only affects container users. Merging (bypass), especially since its been pretty well tested and restores the intended behavior of the rabbit config editing script

@MoralCode MoralCode merged commit b277c0a into main Mar 4, 2026
24 of 25 checks passed
@github-project-automation github-project-automation bot moved this from Dev Testing to Main in Augur TSC Mar 4, 2026
@MoralCode MoralCode deleted the fix/rabbit_build_permissions branch March 4, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

containers Related to augur in containers, container images, or the compose file, either in podman or in docker ready Items tested and seeking additional approvals or a merge. Usually for items under active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

podman: Rabbit config update script doesnt have permissions to modify the config file

3 participants