2

Problem with local env. tests fail

Account doesn't get initiated every time for other program tests as well, but works on solpg

anchor test Finished release [optimized] target(s) in 0.10s

Found a 'test' script in the Anchor.toml. Running it as a test suite!

Running test suite: "/home/madhan/dev/solana/program-examples/tokens/spl-token-minter/anchor/Anchor.toml"

yarn run v1.22.19 warning package.json: No license field warning ../../../../../../package.json: No license field $ /home/madhan/dev/solana/program-examples/tokens/spl-token-minter/anchor/node_modules/.bin/ts-mocha -p ./tsconfig.json -t 1000000 'tests/**/*.ts'

SPL Token Minter 1) Create an SPL Token! 2) Mint some tokens to your wallet!

0 passing (117ms) 2 failing

  1. SPL Token Minter Create an SPL Token!: Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Program failed to complete at Connection.sendEncodedTransaction (node_modules/@project-serum/anchor/node_modules/@solana/web3.js/src/connection.ts:5922:13) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Connection.sendRawTransaction (node_modules/@project-serum/anchor/node_modules/@solana/web3.js/src/connection.ts:5881:20) at sendAndConfirmRawTransaction (node_modules/@project-serum/anchor/src/provider.ts:284:21) at AnchorProvider.sendAndConfirm (node_modules/@project-serum/anchor/src/provider.ts:144:14) at MethodsBuilder.rpc [as _rpcFn] (node_modules/@project-serum/anchor/src/program/namespace/rpc.ts:29:16)

  2. SPL Token Minter Mint some tokens to your wallet!: Error: AnchorError caused by account: mint_account. Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized. at Function.parse (node_modules/@project-serum/anchor/src/error.ts:167:14) at translateError (node_modules/@project-serum/anchor/src/error.ts:276:35) at MethodsBuilder.rpc [as _rpcFn] (node_modules/@project-serum/anchor/src/program/namespace/rpc.ts:35:29) at processTicksAndRejections (node:internal/process/task_queues:95:5)

error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

- Edit

tx logs from .anchor after adding {skipPreflight: true} inside of the .rpc() method

Streaming transaction logs mentioning AQDdxLFXQk6eBsVEW1HiHKKH77QMzSK2vMCbjMPhERHx. Confirmed commitment

Transaction executed in slot 6: Signature: 3oxzqTbUWnqbKEyoMgZ4XGx6dUr2e2BKmpdW32FE6SLqht65xHR6smv5SfZbTN63u37kCvcyYubmGgGjxCRZ7g6w

Status: Error processing Instruction 0: Program failed to complete

Log Messages: Program AQDdxLFXQk6eBsVEW1HiHKKH77QMzSK2vMCbjMPhERHx invoke 1

Program log: Instruction: CreateToken

Program AQDdxLFXQk6eBsVEW1HiHKKH77QMzSK2vMCbjMPhERHx consumed 8173 of 200000 compute units

Program AQDdxLFXQk6eBsVEW1HiHKKH77QMzSK2vMCbjMPhERHx failed: Invoked an instruction with data that is too large (12884933564 > 10240)

Transaction executed in slot 7: Signature: 5BFo6C3n1Mp5gmu9QsAZJ5SgrFSBdEm3hrmdbQBdoFuEhR7wimXiAYqywWyVzozNVbhAykUQvcMjhwnZMnXqSEdZ

Status: Error processing Instruction 0: custom program error: 0xbc4

Log Messages: Program AQDdxLFXQk6eBsVEW1HiHKKH77QMzSK2vMCbjMPhERHx invoke 1 Program log: Instruction: MintTo

Program log: AnchorError caused by account: mint_account. Error Code: AccountNotInitialized. Error Number: 3012.

Error Message: The program expected this account to be already initialized.

Program AQDdxLFXQk6eBsVEW1HiHKKH77QMzSK2vMCbjMPhERHx consumed 5093 of 200000 compute units

Program AQDdxLFXQk6eBsVEW1HiHKKH77QMzSK2vMCbjMPhERHx failed: custom program error: 0xbc4

- Edit 2

Versions and errors

Dependencies

New dependency error shows up everytime during build with the errors mentioned in the img

8
  • 1
    can you add the transaction logs from .anchor or add {skipPreflight: true} inside of the .rpc() method for better logs? I assume this is a version issue but want to be sure.
    – Joey Meere
    Commented Jul 26, 2023 at 16:35
  • 1
    @Sav - Edited the question to add the logs from .anchor after adding skipPreflight to true.
    – 0xmadhan
    Commented Jul 26, 2023 at 18:32
  • 1
    I had this problem not too long ago, and the solution below from Jonas will work. You may have to tweak versions of anchor (if using 0.28, try 0.27 or 0.26), and pin certain dependencies like winnow & toml_datetime
    – Joey Meere
    Commented Jul 26, 2023 at 19:03
  • 1
    Post the error message, your CLI & Anchor versions, and your Cargo.toml dependencies here if possible
    – Joey Meere
    Commented Jul 26, 2023 at 20:05
  • 1
    edited them in question under Edit 2 🙌
    – 0xmadhan
    Commented Jul 26, 2023 at 20:24

1 Answer 1

4

Program AQDdxLFXQk6eBsVEW1HiHKKH77QMzSK2vMCbjMPhERHx failed: Invoked an instruction with data that is too large (12884933564 > 10240)

This means you are compiling with the wrong cli version. Try 1.14.20 instead: Program failed to complete: Instruction passed to inner instruction is too large (12884933924 > 1280)

6
  • Build fails when using 1.14.20. tried fixing in few dependencies, but kept getting " package constant_time_eq v0.3.0 cannot be built because it requires rustc 1.66.0 or newer, while the currently active rustc version is 1.62.0-dev " like this
    – 0xmadhan
    Commented Jul 28, 2023 at 6:41
  • https://solana.stackexchange.com/questions/7199/cargo-build-bpf-rustc-version checked with this, but tests fail like before again
    – 0xmadhan
    Commented Jul 28, 2023 at 6:42
  • 1
    This maybe solved in anchor 0.28.0 in combination with 1.16.5 is it an option to upgrade for you?
    – Jonas H.
    Commented Jul 28, 2023 at 8:49
  • tried running it after upgrading it, but this time anchor-spl is creating issues. The issue
    – 0xmadhan
    Commented Jul 28, 2023 at 19:56
  • 1
    Maybe have a look at this :solana.stackexchange.com/questions/7196/…
    – Jonas H.
    Commented Jul 28, 2023 at 20:30

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.