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

Error: Error creating IDL account: invalid type: map, expected a string #3338

Open
Yolley opened this issue Oct 31, 2024 · 3 comments
Open
Labels
cli idl related to the IDL, either program or client side

Comments

@Yolley
Copy link

Yolley commented Oct 31, 2024

Whenever I try to run anchor idl init on mainnet I get an error:

Error creating IDL account: invalid type: map, expected a string. Retrying...
Error creating IDL account: invalid type: map, expected a string. Retrying...
Error creating IDL account: invalid type: map, expected a string. Retrying...
Error creating IDL account: invalid type: map, expected a string. Retrying...
Error: Error creating IDL account: invalid type: map, expected a string

It repeats the same error several times until eventually it stops retrying. On the blockchain I see that IDL account was created, but it seems that Anchor failed to write the actual IDL to the account. On devnet the very same IDL works correctly.

Versions:

anchor-cli 0.30.1
solana-cli 1.18.23 (src:aeb3a2e1; feat:4215500110, client:SolanaLabs)
rustc 1.81.0 (eeb90cda1 2024-09-04)
@Yolley Yolley changed the title Error: Error creating buffer account: invalid type: map, expected a string Error: Error creating IDL account: invalid type: map, expected a string Oct 31, 2024
@acheroncrypto acheroncrypto added cli idl related to the IDL, either program or client side labels Oct 31, 2024
@Yolley
Copy link
Author

Yolley commented Oct 31, 2024

It seems like an issue when using the default RPC, I managed to reproduce the same issue with solana program write-buffer - and mitigated it by providing a custom RPC node url with --url parameter. I guess I just need to figure out now how to provide a custom cluster url to anchor idl init.

@acheroncrypto
Copy link
Collaborator

On devnet the very same IDL works correctly.

There is no specific implementation based on the cluster for the idl init command.

It seems like an issue when using the default RPC, I managed to reproduce the same issue with solana program write-buffer - and mitigated it by providing a custom RPC node url with --url parameter. I guess I just need to figure out now how to provide a custom cluster url to anchor idl init.

You can either set the [provider.cluster] value in Anchor.toml or pass in --provider.cluster.

@Yolley
Copy link
Author

Yolley commented Oct 31, 2024

For some strange reason when I try to supply a custom RPC node (tried triton and shyft) I get this

Error creating IDL account: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0 [7 log messages]. Retrying...

Are you sure that just providing a custom URL in provider.cluster is enough? The same RPC urls works correctly with solana cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli idl related to the IDL, either program or client side
Projects
None yet
Development

No branches or pull requests

2 participants