Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

--config flag with custom path doesn't work on new release. #9791

Closed
vietthang207 opened this issue Oct 22, 2018 · 9 comments
Closed

--config flag with custom path doesn't work on new release. #9791

vietthang207 opened this issue Oct 22, 2018 · 9 comments
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue.
Milestone

Comments

@vietthang207
Copy link

Before filing a new issue, please provide the following information.

  • Parity Ethereum version: 2.0.7
  • Operating system: Linux
  • Installation: docker
  • Fully synchronized: yes
  • Network: ethereum & ropsten ...
  • Restarted: yes

Your issue description goes here below. Try to include actual vs. expected behavior and steps to reproduce the issue.

I've encounter this error from version 2.0.7 and above:
Oct 22 06:58:23 ip-172-31-43-223 docker[8992]: There was an error reading your config file at: /root/.local/share/io.parity.ethereum/config.toml
Oct 22 06:58:23 ip-172-31-43-223 docker[8992]: Config doesn't match any presets [dev, mining, non-standard-ports, insecure, dev-insecure]

My parity config is put at /var/lib/parity-ethereum/config.toml
I ran parity using a systemd service:

[Unit]
Description=Parity Ethereum Node
After=docker.service
Requires=docker.service

[Service]
Restart=on-failure
ExecStart=/usr/bin/docker run --name parity-ethereum \
                              --publish 8545:8545 \
                              --publish 30303:30303 \
                              --publish 30303:30303/udp \
                              --volume /var/lib/parity-ethereum/:/root/.local/share/io.parity.ethereum/ \
                              parity/parity:v2.0.7 \
                              --config /root/.local/share/io.parity.ethereum/config.toml \
                              --base-path /root/.local/share/io.parity.ethereum/
ExecStop=/usr/bin/docker stop -t 10 parity-ethereum
ExecStopPost=/usr/bin/docker rm -f parity-ethereum

[Install]
WantedBy=default.target

Which is basically equivalent to this command:
docker run --name parity-ethereum
--publish 8545:8545
--publish 30303:30303
--publish 30303:30303/udp
--volume /var/lib/parity-ethereum/:/root/.local/share/io.parity.ethereum/
parity/parity:v2.0.7
--config /root/.local/share/io.parity.ethereum/config.toml
--base-path /root/.local/share/io.parity.ethereum/

I've tried docker tags stable, v2.0.7, v2.0.8, they all shows the same error. I've also tried v2.1.2 and 2.1.3 (which I believe are beta versions).

When I switch to v2.0.6, parity works fine and being able to synchronize without error. I think some how --config flag assume that I use a preset despite the fact that it is a custom config path.

@ddorgan
Copy link
Collaborator

ddorgan commented Oct 22, 2018

@vietthang207 can you chown the data files and ensure they're owned by the user who's running the container and not the root user. Parity now runs as a non-root user in the container.

@amaurer
Copy link

amaurer commented Oct 22, 2018

I've added an issue regarding the uid used for parity which causes issues for host mounted volumes.

  1. User uid 1000 will need access to the volume mounted to the host.
  2. I had an issue with the config.toml file living in the same directory as the mounted path. I moved it out and used -c /path/to/config.toml the CMD line of my own Dockerfile
  3. If using --config/-c - specify the basePath (which I see you are) it seems to get lost.

Just some suggestions as I've spent many hours debugging this, this past weekend.

@jam10o-new
Copy link
Contributor

jam10o-new commented Oct 22, 2018 via email

@Tbaut Tbaut added the F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. label Oct 22, 2018
@Tbaut Tbaut added this to the 2.2 milestone Oct 22, 2018
@vietthang207
Copy link
Author

vietthang207 commented Oct 23, 2018

@ddorgan @joshua-mir @amaurer I don't think this is the root cause of this problem as the permission of the directories are 0755, and of config.toml is 0644, so I'm sure that everyone can read them.

Update: Also I've ran docker as root.

@jam10o-new
Copy link
Contributor

@vietthang, you are mounting the docker volume as root (inside the docker container), while the parity executable (inside the container) is running as user parity/uid 1000. It wouldn't matter what permissions these files have outside of the container.

@ddorgan
Copy link
Collaborator

ddorgan commented Oct 25, 2018

@vietthang207 did correcting the permissions help with this issue?

@vietthang207
Copy link
Author

vietthang207 commented Oct 26, 2018

@ddorgan @joshua-mir Thank you, I didn't notice that the destination path is /root. I changed it to /home/parity/io.parity.ethereum and it works fine on 2.0.7 and 2.0.8.

@ddorgan
Copy link
Collaborator

ddorgan commented Oct 26, 2018

@vietthang207 ok great, closing the issue.

@ddorgan ddorgan closed this as completed Oct 26, 2018
@nihalmpatel
Copy link

I'm having the same issue on 2.1.3 using:

docker run -ti --name ethereum-node --restart=always -v ~/.local/share/io.parity.ethereum/docker/:/home/parity/.local/share/io.parity.ethereum/ -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp parity/parity:v2.1.3 --ui-interface all --jsonrpc-interface all --pruning fast --base-path /home/parity/.local/share/io.parity.ethereum/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue.
Projects
None yet
Development

No branches or pull requests

6 participants