Write detection lacking #20529

issue abergmeier opened this issue on November 29, 2020
  1. abergmeier commented at 4:21 PM on November 29, 2020: none

    <!-- 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/.bitcoin is 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

  2. abergmeier added the label Bug on Nov 29, 2020
  3. MarcoFalke commented at 12:50 PM on November 30, 2020: member

    To solve permission errors while using the Bitcoin Core snap, see https://snapcraft.io/docs/removable-media-interface . I.e. snap connect bitcoin-core:removable-media or snap connect bitcoin-core:home.

    On some systems, snap may not allow access to paths with . as first character.

  4. MarcoFalke closed this on Nov 30, 2020

  5. MarcoFalke locked this on Feb 15, 2022
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-03 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me