tronprotocol / trident

135 stars 109 forks source link

Trc20Contract transfer cause Error: 503 - Status: Service Temporarily Unavailable #98

Closed liuniuaaa closed 3 months ago

liuniuaaa commented 1 year ago

I used trident to apply trc20 contract transfer. I know TronGrid has IP frequency limits for all requests. But we apply no more than 100 Trc20Contract transfers per day and no more than 2 Trc20Contract transfers per minute. I think we didn't request frequently, but when my service ran a few hours later, the 503 problem would occur. If I restart my service, it would be ok, but a few hours the problem would occur again. Does trident has any other communication with trongrid cause this problem? Could you help me solve this problem?

ClarkChenc commented 1 year ago

hi,@liuniuaaa, do you have any log about such issues? Maybe it can help to find the reason. 503 error usually araises as exceeding TronGrid access limit :

Before your daily request amount is up, when using API KEY to access, the access frequency per second is limited to 15qps. If your requests exceed the daily amount, then your access frequency per second is 5qps. Either way, if you exceed the access frequency, a 503 error will be returned.

If you need more stable service, you can build your own node with the doc: https://github.com/tronprotocol/tron-deployment. May it help you.

liuniuaaa commented 1 year ago

UNAVAILABLE: HTTP status code 503 invalid content-type: text/html headers: Metadata(:status=503,server=openresty,date=Fri, 11 Aug 2023 02:36:19 GMT,content-type=text/html,content-length=52) DATA----------------------------- Error: 503 - Status: Service Temporarily Unavailable io.grpc.StatusRuntimeException: UNAVAILABLE: HTTP status code 503 invalid content-type: text/html headers: Metadata(:status=503,server=openresty,date=Fri, 11 Aug 2023 02:36:19 GMT,content-type=text/html,content-length=52) DATA----------------------------- Error: 503 - Status: Service Temporarily Unavailable at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262) at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243) at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156) at org.tron.trident.api.WalletGrpc$WalletBlockingStub.broadcastTransaction(WalletGrpc.java:5004) at org.tron.trident.core.ApiWrapper.broadcastTransaction(ApiWrapper.java:404) at org.tron.trident.core.contract.Trc20Contract.transfer(Trc20Contract.java:159)

please check the log.

ClarkChenc commented 1 year ago

UNAVAILABLE: HTTP status code 503 invalid content-type: text/html headers: Metadata(:status=503,server=openresty,date=Fri, 11 Aug 2023 02:36:19 GMT,content-type=text/html,content-length=52) DATA----------------------------- Error: 503 - Status: Service Temporarily Unavailable io.grpc.StatusRuntimeException: UNAVAILABLE: HTTP status code 503 invalid content-type: text/html headers: Metadata(:status=503,server=openresty,date=Fri, 11 Aug 2023 02:36:19 GMT,content-type=text/html,content-length=52) DATA----------------------------- Error: 503 - Status: Service Temporarily Unavailable at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262) at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243) at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156) at org.tron.trident.api.WalletGrpc$WalletBlockingStub.broadcastTransaction(WalletGrpc.java:5004) at org.tron.trident.core.ApiWrapper.broadcastTransaction(ApiWrapper.java:404) at org.tron.trident.core.contract.Trc20Contract.transfer(Trc20Contract.java:159)

please check the log.

There was nothing unusual about this process, it was a typical 503 error.

kaiweicai commented 4 months ago

I meet the problem same. I checked my code many times, I found I invoke the api for check the dicimals of contract and check the balance of user before invoking the transfers method. So I canceled the other method. It can works.

eodiandie commented 3 months ago

will close this issue, seems this issue has been resolved already.