Parity-ethereum: WebSocket return 403 error code

Created on 13 Jan 2018  ·  10Comments  ·  Source: openethereum/parity-ethereum

Yesterday all was works fine, but today I have same error in 2 different nodes.
parity run with supevisor, command=/usr/bin/parity --unsafe-expose --mode active --jsonrpc-port 8545 --port 30302 --no-ancient-blocks --no-serve-light --snapshot-peers=25 --max-peers=100 --min-peers=50 --db-compaction ssd --pruning fast --jsonrpc-apis all --ws-interface all --jsonrpc-interface all --ui-interface all --cache-size 1024
I open in browser http://myip:8180 and enter token and see error in browser console errors like WebSocket return 403 code when trying to connect myip:8546
And also I see SW error DOMException { } index.6c4d7ef040.js:1:1282953

I try to use FF and Chrome. And yesterday all works fine...

I'm running:

  • Which Parity version?: 1.8.6
  • Which operating system?: Ubuntu
  • How installed?: via installer
  • Are you fully synchronized?: yes
  • Which network are you connected to?: ethereum
  • Did you try to restart the node?: yes

Request to WS

GET / HTTP/1.1
Host: ip:8546
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: ru,en;q=0.8,ru-RU;q=0.5,en-US;q=0.3
Accept-Encoding: gzip, deflate
Sec-WebSocket-Version: 13
Origin: http://ip:8180
Sec-WebSocket-Protocol: 7d2351962afc4aa288078812ab69ca8b966feb225d448e3d0ac8a903459308ed_1515836601
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: FIxZdpbDXbb3DgoJa9+zEw==
Connection: keep-alive, Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket

Responce:

HTTP/1.1 403 Forbidden
Content-Length: 49
Connection: close

iptables is empty

M2-config 📂 Z1-question 🙋‍♀️

All 10 comments

Solve it with --ws-hosts all --ws-origins all

So, UI stoped works today again with the same error...
parity --tracing off --min-peers 50 --max-peers 100 --ws-origins all --ws-hosts all --no-ancient-blocks --no-serve-light --jsonrpc-port 8535 --pruning fast --db-compaction ssd --jsonrpc-apis all --ws-interface myip --jsonrpc-interface myip --ui-interface all --cache-size 1024

netstat show 8546 port LISTEN
iptables empty
But when browser try to connect WS, it return 403 error and yesterday all works fine!

@famfamfam anything in Parity logs? What error do you get in the browser?

Where I can find parity logs?
Browser takes 403 error from WS server
Request

GET / HTTP/1.1
Host: ip:8546
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: ru,en;q=0.8,ru-RU;q=0.5,en-US;q=0.3
Accept-Encoding: gzip, deflate
Sec-WebSocket-Version: 13
Origin: http://ip:8180
Sec-WebSocket-Protocol: 6124770d009c239beadc27067ed404a268e346e23738643e2027a2409ae47f7c_1516352182
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: WqV//KnXaP5yaUR/8MA9Ug==
Connection: keep-alive, Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket

Responce

HTTP/1.1 403 Forbidden
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: default-src 'self';form-action 'none';block-all-mixed-content;sandbox allow-scripts;

You can find parity logs in the terminal that runs parity command. Most likely:

  1. The time is not in sync between client and server
  2. The signer token is invalid

parity runs in background with supervisor. In stderr out I see

2018-01-19 09:06:21 UTC Received old authentication request. (1516352781 vs 1516352774)
2018-01-19 09:06:21 UTC Blocked connection from http://ip:8180 using invalid token.
2018-01-19 09:06:21 UTC Received old authentication request. (1516352781 vs 1516352774)
2018-01-19 09:06:23 UTC Received old authentication request. (1516352783 vs 1516352775)
2018-01-19 09:06:23 UTC Blocked connection from http://ip:8180 using invalid token.
But Im use new token returned by "parity signer new-token"

I'm try to connect with private browser mode, but this not helped...

Please make sure the time is synchronized on the computer you run the browser and the server.

Do you mean timezones? Server UTC, my local timezone is UTC+4

Parity uses UTC time (no timezones), it just needs to be synchronized. Have a look at NTP. You can check if your time is correct at https://time.is

Thanks! Im resync my local time with time.windows.com and UI was opened success!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gaoxiangxyz picture gaoxiangxyz  ·  3Comments

tzapu picture tzapu  ·  3Comments

dukei picture dukei  ·  3Comments

barakman picture barakman  ·  3Comments

uluhonolulu picture uluhonolulu  ·  3Comments