<!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->
I am trying to start bitcoin-core.daemon via
$ bitcoin-core.daemon -datadir=/home/user/.bitcoin -debug=1
Expected behavior
bitcoin-core.daemon should start. Or if it can't it should provide helpful output what the problem is
Actual behavior
Output is:
Error: Cannot write to data directory '/home/user/.bitcoin'; check permissions.
Looking on the filesystem everything seems fine:
$ ls -lah /home/user/.bitcoin
drwxrwx--- 3 user user 4,0K Nov 29 16:44 .
$ mkdir /home/user/.bitcoin/foo
$ echo $?
0
So I took a look, where the error message is actually produced in the source.
Digging deeper into DirIsWritable there seems to be a lack of any tracing or debugging.
Same with fsbridge - there is no handling of errno.
So it seems like the bitcoin binary has no way of providing any helpful information about the actual problem 😞 .
Now , since bitcoin-core is installed via stable snap channel one could assume a problem with some sort of security confinement. Thus I double checked in snap and bitcoin-core is allowed to modify the user directory (whatever this means in detail).
Since I am no expert in snap nor bitcoin I am not really sure how to get to any further.
To reproduce
- Install Ubuntu 20.04
- Install bitcoin-core via snap stable
- Try to start
bitcoin-core.daemon/home/user/.bitcoinis preexisting
System information
$ bitcoin-core.daemon -version
Bitcoin Core version v0.20.1
<!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->
<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->
Running a machine with x86_64