2

I ran into this error message when running a transaction, any idea what could be going wrong?

errorLogs: [
    'Program log: AnchorError occurred. Error Code: InstructionDidNotDeserialize. Error Number: 102. Error Message: The program could not deserialize the given instruction.'
  ],
  logs: [
    'Program BH8xjXWTRn78CRmFnNwf8uG6DpVeAu5tRhbXWqVmQuFR invoke [1]',
    'Program log: Instruction: Initialize',
    'Program log: AnchorError occurred. Error Code: InstructionDidNotDeserialize. Error Number: 102. Error Message: The program could not deserialize the given instruction.',
    'Program BH8xjXWTRn78CRmFnNwf8uG6DpVeAu5tRhbXWqVmQuFR consumed 3688 of 200000 compute units',
    'Program BH8xjXWTRn78CRmFnNwf8uG6DpVeAu5tRhbXWqVmQuFR failed: custom program error: 0x66'
  ],
  error: {
    errorCode: { code: 'InstructionDidNotDeserialize', number: 102 },
    errorMessage: 'The program could not deserialize the given instruction',
    comparedValues: undefined,
    origin: undefined
  },

2 Answers 2

5

The problem that you are addressing is related to

passing incorrectly serialized instruction data to the program

as @Henry said above, but in my case, I had this issue with the #[instruction(...)] which was coming from the fact that I was not using the arguments in the correct order as explained in the documentation:

You can access the instruction's arguments with the #[instruction(..)] attribute. You have to list them in the same order as in the instruction but you can omit all arguments after the last one you need.

3

Typically this error is because the IDL or client-gen code is out of date and the code is passing incorrectly serialized instruction data to the program.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.