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

SQLite error 3850 when exporting backup #5933

Open
link2xt opened this issue Aug 30, 2024 · 11 comments
Open

SQLite error 3850 when exporting backup #5933

link2xt opened this issue Aug 30, 2024 · 11 comments
Labels
bug Something is not working needs-retry

Comments

@link2xt
Copy link
Collaborator

link2xt commented Aug 30, 2024

User reports that Delta Chat desktop 1.46.5 installed from flathub fails to export backups into home directory. The error is displayed in a toast: "IMEX failed to complete: could not export database: failed to attach backup database: disk I/O error: Error code 3850: I/O error in the advisory file locking layer". The whole home directory has eCryptfs mounted from ~/.Private into ~. Underlying filesystem is ext4.

I have tried the same version of Delta Chat desktop from flathub and it successfully exports backups. I don't use ecryptfs though.

I have tried to reproduce the error by installing ecryptfs-utils, running modprobe ecryptfs, creating a new ~/.Private with ecryptfs-setup-private --nopwcheck --noautomount and mounting with ecryptfs-mount-private. Delta Chat desktop then successfully exports backup into ~/Private even if I run desktop with XDG_CONFIG_HOME=$HOME/Private/config to place account folder into ecryptfs as well.

I have not tried to run Delta Chat desktop inside flatpak and exporting into ecryptfs. Maybe there is some bad interaction between flatpak and ecryptfs. If this does not fails as well then I don't know how to reproduce the problem.

@link2xt link2xt added needs-retry bug Something is not working labels Aug 30, 2024
@link2xt
Copy link
Collaborator Author

link2xt commented Aug 30, 2024

This ecryptfs bugreport suggests ecryptfs implements advisory posix locks without forwarding to the underlying filesystem:
https://bugs.launchpad.net/ecryptfs/+bug/2012301

@iequidoo
Copy link
Collaborator

I use ecryptfs over btrfs with options rw,nosuid,nodev,relatime,ecryptfs_sig=[...],ecryptfs_fnek_sig=[...],ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs,user, just made a successful backup export from DC Desktop 1.46.6. Both the account folder and backup target folder are on ecryptfs.

@link2xt
Copy link
Collaborator Author

link2xt commented Aug 30, 2024

Looking at eCryptfs source code at https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ecryptfs, does not look like it cares about file locks at all. POSIX locks are probably handled independent of the FS and there is nothing special about eCryptfs.

Maybe probem is something else depending on the OS distribution used. Could be AppArmor or something like this, don't know.

@link2xt
Copy link
Collaborator Author

link2xt commented Sep 4, 2024

I even tried installing from flatpak and exporting into mounted Private/ folder with eCryptfs, it works.

@Matschepampe1312
Copy link

Heyyy,
first of all this is the first time I'm writing an bug report and I'm not super much into tech stuff, but a friend recommended me to write here.
So I basically have the same problem. Everytime I try to export a backup it says: "IMEX failed to complete: could not export database: failed to attach backup database: disk I/O error: Error code 3850: I/O error in the advisory file locking layer"

I'm using Linux Mint 23.1 Cinnamon on my Laptop and Delta Chat Desktop 1.46.8 (git: flathub).

If you have any questions to me that might help to solve the problem, just ask.

@iequidoo
Copy link
Collaborator

@Matschepampe1312, so you don't use eCryptfs? Could you run smth like flock -x local-lock-file echo 'a b c'? Better from the directory where you are trying to export a backup to. And maybe from the directory where you have the Delta Chat db as well.

@link2xt
Copy link
Collaborator Author

link2xt commented Sep 15, 2024

Original problem was also reported for Linux Mint btw, so maybe there is something special about Linux Mint in contrast to e.g. Ubuntu.

@Matschepampe1312
Copy link

@iequidoo Tbh I don't even know what eCrypfs is. But I do have a .ecryptfs directory. But I don't know what its for or what its doing. Like I said I'm not super much into tech stuff.
I tried the comand anyways but still cant export the backup, still shows the same thing as before when I tried.

@iequidoo
Copy link
Collaborator

Ok, it seems that Linux Mint uses eCryptfs for /home encryption if the user chooses this kind of encryption during the installation. Or used it in the past and now just supports it. @Matschepampe1312, but what was the command output, did it print a b c or smth else? Also, could you try to export a backup to another location, e.g. to your root directly (it shouldn't be eCryptfs-encrypted)?

@link2xt
Copy link
Collaborator Author

link2xt commented Sep 15, 2024

You can try exporting backup to /tmp

@Matschepampe1312
Copy link

@iequidoo Yes it prints a b c .
I also tried to export it to another location but it still doesnt work.
@link2xt Also doesnt work exporting it to /tmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working needs-retry
Projects
None yet
Development

No branches or pull requests

3 participants