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

Websocket HTTP/1.1 405 error (sui release >= 1.28) #18429

Closed
mario4tier opened this issue Jun 26, 2024 · 5 comments
Closed

Websocket HTTP/1.1 405 error (sui release >= 1.28) #18429

mario4tier opened this issue Jun 26, 2024 · 5 comments
Assignees
Labels
cli Command line tools

Comments

@mario4tier
Copy link

Steps to Reproduce Issue

Expected Result

Successful Websocket connection to "sui start" process from Rust code.

Actual Result

HTTP status code 405 is always returned when trying to open the connection.

This was working for a long time, and it started to fail with release 1.28

The following tests were all done today with the same Rust backend code, the only change is the sui binary version

Verified Broken
sui 1.28.0-6a179c58a848 (devnet branch, pre-compiled Mysten assets)
sui 1.29.0-45877014d1e2 (today's Mysten main branch, my own cargo build)

Verified No Problem
sui 1.27.0-19df63a5441d (devnet branch, pre-compiled Mysten assets)
sui 1.27.2-9e2be6ad4185 (testnet branch, pre-compiled Mysten assets)

System Information

Ubuntu, rustc 1.73
tokio-tungstenite 0.21 (websocket library)

Code and Logs

Related code calling into tungstenite::connect:
image

[2024-06-26T20:19:22Z INFO suibase_daemon::workers::websocket_worker] Connecting to "ws://0.0.0.0:9000"

[2024-06-26T20:19:23Z ERROR suibase_daemon::workers::websocket_worker] connect_async error: Http(Response { status: 405, version: HTTP/1.1, headers: {"access-control-allow-origin": "*", "vary": "origin", "vary": "access-control-request-method", "vary": "access-control-request-headers", "allow": "POST", "content-length": "0", "date": "Wed, 26 Jun 2024 20:19:22 GMT"}, body: Some([]) })

@stefan-mysten
Copy link
Contributor

Thanks for flagging this. I'll have a look as soon as possible.

Just to verify, you are running a local network, correct?

@stefan-mysten stefan-mysten added the cli Command line tools label Jun 26, 2024
@stefan-mysten stefan-mysten self-assigned this Jun 26, 2024
@mario4tier
Copy link
Author

mario4tier commented Jun 26, 2024

Just to verify, you are running a local network, correct?

Correct.
A "sui start" process listening on 0.0.0.0:9000

@stefan-mysten
Copy link
Contributor

Cool, thanks. I will try to look at it a bit later today and get back to you.

@mario4tier
Copy link
Author

Found something.

It seems that websocket support is being deprecated for JSON-RPC and the change 0fba424 defaults to "HTTP only" service.

I assume this is to nudge people to integrate with GraphQL instead. Once you confirm, you can close this issue (my solution being to make GraphQL works for localnet...).

@stefan-mysten
Copy link
Contributor

Yes, I suspected that might be the case but had a few things on my plate until now. Feel free to open another issue if you are encountering issues with GraphQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command line tools
Projects
None yet
Development

No branches or pull requests

4 participants