Suddenly getting 403 forbidden error

Using go-ethereum to connect to rinkeby testnet but getting:
websocket: bad handshake (HTTP status 403 Forbidden)

code snippet:

client, err := ethclient.Dial(“wss://rinkeby.infura.io/ws”)

The code simply returns me a websocket client object using which I can perform transactions. It was working properly till yesterday.

Hello @rsjethani , the solution is to set up go-ethereum to use your API key, which has to be v3 . You can follow the Getting Started guide here to create your v3 API key.

Thanks for your reply, but how it worked earlier? and not now?? also the error is only coming when using websocket api, with http api it is working

The generic API endpoint was deprecated in July 2018 and removed today. Here’s a post describing in more detail: https://status.infura.io/#past-incidents

OH!! thanks for that.

Hi I have the same problem. Yesterday (10 feb 2020) I started to get error 403 when getting new blocks and transactions. I had no problem before. I use v3. My access token is 11 month old.
I still continue to receive block headers but suddenly getting error 403 for any request (block or transactions).
I tried to create a new access_token without a difference.
Any idea ?
Thanks

Hi @jfjobidon can you provide us with the full body of the 403 HTTP error response you’re getting?

We’re having the same problem. I updated the endpoint but it still isn’t working.

@pfaffian can you provide the code you are using that is resulting in this error?

or using the mainnet RPC url of

should definitely be working. If not, can you share connection URL you are using?

Hi @Sean_Infura, we are also getting the same issue (getting 403 on the “https://rinkeby.infura.io/v3/<INFURA_KEY>”. It started some days ago as well. Should we generate new API keys?

Hey @Dario_Varela , do you have a contract whitelist setup? If do, can you try disabling that?

Hey @Sean_Infura, we don’t have contract whitelist enabled.

I am receiving a 403 error too. When trying to access 6105303 on rinkeby with my api key set. Any pointers on what the issue could be?

Hi @tarrenceva can you provide the full error body and the code you’re using that is generating the error?

Hi @mike, im trying to load the block through graphprotocol. So im not sure the raw error. This is what is logged

graph-node_1  | Mar 11 20:53:19.578 DEBG Trying again after eth_call RPC call failed (attempt #8) with result Err(Web3Error(Transport("Unexpected response status code: 403 Forbidden"))), block_hash: 0xfa4af49a60768cf6c8d66c9a170f5ee9a361a3c7218d35c02a0c72ac55cde996, block_number: 6105303, subgraph_id: QmUTzoo3VKXhZjvHa3PHNQTXMEHeFJELfDRzicnhuaQGsS, component: SubgraphInstanceManager

Hi @tarrenceva . I’m not able to reproduce this without knowing more about how you are configuring and running your graph-node perhaps the Graph Protocol team can provide more insights into what their node is doing. My initial thought is that the graph node is attempting to access archival state data (blocks older than 128 from the head of the chain). Because of the significant resources archival nodes require, access to archival state on Infura requires our archival data subscription add-on explained here: https://infura.io/docs/ethereum/add-ons/archiveData. If you think that the graph node does not need archival data please provide more logging or error messages and I’d be happy to look into this more with you.

I want to access archival state data on influra. How will I do?

Hi @Long_Hoang_Gia you can reach out to us here, https://infura.io/contact

using this…
axios.post(url, {
jsonrpc: ‘2.0’,
id: + new Date(),
method: methodName,
params: params,
}, {
headers: {
‘Content-Type’: ‘application/json’,
‘Access-Control-Allow-Origin’: ‘’,
‘Access-Control-Allow-Headers’: '
’,
},
})
.then(function (response) {

getting this…

_header:
0|central-config | ‘POST /v3/ HTTP/1.1\r\nAccept: application/json, text/plain, /\r\nAuthorization: Bearer fd0d617acd2a460d54f876c0bca7aeaee5a9af350c7d7774b9594e7475a0cdd9\r\nContent-Type: application/json\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Headers: *\r\nUser-Agent: axios/0.19.2\r\nContent-Length: 72\r\nHost: ropsten.infura.io\r\nConnection: close\r\n\r\n’,

response:
{ status: 401,
statusText: ‘Unauthorized’,

or sometimes

data: ‘invalid JWT\n’ },
isAxiosError: true,

no idea why it works from my local but not from the server with the same code!!
also bearer token is getting added without having asked for it

Any help is appreciated!! @mike