@solana/kit · Instruction errors (on-chain)

Solana error #4615016

INSTRUCTION_ERROR__READONLY_DATA_MODIFIED

Appears as Solana error #4615016; Decode this error by running `npx @solana/errors decode -- 4615016 '…'`

Message

Instruction modified data of a read-only account

What it means

Kit's typed wrappers around the runtime's InstructionError variants. The same errors exist in the legacy format; see the linked page for causes and fixes.

What to do

  • The index in the context is the failing instruction's position in the transaction.
  • INSTRUCTION_ERROR__CUSTOM carries the program's own error code; this site decodes it.

This wraps the on-chain error ReadonlyDataModified, which has its own page with causes and fixes.

Decode it locally instead

npx @solana/errors decode -- 4615016 '<base64 context>'

In development, import from @solana/kit as usual and the full message is thrown. In production the message is stripped to keep bundles small; the error object still carries error.context with the same values this page decodes, and isSolanaError(err, SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_DATA_MODIFIED) lets you branch on it.

Decode another error

Try: