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

404 not found for WS connection on windows server #21525

Closed
Gdocal opened this issue Sep 7, 2020 · 3 comments · Fixed by #21646
Closed

404 not found for WS connection on windows server #21525

Gdocal opened this issue Sep 7, 2020 · 3 comments · Fixed by #21646
Assignees

Comments

@Gdocal
Copy link

Gdocal commented Sep 7, 2020

Hi, I can't do any RPC request to my node via WS. On an attempt to connect to it I got an error 404 not found. This issue occurs with the latest geth v1.9.20 on dedicated Server. At home, I have version 1.9.18 and it works fine with my code. I tried to connect to it locally and from home- the same issue. Node works fine via HTTP connection. I tried to change the port to other value, it didn't help.

My file of configuration:

[Node]
DataDir = "C:\\Eth Nodes\\Geth"
IPCPath = "geth.ipc"
HTTPHost = "0.0.0.0"
HTTPPort = 8081
HTTPVirtualHosts = ["localhost"]
HTTPModules = ["web3", "eth", "net", "db", "txpool", "admin"]
WSHost = "0.0.0.0"
WSOrigins = ["*"]
WSPort = 10000
WSModules = ["web3", "eth", "net", "db", "txpool", "admin"]
GraphQLVirtualHosts = ["localhost"]

System information

Geth version: v1.9.20
OS & Version: Windows Server 2019 Standart

Expected behaviour

ws connection should work

Actual behaviour

ws connection crashed with 404 error

UPD1:
I use c# library Nethereum, version 3.8.0 to communicate with geth

UPD2:
I think the issue is Connection header

Nethereum request looks like:

GET http://127.0.0.1:8888/ HTTP/1.1
Connection: Upgrade,Keep-Alive
Upgrade: websocket
Sec-WebSocket-Key: K+ysZX+D3PT+zeo6zzE4ig==
Sec-WebSocket-Version: 13
Host: 127.0.0.1:8888

strings.ToLower(r.Header.Get("Connection")) == "upgrade"

here code expects only one value

Nethereum can't modify the Connection header.

@Gdocal
Copy link
Author

Gdocal commented Sep 13, 2020

the line should be replaced to
strings.Contains(strings.ToLower(r.Header.Get("Connection")), "upgrade")
fixed issue for me

@adamschmideg
Copy link
Contributor

@Gdocal would you open a PR for this? So it will fix it for others, too ;)

@BisonAl
Copy link

BisonAl commented Sep 21, 2020

This is happening for me as well - though on linux.

Connecting to websocket worked with no issues on 1.9.13, but since upgrading tn 1.9.20 I'm also getting 404's back on requests like geth attach.

No nevermind actually, fell victim to #21441 - hadn't realized the websocket path was changed, there were no mentions in the release note :/

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

Successfully merging a pull request may close this issue.

5 participants