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

java.lang.IllegalStateException: STREAMED: (GetRewardServlet.java:36) #5356

Closed
forfreeday opened this issue Jul 17, 2023 · 5 comments · Fixed by #5367
Closed

java.lang.IllegalStateException: STREAMED: (GetRewardServlet.java:36) #5356

forfreeday opened this issue Jul 17, 2023 · 5 comments · Fixed by #5367
Assignees

Comments

@forfreeday
Copy link
Contributor

System information

OS : Linux
JVM : Oracle 1.8
Version : 4.7.2
Commit hash: 9e95599
codeVersion: 18031

Expected behaviour

Returns normal results when requesting getReward interface.

curl --location 'http://$IP:$PORT/wallet/getReward' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'address='

result

{
    "reward": 0
}

Actual behaviour

When I request getReward interface, it returns an exception message, and it should return the correct result.

10:30:50.359 ERROR [qtp1946337255-186242] [API](GetRewardServlet.java:36)
java.lang.IllegalStateException: STREAMED
    at org.eclipse.jetty.server.Request.getReader(Request.java:1188)
    at org.tron.core.services.http.Util.getAddress(Util.java:496)
    at org.tron.core.services.http.GetRewardServlet.doGet(GetRewardServlet.java:23)
    at org.tron.core.services.http.GetRewardServlet.doPost(GetRewardServlet.java:46)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at org.tron.core.services.http.RateLimiterServlet.service(RateLimiterServlet.java:109)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
...

Steps to reproduce the behaviour

Requesting the GetRewardServlet interface

curl --location 'http://$IP:$PORT/wallet/getReward' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'address='

return error message

10:30:50.359 ERROR [qtp1946337255-186242] [API](GetRewardServlet.java:36)
java.lang.IllegalStateException: STREAMED
    at org.eclipse.jetty.server.Request.getReader(Request.java:1188)
    at org.tron.core.services.http.Util.getAddress(Util.java:496)
    at org.tron.core.services.http.GetRewardServlet.doGet(GetRewardServlet.java:23)
    at org.tron.core.services.http.GetRewardServlet.doPost(GetRewardServlet.java:46)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at org.tron.core.services.http.RateLimiterServlet.service(RateLimiterServlet.java:109)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
...
@vivian1912 vivian1912 added the topic: gRPC/HTTP api rpc/http related issue label Jul 17, 2023
@halibobo1205
Copy link
Contributor

In my view, this is not really a bug, it's due to passing invalid parameters, and there should be similar scenarios.

@forfreeday
Copy link
Contributor Author

This is not a bug, but it must also return normal information, not an exception.

@halibobo1205
Copy link
Contributor

@forfreeday Can you try to submit a PR and improve it?

@forfreeday
Copy link
Contributor Author

forfreeday commented Jul 20, 2023

@halibobo1205
Yes, I've fixed the issue and submitted this PR: #5367

@lxcmyf
Copy link
Contributor

lxcmyf commented Aug 16, 2023

@forfreeday
Does the optimized interface request support the application/x-www-form-urlencoded content-type?

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

Successfully merging a pull request may close this issue.

5 participants