1

My Anchor program is giving me a Transaction simulation failed: Error processing Instruction 1: custom program error: 0xa7 with nothing useful in the logs.

How do I even begin to debug this?

1 Answer 1

2

Custom Program Error 0xa7 is Error: 167: The given account is not owned by the executing program.

This might happen if you pass in an account that's expected to be owned by a program, but isn't.

This can happen accidentally if you forget to set declare_id!(/* ... */) to the program id you're trying to hit.

Consider logging the program id that you're using in your javascript client:

console.log(program.programId)

And then seeing if that matches the public key that's in your target/idl/yourprogram.json file.

Sign up to request clarification or add additional context in comments.

3 Comments

here's some query on this, see issues and code github.com/…
where did you lookup the error codes?
@BennoDev The 'custom program error' comes from the file error.rs in whatever the program is.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.