0

I always close and redeploy but Its annoying ... so i need to upgrade instead .

solana program upgrade target/deploy/program-keypair.json new_program.json owner.json -u "https://mainnet.helius-rpc.com/?api-key=7e466"

Error: Upgrading program failed: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: invalid program argument [3 log messages]

how to fix it or to find the log messages.

this is how I deploy .

solana program deploy target/deploy/program.so -u "https://mainnet.helius-rpc.com/?api-key=7e466" --program-id new_program.json

I tried with this simple program .

use solana_program::{
    account_info::AccountInfo,
    entrypoint,
    entrypoint::ProgramResult,
    pubkey::Pubkey,
    msg,
};

// declare and export the program's entrypoint
entrypoint!(process_instruction);

// program entrypoint's implementation
pub fn process_instruction(
    program_id: &Pubkey,
    accounts: &[AccountInfo],
    instruction_data: &[u8]
) -> ProgramResult {
    // log a message to the blockchain
    msg!("Hello, world!");
    // msg!("Hello, world!");
    Ok(())
}
[package]
name = "hello_world"
version = "0.1.0"
edition = "2018"

[lib]
name = "hello_world"
crate-type = ["cdylib", "lib"]

[dependencies]
solana-program = "1.18.2"
7
  • still nothing . Commented May 14 at 10:55
  • There might be an issue with the new version of your program, ie. it's using a syscall unsupported by mainnet. The CLI unfortunately isn't properly reporting deployment errors at the moment, but that will be fixed soon.
    – Jon C
    Commented May 15 at 15:13
  • @JonC thanks for responding, I tried with a simple hello world program but same . Commented May 15 at 16:11
  • @JonC here its . imgur.com/a/HTkLnbz Commented May 15 at 16:18
  • seems like i'm doing something wrong ... since target/deploy/program-keypair.json file isn't modified since its generated for the first time Commented May 15 at 16:29

2 Answers 2

0

This could help someone like me.

The issue in my case was I'm using the target/deploy/program-keypair.json key-pair as the buffer account which is obviously wrong , instead you'll need to write a new buffer account (deploy the program to a buffer account) and then use the buffer Pubkey to do the upgrade.

so after deploying and you're willing to upgrade , you'll need to do this.

  1. solana program write-buffer path/to/program.so. (you'll get a buffer pubkey).

  2. solana program upgrade BUFFER_PUBKEY PROGRAM_PUBKEY.

0

Sometime I forgot check my balance address authority, so I don't have enough SOL balance to pay fee. LOL

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.