2

I have had a website running a solana web3 app on mainnet for some time now. I went to make some updates and found that nothing loaded, and upon investigating further I found I was just immediately getting hit with the following errors:

POST https://api.mainnet-beta.solana.com/ 403 Error: failed to get info about account 77k4yGn6V8gDszdKMTvjwBSLiJAUHbNB493wEXMEiqfP: Error: 403 : {"jsonrpc":"2.0","error":{"code": 403, "message":"Access forbidden, contact your app developer or [email protected]."}, "id": "fa2fdafb-ecb7-468f-aede-347dc56e6ffa" }

POST https://api.mainnet-beta.solana.com/ 403 Error: failed to get info about account FxVpjJ5AGY6cfCwZQP5v8QBfS4J2NPa62HbGh1Fu2LpD: Error: 403 : {"jsonrpc":"2.0","error":{"code": 403, "message":"Access forbidden, contact your app developer or [email protected]."}, "id": "0f665802-ac9e-4edd-8e4d-070925357195" }

etc.

What I don't understand is that if I connect to the mainnet rpc via python and call get_account_info for these addresses it all works fine. Could it be that there has been some version update that has broken this somehow? I'm not even really sure how to investigate further. Apps running on the same site but on devnet all work fine, so it just seems to be a mainnet issue.

Edit: I tried loading the page from a totally different IP address but get the same issue, once again accessing the rpc end point from python works fine..

Right now the web app just does the following to connect, is this not correct anymore?

const network = 'mainnet-beta';
const endpoint = web3.clusterApiUrl(network);
const wallets = useMemo(() => 
[
    getPhantomWallet(),
    getSolflareWallet(),
    getSolletWallet({ network }),
    getSolletExtensionWallet({ network }),
],
[network]
);

Many Thanks

2 Answers 2

1

Firstly, rate limiting is very aggressive on mainnet-beta, so it's typically not a good idea to use it for production purposes. I even find it unusable for testing purposes.

That being said, a 403 doesn't indicate that you're being rate limited, but that access to the endpoint has been blocked from your IP.

Check it out in their docs: https://docs.solana.com/cluster/rpc-endpoints#common-http-error-codes

1
  • I was confused as to why this worked from python then, it must be the same ip address, so I would have thought it would be blocked both for python and javascript.
    – daoplays
    Commented Nov 28, 2022 at 12:22
0

The public mainnet beta endpoints aggressively block requests with a CORS header, meaning requests from a browser. When you run it with Python, those CORS headers aren't present, so the endpoints are more permissive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.