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

Unexpected query response; status: 405 Method Not Allowed; response body: HTTP method not allowed #5297

Open
Shashank-765 opened this issue Jan 29, 2025 · 3 comments
Assignees
Labels
Bug Something isn't working

Comments

@Shashank-765
Copy link

OS and Environment

Ubuntu Docker Hub

GIT commit hash

587bad9, 2891a07

Minimum working example / Steps to reproduce

i have test with both commit branch
2891a07, 587bad9
but same issue

i am runninga iroha2 node it is running but not abale to all methods outside of the terminal either i am using sdk or running explorer backend and web both

Caused by:
Unexpected query response; status: 405 Method Not Allowed; response body: HTTP method not allowed

Actual result

i am runnig a node on local system but i got an error when i call using sdk or setup iroha2 backend explorer

request{method=POST path=/query version=HTTP/1.1 remote.addr=172.19.0.1:50916}: warp::filters::trace: unable to serve request (client error) status=405 error=Rejection(MethodNotAllowed)

Caused by:
Unexpected query response; status: 405 Method Not Allowed; response body: HTTP method not allowed

Location:
/home/user1/.cargo/git/checkouts/iroha-094ecd6d07a2c2f8/37ba88c/client/src/client.rs:230:26) http.method=GET http.route=/api/v1/blocks http.flavor=1.1 http.scheme=http http.host=127.0.0.1:4000 http.client_ip=127.0.0.1 http.user_agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 http.target=/api/v1/blocks?per_page=10 otel.name=HTTP GET /api/v1/blocks otel.kind="server" request_id=54a8d875-6bcb-4453-b7ca-ee8f72a5a5a3 exception.message=Internal Server Error exception.details=Internal(Unexpected query error

Expected result

responce should be in 200 code but not get

Logs

request{method=POST path=/query version=HTTP/1.1 remote.addr=172.19.0.1:50916}: warp::filters::trace: unable to serve request (client error) status=405 error=Rejection(MethodNotAllowed)

Caused by:
Unexpected query response; status: 405 Method Not Allowed; response body: HTTP method not allowed

Who can help to reproduce?

No response

Notes

No response

@Shashank-765 Shashank-765 added the Bug Something isn't working label Jan 29, 2025
@s8sato
Copy link
Contributor

s8sato commented Feb 3, 2025

Could you please provide detailed steps to reproduce the error so that we can reproduce and identify it? Also, be sure to list all relevant commits from all dependent repositories.

@Shashank-765
Copy link
Author

i have run node by cloning this directory
https://github.com/hyperledger-iroha/iroha/tree/v2.0.0-pre-rc.13.1

then i have setup backend explorer and fontend explorer
https://github.com/soramitsu/iroha2-block-explorer-web/tree/master
https://github.com/soramitsu/iroha2-block-explorer-backend/tree/master
and also i have run api using sdk

"@iroha2/client": "^7.0.0",
"@iroha2/crypto-core": "^1.1.1",
"@iroha2/crypto-target-bundler": "^1.1.1",
"@iroha2/crypto-target-node": "^1.1.1",
"@iroha2/crypto-target-web": "^1.1.1",
"@iroha2/data-model": "^7.0.0",
"hada": "^0.0.9",
"iroha-lib": "^0.1.9"

when i run the scrypt
then i got an error of query of and method

request{method=POST path=/query version=HTTP/1.1 remote.addr=172.19.0.1:50916}: warp::filters::trace: unable to serve request (client error) status=405 error=Rejection(MethodNotAllowed) #5293

@0x009922 0x009922 self-assigned this Feb 14, 2025
@0x009922
Copy link
Contributor

0x009922 commented Feb 17, 2025

Hi @Shashank-765

This all seems confusing. A few points:

  • You are running Iroha pre-rc.13
  • You have JS SDK @iroha2/client & @iroha2/data-model of version ^7, which target pre-rc.20
  • You have Explorer from master, which targets pre-rc.9

So, I guess that could be simply an issue of version mismatch. The "Method Not Allowed" error is confusing and misleading. My guess is that the explorer in your case submits a POST /query request with a body with different encoding than what Iroha expects, and so Iroha fails to find a "matching route".

A solution in your case would definitely be using the matching versions of each project (iroha, explorer, iroha js). I would strongly advise you to migrate to rc.1 altogether though. It is a more stable release, actively maintained, and has support from the Explorer and Iroha JS.

Here are some links:

Let me know if this answer works for you or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants