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

btc_init fails with Permission denied on bitcoin.conf creation #110

Open
nkuba opened this issue May 25, 2023 · 2 comments
Open

btc_init fails with Permission denied on bitcoin.conf creation #110

nkuba opened this issue May 25, 2023 · 2 comments

Comments

@nkuba
Copy link

nkuba commented May 25, 2023

When I'm trying to run a Docker container with --user 1000:1000 the btc_init script fails with /usr/local/bin/btc_init: line 13: /bitcoin/.bitcoin/bitcoin.conf: Permission denied error.

Does it require some additional configuration?

Sample output:

$ docker run --user 1000:1000 kylemanna/bitcoind
+ btc_init
+ '[' '!' -e /bitcoin/.bitcoin/bitcoin.conf ']'
+ mkdir -p /bitcoin/.bitcoin
+ echo 'Creating bitcoin.conf'
Creating bitcoin.conf
+ cat
++ dd if=/dev/urandom bs=33 count=1
++ base64
/usr/local/bin/btc_init: line 13: /bitcoin/.bitcoin/bitcoin.conf: Permission denied
@tonytech83
Copy link

I'm having the same problem.

docker:

docker run -d \
     -p 8333:8333 \
     -p 127.0.0.1:8332:8332 \
     --volume /mnt/test/bitcoind-data:/bitcoin/.bitcoin \
     --name bitcoind-node \
     --restart=unless-stopped \
     kylemanna/bitcoind

Output:

+ btc_init
+ '[' '!' -e /bitcoin/.bitcoin/bitcoin.conf ']'
+ mkdir -p /bitcoin/.bitcoin
+ echo 'Creating bitcoin.conf'
+ cat
Creating bitcoin.conf
++ dd if=/dev/urandom bs=33 count=1
++ base64
/usr/local/bin/btc_init: line 13: /bitcoin/.bitcoin/bitcoin.conf: Permission denied

@dasilvatek
Copy link
Contributor

@nkuba please check the permissions for the target folder allow user id 1000 write access - you may want to mount a volume to know exactly what folder is being used:
--volume /mnt/test/bitcoind-data:/bitcoin/.bitcoin

@tonytech83 please check your user id has write permissions to the folder and adjust as necessary - and you may want to specify the docker user if appropriate:
ls -lh /mnt/test |grep bitcoind-data
chmod u+w /mnt/test/bitcoind-data
docker run --user 1000:1000 ...

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

No branches or pull requests

3 participants