Skip to main content
7 votes
Accepted

`anchor build` fails with error, "failed to load manifest for workspace member"

I've run into this error with Anchor a few times. It occurs when something in your repository structure doesn't align with what Anchor or Cargo are looking for. Anchor is pretty particular about the ...
Joe C's user avatar
  • 1,086
6 votes

Getting error while compiling the program

This will be fixed if you update your solana-cli version. Update to 1.16.0 by running: solana-install init 1.16.0
acheron's user avatar
  • 2,699
6 votes
Accepted

Error when anchor build - package `toml_datetime v0.6.2` cannot be built

The easiest way to fix this problem is to use the latest version of anchor-spl from GitHub, you can achieve this by adding the following line to your Cargo.toml. anchor-spl = { git = "https://...
acheron's user avatar
  • 2,699
6 votes
Accepted

Anchor Build Depenedency error

Try deleting your cache rm -rf ~/.cache/solana/v1.10.32 or rm -rf ~/.cache/solana/*
vicyyn's user avatar
  • 4,095
4 votes

How to use Tuples in Anchor lang

tuples are not implemented in anchor so far (version: 0.27.0 at time of writing), you can use a struct in your case. #[account] pub struct UserLedger { pub list: Vec<MyTuple>, } #[derive(...
lucarlig's user avatar
4 votes

the trait `anchor_lang::AccountSerialize` is not implemented for `Requester

The zero_copy macro doesn't derive AccountSerialize. It derives Pod, Zeroable, ZeroCopy, Discriminator, and AccountDeserialize. If you instead replace Account<'info, Requester> with ...
Ellie High's user avatar
  • 1,074
4 votes
Accepted

What is cargo build-bpf?

cargo --list does contain the build-bpf It is a cargo tool that is a super set of build. What is does is take the LLVM output of build (i.e. rustc) and transpiles it into BPF which is the acceptable ...
Frank C.'s user avatar
  • 656
3 votes

failed to complete: Instruction passed to inner instruction is too large (12884932868 > 1280)

This is an issue at compile time, check the following: Solana CLI v1.14.20 Add solana-program = "=1.14.20" to Anchor.toml
Cloakd's user avatar
  • 421
3 votes

Solana Program 1 time initialization Issue

in short you can create a PDA with a pre-defined seed to store a state when you init. if you are gonna call init again, it will error out because you already created a PDA, which will fail the init ...
jimmdd's user avatar
  • 41
3 votes
Accepted

Anchor: How to know instruction number without having to run "cargo expand"?

Anchor uses the first 8 bytes of the sha256 of "namespace":"function_name" as the instruction identifiers. One byte would increase the risk of collision. At eight bytes, it's still ...
Whiteseal's user avatar
  • 3,214
3 votes
Accepted

How to merge 2 or more Transactions and ask for 1 time payment only

Easiest solution is to send both instructions in the same transaction on the front end. The wallet preview you are looking at would show the result of the entire tx, with both operations.
Whiteseal's user avatar
  • 3,214
3 votes

Unable to build a binary

Can you try updating to the latest solana-cli suite using solana-install init 1.16.4 Also, the error has nothing with your rustc version, but the crates' MSRV.
Jimii's user avatar
  • 3,770
3 votes

cargo build-bpf failed

I have identified the issue. The solana-sdk is designed for off-chain use only, so it should be removed from the dependencies.
zhxx zh's user avatar
  • 81
3 votes
Accepted

Cannot compile `solana-program` crate with new `sqlx` versions

It's a bit annoying, but it's possible to fix this if you patch a few crates in your Cargo.toml. There's a PR out to do that in the Solana monorepo at https://github.com/solana-labs/solana/pull/33853. ...
Jon C's user avatar
  • 16.1k
2 votes
Accepted

Error Code: AccountDidNotSerialize. Error Number: 3004. Error Message: Failed to serialize the account

I increased the space of my account and redeployed the programs with new keys. #[account( init, payer = payer, space = 82+36, seeds = [b"my_custom_seed"], bump) ] pub ...
Abdullah Qureshi's user avatar
2 votes

Depencencies in Cargo.toml file Solana-SDK and Solana-Client doesn't work

From Solana documentation: On-chain Rust programs support most of Rust's libstd, libcore, and liballoc, as well as many 3rd party crates. There are some limitations since these programs run in a ...
acheron's user avatar
  • 2,699
2 votes
Accepted

libssl.so.1.1 not found when running anchor test in Kali Linux

Try downgrading solana-cli to a stable version with sh -c "$(curl -sSfL https://release.solana.com/v1.14.10/install)" Edit: This should probably have come first, but re-install openssl with: ...
Ademola's user avatar
  • 3,853
2 votes

Error when anchor build - package `constant_time_eq v0.3.0` cannot be built

Yes, after upgrading the version of Solana, the anchor build is working But in testing, there is an error. 'Program CAyJyJA5aKy62Uiq7JTRpnpRXdniGzVoeq7Qsamo1Kf8 invoke [1]', 'Program log: ...
Oura's user avatar
  • 21
2 votes
Accepted

Error when anchor build - package `constant_time_eq v0.3.0` cannot be built

Copying from the post you've linked: The error message is misleading because the error actually results from the version of rustc that ships with solana and not your system's rustc version The main ...
acheron's user avatar
  • 2,699
2 votes

Unable to build a binary

Hey the error that you are using and old rust version comes from you having cli 14.x installed probably. Can you try updating it to 16.4? https://docs.solana.com/de/cli/install-solana-cli-tools
Jonas H.'s user avatar
  • 5,787
2 votes

cargo build-bpf no such command: `+solana` running build:program-rust

This could come from a couple of sources: Rust is old: be sure to upgrade with rustup update stable the Solana toolsuite isn't installed: be sure to install it https://docs.solana.com/cli/install-...
Jon C's user avatar
  • 16.1k
2 votes

The trait `borsh::de::BorshDeserialize` is not implemented for `T` problem

mpl-token-vault was deprecated by Metaplex last year and is only on solana version 1.10. You are trying to use it with 1.17.3. I am not sure what you mean by ‘mint a candy machine directly,’ but the ...
stranzhay's user avatar
2 votes
Accepted

solana$ ./cargo build => "error: linking with `cc` failed: exit status: 1"

Typically this happens if your machine is running out of RAM, triggering the OOM killer to start deleting processes. Some parts of the build can be extremely greedy for RAM, so your best bet is to ...
Jon C's user avatar
  • 16.1k
1 vote

Error when anchor build - package `constant_time_eq v0.3.0` cannot be built

For anyone trying to use anchor 0.26 with solana 1.14 and encountering this error. Try updating Anchor.toml with the following: [dependencies] anchor-lang = "0.26.0" blake3 = "=1.3.1&...
john's user avatar
  • 7,487
1 vote

WSL_Ubuntu: 'hello-solana': error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

Try installing libssl-dev package via apt-get sudo apt-get install libssl-dev If that didn't work then run the command series of commands wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/...
0xMukesh's user avatar
  • 273
1 vote

Why can't the Solana validator code base be built with its own tooling?

This error is saying you need to use nightly Rust: https://stackoverflow.com/questions/53136717/errore0554-feature-may-not-be-used-on-the-stable-release-channel-couldnt You can do this with rustup ...
KevinH's user avatar
  • 422
1 vote

Solana-SDK and Solana-Client doesn't work as a dependencies

Please upgrade your solana cli to stable 1.13.4 And also in your smart contract (on chain) programs you are suppose to use solana-program library. solana-sdk and solana-client are for client side ...
Nagaprasad Vr's user avatar
1 vote
Accepted

Solana Helloworld example stuck on cargo build bpf without error message

I went out tonight and left the command running. When I came back, I was delighted to be greeted with an error message: error: Unable to update registry `crates-io` Caused by: failed to ...
Ryan Wennekes's user avatar
1 vote

Error Code: AccountDidNotSerialize. Error Number: 3004. Error Message: Failed to serialize the account

Instead of this #[account] pub struct Ledger { pub uri: String, } use // Implements an Accounts deserializer on the given struct. #[derive(Accounts)] pub struct Ledger { pub uri: String, }
Yilmaz's user avatar
  • 1,164
1 vote
Accepted

Add timestamp to current time

Timestamps on the Solana clock are just i64 values that represent the number of seconds that have passed, similar to Javascript's Date.now(). If you want to add a specific time period to a clock ...
m_callens's user avatar
  • 889

Only top scored, non community-wiki answers of a minimum length are eligible