Skip to content

Conversation

marceloneppel
Copy link
Member

@marceloneppel marceloneppel commented Sep 9, 2025

Issue

When using tmpfs for the temp storage, if we reboot the host machine, and later, after the charm starts again, it's not possible to create temporary objects, like temporary tables.

The reason is that after the reboot, the storage is mounted with wrong ownership and permissions (owned by root instead of _daemon_ and with permissions set to 755 instead of 700).

Solution

Fix the permissions when the charm starts again.

Follow-up PRs will be created to import this new version of the lib in the charms and also make the permissions of the directories consistent (700 everywhere).

The library version was bumped to 16.0.0 to later allow the possibility of having the 14.0.0 version being used by the PostgreSQL 14 charms common code.

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…ssions

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

# Conflicts:
#	tests/unit/test_postgresql.py
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.45%. Comparing base (3c33016) to head (c7eaa49).
⚠️ Report is 1 commits behind head on 16/edge.

❌ Your project status has failed because the head coverage (45.45%) is below the target coverage (70.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           16/edge      #10      +/-   ##
===========================================
+ Coverage    40.64%   45.45%   +4.81%     
===========================================
  Files            3        4       +1     
  Lines          780      792      +12     
  Branches        92       92              
===========================================
+ Hits           317      360      +43     
+ Misses         448      414      -34     
- Partials        15       18       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Comment on lines +18 to +20
user_database = pwd.getpwnam(SNAP_USER)
# Set the correct ownership for the file or directory.
os.chown(path, uid=user_database.pw_uid, gid=user_database.pw_gid)
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need to tweak in the future for k8s compatibility.

@marceloneppel marceloneppel merged commit cfb2956 into 16/edge Sep 11, 2025
6 of 7 checks passed
@marceloneppel marceloneppel deleted the temp-storage-permissions branch September 11, 2025 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants