anchor: devnet deploy error: unrecognized signer source

I created setup project using anchor init testproject --javascript in $HOME/solana project directory. After:

  1. setting up to devnet using solana config set --url devnet
  2. changing localnet to devnet in Anchor.toml
  3. changing program id in lib.rs and Anchor.toml file same as solana address -k target/deploy/testproject-keypair.json
  4. anchor build --> success
  5. anchor deploy --> error

anchor deploy error:

Deploying workspace: https://api.devnet.solana.com
Upgrade authority: $HOME/.config/solana/id.json
Deploying program "testproject"...
Program path: $HOME/solana project/target/deploy/testproject.so...
error: Invalid value for '--program-id <PROGRAM_ID>': unrecognized signer source
There was a problem deploying: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "" }.

I have followed same steps as above but created project in $HOME/solana_project directory, anchor deploy worked properly.

Observation: project path containing space could have caused the whole issue.

Analysis: In the solana program deploy.... command here for 2nd project command will be solana program deploy ... --program-id ... $HOME/solana_project/... for 1st project command will be solana program deploy ... --program-id ... $HOME/solana project/... a space in the whole command is causing the issue similar to how a copy/move command errors out in linux

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 30 (4 by maintainers)

Most upvoted comments

Just to bump this as I have the same problem as @titocosta. I’m following the instructions from Buildspace as foundhere and running on an M1 Macbook Air.

Using anchor deploy --program-name <PROGRAM ID> lets it deploy but anchor test --skip-local-validator causes the error

Deploying workspace: http://localhost:8899
Upgrade authority: /Users/joshbuckland/.config/solana/id.json
Deploying program "myepicproject"...
Program path: /Users/<my_local_username>/development/blockchain/solana/myepicproject/target/deploy/myepicproject.so...
error: Invalid value for '--program-id <PROGRAM_ID>': unrecognized signer source
There was a problem deploying: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "" }.

I have the Solana validator running locally as per the linked documentation

@jlubeck @kfartusov @BowTiedUrsus would you mind trying again with an updated version installed via cargo install --git https://github.com/project-serum/anchor anchor-cli --locked --force?

If the issue continues, could you please confirm there are no spaces in the path to your project directory.

@tomlinton I can confirm that this also worked for me and I’m able to deploy with Anchor:

cargo install --git https://github.com/project-serum/anchor anchor-cli --locked --force

--program-name <program id> solved it for me on anchor deploy but I still get the same error when using anchor test which doesn’t seem to accept a --program-name option.

@jlubeck @kfartusov @BowTiedUrsus would you mind trying again with an updated version installed via cargo install --git https://github.com/project-serum/anchor anchor-cli --locked --force?

If the issue continues, could you please confirm there are no spaces in the path to your project directory.

Was having the very same problem and this fixed it, thank you!

@jlubeck @kfartusov @BowTiedUrsus would you mind trying again with an updated version installed via cargo install --git https://github.com/project-serum/anchor anchor-cli --locked --force?

If the issue continues, could you please confirm there are no spaces in the path to your project directory.

Works now! Thanks!

@jlubeck @kfartusov @BowTiedUrsus would you mind trying again with an updated version installed via cargo install --git https://github.com/project-serum/anchor anchor-cli --locked --force?

If the issue continues, could you please confirm there are no spaces in the path to your project directory.

@tomlinton worked for me! I was able to just do anchor test and it worked 😃 😃

@armaniferrante looks like #1046 is not fixing this, would you mind re-opening it please? Thanks!

The same for me, last build, with fix https://github.com/project-serum/anchor/pull/1046. Still the same behavior

My solution about this problem is run anchor deploy with --program-name parameter.

anchor deploy --program-name <your ID>

To get this ID, i use this doc.

@shivam-agarwal-0