gocryptfs: mariadb crashing since 2.5.0
I’m running the mariadb data directory (/var/lib/mysql/) inside a gocryptfs mount.
After upgrading to 2.5.0 I’m experiencing frequent crashes of the maridb process:
Process 39501 (mariadbd) crashed in page_cur_tuple_insert(page_cur_t*, dtuple_t const*,...
There might be an underlying problem with permissions or such since I’m getting errors for cronjobs which are calling php scripts inside a gocryptfs directory since 2.5.0, too.
Failed to open stream: Permission denied in ...
But these are way more rare than the crashes of the mariadb daemon.
Going back to 2.4.0 fixes both problems.
The gocryptfs mount is mounted throught the root account using the -allow_other flag. System is a Fedora 41 with the static binaries on ext4. I’m not sure how to debug this futher, since gocryptfs does not log anything in normal mode.
It looks somewhat similar to #892 but for me older versions are working.
Edit: Startet the mount with --debug. Waiting now for a crash to happen. Edit2: It seems (as mentioned in the issue above, too) as if --debug stops the crashes.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (12 by maintainers)
Commits related to this issue
- README: mention known issue #893 — committed to rfjakob/gocryptfs by rfjakob 2 years ago
- tests: add issue893.sh, a reproducer for #893 "mariadb crashing since 2.5.0" https://github.com/rfjakob/gocryptfs/issues/893 — committed to rfjakob/gocryptfs by rfjakob 2 years ago
- go.mod: downgrade golang.org/x/sys The commit https://github.com/golang/sys/commit/d0df966e6959f00dc1c74363e537872647352d51 unix: support all Setuid/Setgid and related syscalls on Linux" change... — committed to dumpmemory/gocryptfs by rfjakob 2 years ago
- syscallcompat: add thread_credentials.go & friends Private copies of per-thread Setreuid/Setegid/Setgroups. https://github.com/rfjakob/gocryptfs/issues/893 https://github.com/rfjakob/gocryptfs/issue... — committed to rfjakob/gocryptfs by rfjakob 2 years ago
- tests: root_test: add TestMain I will add more tests for https://github.com/rfjakob/gocryptfs/issues/893 soon, these will also use DefaultPlainDir. — committed to rfjakob/gocryptfs by rfjakob 2 years ago
- tests/root_test: add TestConcurrentUserOps and TestAsUserSleep Both work with golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a but break with golang.org/x/sys v0.30.0 https://github.com/rfja... — committed to rfjakob/gocryptfs by rfjakob 2 years ago
- syscallcompat: use our own Setgroups/Setregid/Setreuid wrappers x/sys v0.1.0 (https://github.com/golang/sys/commit/d0df966e6959f00dc1c74363e537872647352d51) breaks our usecase. Switch to our own wrap... — committed to rfjakob/gocryptfs by rfjakob 2 years ago
- test.bash: catch calls to unix.Seteuid and friends https://github.com/rfjakob/gocryptfs/issues/893 — committed to rfjakob/gocryptfs by rfjakob 2 years ago
Looks like https://github.com/golang/sys/commit/d0df966e6959f00dc1c74363e537872647352d51 broke it.
That did the trick. I got a crash, and also some
mkdir: Operation not permitted@glhughes123So this show be fixed for now, thanks to @johnassel for helping with tracking this down.
To fix this quickly I downgraded golang.org/x/sys to what it was in v2.4.0.
In the mid-term I will have to copy pre-https://github.com/golang/sys/commit/d0df966e6959f00dc1c74363e537872647352d51
Setreuid()into gocryptfs. Ugly, but I also cannot stay on an old version of golang.org/x/sys forever.@johnassel if you need a workaround I have set up my gocryptfs mounts to use a script that calls
runuser. This allows the system to mount as the owner (instead of root) with theallow_otherflag set (so other users can read/write) and seems to avoid the permission errors for me.For example:
and the fstab entry looks like:
/home/greg/bin/mount_crypt_ares_backups.sh#/backups/ares/home/.greg.crypt /backups/ares/home/greg fuse rw,user,auto,allow_other,x-systemd.requires=/mnt/storage0 0 0Here we go. Same “Operation not permitted” issue.