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

503 Error: Service Unavailable #87

Open
TonyS001 opened this issue Aug 4, 2023 · 9 comments
Open

503 Error: Service Unavailable #87

TonyS001 opened this issue Aug 4, 2023 · 9 comments

Comments

@TonyS001
Copy link

TonyS001 commented Aug 4, 2023

I deploy the ton-http-api under the instruction in README. The validator.service is running on the same instance. When I use the api on the browser, it returns 503 Error as below:
20230804173159
When I run docker-compose logs, it shows:
20230804173351

@mitagmio
Copy link

the getTokenData method works on the TONCENTER/TON-HTTP-API, and if we deploy the API at home(
https://ton.optus.fi/jsonRPC
) from the repository (https://github.com/toncenter/ton-http-api) does not work.

https://toncenter.com/api/v2/jsonRPC
send data
{"id":1,"jsonrpc":"2.0","method":"getTokenData","params":{"address":"EQBynBO23ywHy_CgarY9NK9FTz0yDsG82PtcbSTQgGoXwiuA"}}

everyone responds well

{
"ok": true
"result": {
"total_supply": 1256732342639,
mintable: true
"jetton_content": {
"type": "onchain",
data: {
"image": "https://bridge.ton.org/token/1/0xdac17f958d2ee523a2206206994597c13d831ec7.png",
"uri": "https://bridge.ton.org/token/1/0xdac17f958d2ee523a2206206994597c13d831ec7.json",
decimals: "6"
}
},
"jetton_wallet_code": "te6cckECEwEAA4UAART/APSkE/S88sgLAQIBYgIDAgLLBAUAG6D2BdqJofQB9IH0gamjAgHOBgcCAVgKCwL3CDHAJJfBOAB0NMDAXGwlRNfA/Ad4PpA+kAx+gAxcdch+gAx+gAwc 6m0AALTHwHbPFsyNDQ0JIIQD4p+pbqaMGwiNl4xECPwGuAkghAXjUUZupswbCJeMhAkQwDwG+A3WzaCEFlfB7y6nwJxsPLSwFAjuvLixgHwHOBfBYAgJABE+kQwwADy4U2AAXIBP+DMgbpUwgLH4M9 4gbvLSmtDTBzHT/9P/9ATTB9Qw0PoA+gD6APoA+gD6ADAACIQP8vACAVgMDQIBSBESAfcBdM/AQH6APpAIfAB7UTQ+gD6QPpA1NFRNqFSLMcF8uLBKsL/8uLCVDRccFQgE1QUA8hQBPoCWM8WAc8WzMkiy MsBEvQA9ADLAMkgcAH5AHTIywISygfL/8nQBPpA9AQx+gAg10nCAPLixMiAGAHLBVAHzxZw+gJ3ActrgDgLzO1E0PoA+kD6QNTRCtM /AQH6AFFRoAX6QPpAU13HBVRzb3BUIBNUFAPIUAT6AljPFgHPFszJIsjLARL0APQAywDJcAH5AHTIywISygfL/8nQUA/HBR6x8uLDDPoAUcqhKbYIGaFQB6AYoSaSbFXjDSXXCwHDACHCALCAPEACqE8zIghAXjUUZ WAoCyx/LP1AH+gIizxZQBs8WJfoCUAPPFslQBcwjkXKRceJQB6gToAiqAFAEoBegFLzy4sUByYBA+wBDAMhQBPoCWM8WAc8WzMntVAByUmmgGKHIghBzYtCcKQLLH8s/UAf6AlAEzxZQB88WyciAEAHLBSfPFlAE +gJxActqE8zJcfsAUEITAHSOI8iAEAHLBVAGzxZQBfoCcAHLaoIQ1TJ221gFAssfyz/JcvsAklsz4kADyFAE+gJYzxYBzxbMye1UAOs7UTQ+gD6QPpA1NEF0z8BAfoAIcIA8uLC+kD0BAHQ05/RAd FRYqFSWMcF8uLBJsL/8uLCyIIQe92X3lgEAssfyz8B+gIjzxYBzxYTy5/JyIAYAcsFI88WcPoCcQHLaszJgED7AEATyFAE+gJYzxYBzxbMye1UgAIcgCDXIe1E0PoA+kD6QNTRBNMfAYQPIYIQ F41FGboCghB73ZfeuhKx8vTTPwEw+gAwE6BQI8hQBPoCWM8WAc8WzMntVINjFu1o=",
"contract_type": "jetton_master"
}
}

Doesn't work exactly when the token has "jetton_content": { "type": "onchain", .....}

https://ton.optus.fi/jsonRPC
sending POST data
{"id":1,"jsonrpc":"2.0","method":"getTokenData","params":{"address":"EQBynBO23ywHy_CgarY9NK9FTz0yDsG82PtcbSTQgGoXwiuA"}}

comes the answer
{
"ok": false
"error": "MsgAddressInt must have prefix 10 or 11 (but has bitarray('00'))",
code: 503
}

Config we use by default curl -sL https://ton-blockchain.github.io/global.config.json > private/mainnet.json

@aleksandrkaekhtin
Copy link

the getTokenData method works on the TONCENTER/TON-HTTP-API, and if we deploy the API at home( https://ton.optus.fi/jsonRPC ) from the repository (https://github.com/toncenter/ton-http-api) does not work.

https://toncenter.com/api/v2/jsonRPC send data {"id":1,"jsonrpc":"2.0","method":"getTokenData","params":{"address":"EQBynBO23ywHy_CgarY9NK9FTz0yDsG82PtcbSTQgGoXwiuA"}}

everyone responds well

{ "ok": true "result": { "total_supply": 1256732342639, mintable: true "jetton_content": { "type": "onchain", data: { "image": "https://bridge.ton.org/token/1/0xdac17f958d2ee523a2206206994597c13d831ec7.png", "uri": "https://bridge.ton.org/token/1/0xdac17f958d2ee523a2206206994597c13d831ec7.json", decimals: "6" } }, "jetton_wallet_code": "te6cckECEwEAA4UAART/APSkE/S88sgLAQIBYgIDAgLLBAUAG6D2BdqJofQB9IH0gamjAgHOBgcCAVgKCwL3CDHAJJfBOAB0NMDAXGwlRNfA/Ad4PpA+kAx+gAxcdch+gAx+gAwc 6m0AALTHwHbPFsyNDQ0JIIQD4p+pbqaMGwiNl4xECPwGuAkghAXjUUZupswbCJeMhAkQwDwG+A3WzaCEFlfB7y6nwJxsPLSwFAjuvLixgHwHOBfBYAgJABE+kQwwADy4U2AAXIBP+DMgbpUwgLH4M9 4gbvLSmtDTBzHT/9P/9ATTB9Qw0PoA+gD6APoA+gD6ADAACIQP8vACAVgMDQIBSBESAfcBdM/AQH6APpAIfAB7UTQ+gD6QPpA1NFRNqFSLMcF8uLBKsL/8uLCVDRccFQgE1QUA8hQBPoCWM8WAc8WzMkiy MsBEvQA9ADLAMkgcAH5AHTIywISygfL/8nQBPpA9AQx+gAg10nCAPLixMiAGAHLBVAHzxZw+gJ3ActrgDgLzO1E0PoA+kD6QNTRCtM /AQH6AFFRoAX6QPpAU13HBVRzb3BUIBNUFAPIUAT6AljPFgHPFszJIsjLARL0APQAywDJcAH5AHTIywISygfL/8nQUA/HBR6x8uLDDPoAUcqhKbYIGaFQB6AYoSaSbFXjDSXXCwHDACHCALCAPEACqE8zIghAXjUUZ WAoCyx/LP1AH+gIizxZQBs8WJfoCUAPPFslQBcwjkXKRceJQB6gToAiqAFAEoBegFLzy4sUByYBA+wBDAMhQBPoCWM8WAc8WzMntVAByUmmgGKHIghBzYtCcKQLLH8s/UAf6AlAEzxZQB88WyciAEAHLBSfPFlAE +gJxActqE8zJcfsAUEITAHSOI8iAEAHLBVAGzxZQBfoCcAHLaoIQ1TJ221gFAssfyz/JcvsAklsz4kADyFAE+gJYzxYBzxbMye1UAOs7UTQ+gD6QPpA1NEF0z8BAfoAIcIA8uLC+kD0BAHQ05/RAd FRYqFSWMcF8uLBJsL/8uLCyIIQe92X3lgEAssfyz8B+gIjzxYBzxYTy5/JyIAYAcsFI88WcPoCcQHLaszJgED7AEATyFAE+gJYzxYBzxbMye1UgAIcgCDXIe1E0PoA+kD6QNTRBNMfAYQPIYIQ F41FGboCghB73ZfeuhKx8vTTPwEw+gAwE6BQI8hQBPoCWM8WAc8WzMntVINjFu1o=", "contract_type": "jetton_master" } }

Doesn't work exactly when the token has "jetton_content": { "type": "onchain", .....}

https://ton.optus.fi/jsonRPC sending POST data {"id":1,"jsonrpc":"2.0","method":"getTokenData","params":{"address":"EQBynBO23ywHy_CgarY9NK9FTz0yDsG82PtcbSTQgGoXwiuA"}}

comes the answer { "ok": false "error": "MsgAddressInt must have prefix 10 or 11 (but has bitarray('00'))", code: 503 }

Config we use by default curl -sL https://ton-blockchain.github.io/global.config.json > private/mainnet.json

Works correctly with pytonlib version 0.0.50, change it in requirements.txt

@jiOnederfull
Copy link

Hey, I recommend you to try -> https://github.com/toncenter/ton-http-api/tree/v3

@airstring
Copy link

I deploy the ton-http-api under the instruction in README. The validator.service is running on the same instance. When I use the api on the browser, it returns 503 Error as below: 20230804173159 When I run docker-compose logs, it shows: 20230804173351

@TonyS001 How did you deal with this problem?

@sgrsaga
Copy link

sgrsaga commented Jul 2, 2024

@TonyS001 Did you managed to resolve this issue. I tried to link the public lite server mainnet configuration and it worked. So that means seems like issue in the local Lite server configuration. did you identify any solutions?

@COLUD4
Copy link

COLUD4 commented Jul 3, 2024

@TonyS001 Did you managed to resolve this issue. I tried to link the public lite server mainnet configuration and it worked. So that means seems like issue in the local Lite server configuration. did you identify any solutions?

I have the same problem, how did you solve it?
"error": "No working liteservers with ls_index=None, archival=None",
"code": 503

@vshybalov
Copy link

I was able to resolve it by installing ton-http-api directly with help of mytonctrl.

Launch mytonctrl, then installer, then create lite config by running clcf, and finally enable the api by running enable THA. If you are lucky enough, it will install the server without errors, it will be deployed as systemd service with name ton-http-api.
It should listen port 8000, you may check the service file. To see the list of available methods, go to the api port in the browser, it will open web interface.

@sidhys
Copy link

sidhys commented Sep 10, 2024

any updates anyone?

@a26nine
Copy link

a26nine commented Sep 11, 2024

any updates anyone?

By default, the exported config resolves to your server's public IP. There's a good chance that your firewall is blocking access to that IP directly, resulting in 503s from THA.

Check the liteservers details in your config. THA is unable to connect to it. I was able to fix it by connecting to the local liteserver instance on localhost using the value 2130706433— integer representation of 127.0.0.1.

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

No branches or pull requests

10 participants