Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPE-5915] Reduce pgdate permissions #759

Merged
merged 2 commits into from
Nov 7, 2024
Merged

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Nov 7, 2024

Replica units fail to initialize on Juju 3.6 due to too restrictive permissions rejected by initdb.

... FATAL: data directory "/var/lib/postgresql/data/pgdata" has invalid permissions
... DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).

Reducing permissions to the maximum accepted by initdb.

Tech details:
Previously in Juju 3.5, the old Pebble 1.10 ignored our 0770 and set 0750 => everything worked well.

In Juju 3.6-rc1, the new Pebble 1.16 shipped.
Meanwhile, the Pebble 1.12 has fixed mkdir.
As a result our 0770 is how set properly causing regression as PG/initdb accept 0750 maximum.

Fixes: #760
and https://warthogs.atlassian.net/browse/DPE-5915

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.65%. Comparing base (6f10bb9) to head (a58ba56).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #759   +/-   ##
=======================================
  Coverage   75.65%   75.65%           
=======================================
  Files          12       12           
  Lines        3110     3110           
  Branches      474      474           
=======================================
  Hits         2353     2353           
  Misses        614      614           
  Partials      143      143           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -668,6 +668,7 @@ async def test_discourse(ops_test: OpsTest):


@pytest.mark.group(1)
@pytest.mark.unstable
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indico test fails due to the DB charm blocking over running out of space on the volume. Disabling to fix in a separate PR.

@dragomirp dragomirp marked this pull request as ready for review November 7, 2024 13:09
@dragomirp dragomirp requested review from a team, taurus-forever, marceloneppel and lucasgameiroborges and removed request for a team November 7, 2024 13:10
@@ -903,7 +903,7 @@ def _create_pgdata(self, container: Container):
"""Create the PostgreSQL data directory."""
if not container.exists(self.pgdata_path):
container.make_dir(
self.pgdata_path, permissions=0o770, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP
Copy link
Contributor

Choose a reason for hiding this comment

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

For the history, it has been noticed on Sept 23 while working on Juju 3.6 beta testing, but left unrecognised in daily routine: 52271e1

TIL!

@dragomirp dragomirp merged commit ef6baf7 into main Nov 7, 2024
102 checks passed
@dragomirp dragomirp deleted the dpe-5915-permissions branch November 7, 2024 16:43
dragomirp added a commit that referenced this pull request Nov 8, 2024
* Reduce pgdate permissions

* Disable indico tests
dragomirp added a commit that referenced this pull request Nov 8, 2024
* Reduce pgdate permissions

* Disable indico tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants