Parity-ethereum: Docker. Unable to make a connection to the Parity Secure API

Created on 13 Sep 2017  ·  19Comments  ·  Source: openethereum/parity-ethereum

I'm running:

  • Parity version: v1.7.2
  • Operating system: Linux/Docker
  • And installed: official docker image

Can't connect form Chrome on one PC(Windows 10) to docker container on another PC(Ununtu server 16.04) in the same LAN started by command:
docker run -d -p 8180:8180 -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp --restart=always parity/parity:beta --ui-interface all --jsonrpc-interface all

I tried also:
--nat extip:192.168.... NOT WORK
token from "parity signer new-token" NOT WORK
token from "cat /root/.local/share/io.parity.ethereum/signer/authcodes" NOT WORK

Chrome always shows me "Unable to make a connection to the Parity Secure API"

M2-config 📂 Z1-question 🙋‍♀️

Most helpful comment

I think the issue might be invalid host headers being sent or disallowed origing. Can you try with --unsafe-expose instead of --ui-interface all --jsonrpc-interface all and see if it works?

All 19 comments

@AlexVN74 Can you start the node with -lsigner=trace and post the logs here?
Could you also make sure that the time is synchronized on both machines?

Time is synchronized, but timezone was different - fixed in docker container
Restarted with -lsigner=trace
docker run -d -p 8180:8180 -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp --restart=always parity/parity:beta --ui-interface all --jsonrpc-interface all -lsigner=trace

Where I can get logs? Command "docker logs ..." shows no new information

Try docker attach ...

I think the issue might be invalid host headers being sent or disallowed origing. Can you try with --unsafe-expose instead of --ui-interface all --jsonrpc-interface all and see if it works?

--unsafe-expose WORKS!
Is it correct to use parity with this option?

The same problem here! I'm unable to get through Parity Secure API.

docker run -ti -v ~/.local/share/io.parity.ethereum/docker/:/root/.local/share/io.parity.ethereum/ -p 8180:8180 -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp parity/parity:v1.7.2 --base-path /root/.local/share/io.parity.ethereum/ --ui-interface all --jsonrpc-interface all

@tomusdrw Your hint does work! However, I'm also interested in @AlexVN74 question.

This option is UNSAFE and should be used with great care!

Now that you know this works for you, you should disable it again and play around with all interfaces and allow your host.

--ui-hosts $HOSTS \
--jsonrpc-hosts $HOSTS \
--ws-hosts $HOSTS \
--ui-interface $IP \
--jsonrpc-interface $IP \
--ws-interface $IP

Where $IP is your docker interface IP(s) and $HOSTS is your local interface IP(s). This can be tricky to figure out the exact working configuration. If unsure set everything to all and limit the settings step by step to your exact interfaces/hosts until everything works.

It's not recommended to run a node with all or --unsafe-expose.

Great!

Now that we know that --unsafe-expose works (unsecurely) around the problem, do we know why there is a difference between expectation and reality in the headers? This problem seems to be specific to Parity running inside Docker. (I'm having exactly the same issue.)

It's fine to run with --jsonrpc-interface all --ui-interface all --ws-interface all inside docker container. For additional security you can limit what external address can be used to access the node using --*-hosts options.
So for instance if you use http://localhost:8180 to open Parity Wallet on the host machine you should set:
--ui-hosts localhost:8180 --jsonrpc-hosts localhost:8545 --ws-hosts localhost:8546

in Docker there are still problems for the new-token signer

  synchronize the clock and timezone

I execute
```
docker run -itd --restart on-failure:5 --name paritydev \
-p 8545:8545 -p 30303:30303 -p 8180:8180 parity/parity:beta\
--chain dev --jsonrpc-interface all --ui-interface all \
--force-ui --ui-port 8180 --rpcaddr 0.0.0.0 \
--rpcapi web3,eth,net,personal,parity,parity_set,traces,rpc,parity_accounts,signer \
--geth --rpccorsdomain="*" --jsonrpc-port 8545 \
--min-peers 10 --max-peers 25 --keys-path /build/keys \
--identity devid -lsync,signer=trace,discovery=warn --log-file /var/log/devid.log

```

to have a code I do
/parity/parity --chain dev --ui-interface 0.0.0.0 signer new-token

And with all that not open to me the message continues to appear
Unable to make a connection to the Parity Secure API. To update your secure token or to generate a new one, run parity signer new-token and paste the generated token into the space below.

you could reopen the issue @5chdn

You are missing the websocket ports. -p 8546:8546

Please see https://github.com/paritytech/parity/wiki/Docker

For me it does not work even have -p 8546:8546, I still stuck with this page
image

command is

 docker run -ti -p 8180:8180 -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp parity/parity:v1.7.0 --ui-interface all --jsonrpc-interface all   

@boshido try with --ws-interface all

I am getting the same error. Can you please help me out how to solve this issue?

What have you tried so far?

--jsonrpc-apis all --jsonrpc-hosts all --ui-hosts=all --jsonrpc-interface all --ui-interface all --ws-interface all --ui-no-validation

I used all the options above. Still getting the same issue.

Resolved. Thanks.

@mehemmedv how?

I followed this: http://balticdatascience.com/2017/11/16/how-to-create-your-own-blockchain/
and used all of the following options: --jsonrpc-apis all --jsonrpc-hosts all --ui-hosts=all --jsonrpc-interface all --ui-interface all --ws-interface all --ui-no-validation

Was this page helpful?
0 / 5 - 0 ratings

Related issues

m-thomson picture m-thomson  ·  3Comments

0x7CFE picture 0x7CFE  ·  3Comments

dukei picture dukei  ·  3Comments

jurijbajzelj picture jurijbajzelj  ·  3Comments

tzapu picture tzapu  ·  3Comments