Please help with 'Invalid project id'

That’s strange! I’ve created a lot of projects, tested them, and removed them. I created another one today. It is working :expressionless: But Why? I don’t know

Hey @amish - yeah, unfortunately, I’ve seen that happen a few times. If you’re getting that weird error message where it looks like it can’t resolve anything with curl (or if you’re getting the invalid project id with the bottom example you provided), the first thing I’d suggest is to create a new project ID and try it with that. Not sure why that happens sometimes, but luckily it’s an easy fix!

Hi,

I am facing the same problem, I tried creating multiple accounts but for every project curl request is saying invalid project id, not sure if we can trust infura and use them for production systems.

Hi @Sagar_Goyal, and welcome to the Infura community! Can you send over the full curl request you’re running when you get the invalid project id message? If you don’t want to share your project id publicly, you can send that to me in a DM.

hi , I also experiencing same issue :
curl https://ropsten.infura.io/v3/a3491ed6adc7a4c3a87a914bbe5a1bbdd -X POST -H “Content-Type: application/json” -d ‘{“jsonrpc”:“2.0”,“method”:“eth_blockNumber”,“params”: [],“id”:1}’
can you fix this @Leiya_Kenney

Hi @alvin - when I try to recreate this issue with my own project ID, I don’t get that same error message. Can you re-copy the Ropsten URL from your Infura dashboard and try again with the below, putting your project ID in?

curl -X POST --data '{
> "id": 1,
> "jsonrpc": "2.0",
> "method":"eth_blockNumber",
> "params": []
> }' https://ropsten.infura.io/v3/<project_id>

hi @Leiya_Kenney , I use another project_id and it works now

Hi Leiya,
My request:
curl https://mainnet.infura.io/v3/7b6000da41404027b6cfda8cdf044bf4
-X POST
-H “Content-Type: application/json”
-d ‘{“jsonrpc”:“2.0”,“method”:“eth_blockNumber”,“params”:[],“id”:1}’

Output: Project ID invalid
I am using a linux machine. Do I need any package other than ‘curl’.
I have created new project, still facing the same error. Please help.

Can you try again, it should work now. I’m sorry for the trouble, we’ve had an issue with the newly created projects.

For every get this error after, you can check your project type.
I got same error when I use eth rpc by an eth2 project

@wheesys let me know if you need any help with Infura project id.

I am also getting this error just created a new project as well

Hi Jay,

Note that I suspect that this problem is sometimes caused by “smart quotes”, i.e. the request contains unicode start and end quotes rather than simple ASCII quotes. You might find it works by replacing any unicode quotes with new simple ASCII quotes.

Please post your curl request or other code so I can try it out?

Ether way, please let us know what works for you.

Warm regards,
Chris | Infura | ConsenSys

Hi! i’m getting the same error.

My request:

curl https://mainnet.infura.io/v3/03eff3de0ac74e32b70263442c2539d3 \
> -X POST \
> -H "Content-Type: application/json" \
> -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

and also triying this

const HDWalletProvider = require("@truffle/hdwallet-provider");
const Web3 = require("web3");
const { interface, bytecode } = require("./compile");
const { MNEUMONIC, RINKEBY_KEY } = process.env;

const provider = new HDWalletProvider(MNEUMONIC, RINKEBY_KEY);

const web3 = new Web3(provider);

on the .env the RINKEBY_KEY = ‘https://mainnet.infura.io/v3/03eff3de0ac74e32b70263442c2539d3

Hi Federico,

I can’t find 03eff3de0ac74e32b70263442c2539d3 in our database. Can you double check your project key and let us know what you find?

For the js case:
process.env will return all the environment variables but if you are using a .env file, then you will need to:
require(‘dotenv’).config();
to read that file into the process’s environment before you try to access them. I’m not sure from your example if you are using a .env file to hold those key values.

Warm regards,
Chris | Infura | ConsenSys

Hi, i does the require(‘dotenv’).config(), and i have the same result using directly the parameters.

I double check and yes, the key is 03eff3de0ac74e32b70263442c2539d3

Hi Federico,

after some more digging it seems we had a brief issue with project IDs. Please create a new project and let us know if that one works. It should.

Warm regards,
Chris | Infura | ConsenSys

1 Like

Same here :frowning:

Hi Geolffrey,

we has a temporary issue. Create a new project and try again. Let us know how you go.

Warm regards,
Chris | Infura | ConsenSys

Hi @chris.paterson, thank you for answering so quickly.

Issue persisting with a new project:
https://mainnet.infura.io/v3/2c9aded0297647a3b0d408e0f4749aaf

Regards and thank you