Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

start validator solana-test-validator Library not loaded error #17222

Closed
interdailytop19 opened this issue May 14, 2021 · 18 comments
Closed

start validator solana-test-validator Library not loaded error #17222

interdailytop19 opened this issue May 14, 2021 · 18 comments

Comments

@interdailytop19
Copy link

interdailytop19 commented May 14, 2021

Problem

I followed the solana hello world guide to the step solana-test-validator

error:

dyld: Library not loaded: /usr/local/opt/[email protected]/lib/libssl.1.1.dylib
  Referenced from: /Users/123/.local/share/solana/install/active_release/bin/solana-test-validator
  Reason: image not found
zsh: abort      solana-test-validator

m1 chip
macOS 11.3.1
node version v14.16.1

google searched this thread:
https://stackoverflow.com/questions/59006602/dyld-library-not-loaded-usr-local-opt-openssl-lib-libssl-1-0-0-dylib

but can't switch openssl vserion

Error: Unknown command: switch
which openssl
/usr/bin/openssl

no [email protected] folder in /usr/local/opt/

tried different node versions,
tried update upgrade brew,
tried brew uninstall then install openssl
tried brew install different version of openssl
tried symlink to brew openssl
tried manually copy the file to /usr/local/opt/[email protected] from brew openssl
get error /usr/local/opt/[email protected]/lib/libssl.1.1.dylib: mach-o, but wrong architecture

brew openssl in /opt/homebrew/Cellar/[email protected]/1.1.1k

@dwrx
Copy link

dwrx commented May 16, 2021

I had the same issue, but on Intel chip, and a simple brew install [email protected] solved it for me.

EDIT: i didn't follow any further steps after installation, however, Homebrew suggested this:

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have [email protected] first in your PATH, run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

@interdailytop19
Copy link
Author

I tried brew install [email protected] and run solana-test-validator, same error as before

@t-nelson
Copy link
Contributor

I tried brew install [email protected] and run solana-test-validator, same error as before

This all needs to be done in Rosetta on M1, AFAIK

@interdailytop19
Copy link
Author

interdailytop19 commented May 18, 2021

ok, I installed Rosetta, and then installed x86 brew follow this stockoverflow post link,

then installed [email protected]
arch -x86_64 /usr/local/homebrew/bin/brew install [email protected]

then smylink x86 brew openssl to /usr/local/opt/[email protected] by
ln -s /usr/local/Homebrew/opt/[email protected] /usr/local/opt/[email protected]

then ran solana-test-validator result this error

Ledger location: test-ledger
Log: test-ledger/validator.log
⠁ 
zsh: illegal hardware instruction  solana-test-validator

test-ledger/validator.log

[2021-05-18T09:30:31.722472000Z INFO  solana_faucet::faucet] Faucet started. Listening on: 0.0.0.0:9900
[2021-05-18T09:30:31.723054000Z INFO  solana_faucet::faucet] Faucet account address: 4CE3H97XonSGmwJ4wT8wxhhuFvZ27xuJuha4Vb2xmNcY
[2021-05-18T09:30:31.743181000Z INFO  solana_ledger::blockstore] Maximum open file descriptors: 500000
[2021-05-18T09:30:31.743199000Z INFO  solana_ledger::blockstore] Opening database at "test-ledger/rocksdb"
[2021-05-18T09:30:31.788877000Z INFO  solana_ledger::blockstore] "test-ledger/rocksdb" open took 45ms

@interdailytop19
Copy link
Author

#17406

@gxxcastillo
Copy link
Contributor

gxxcastillo commented Aug 20, 2021

What's the solution here?

I'm on an M1, running 11.5.2 and solana v1.7.10 and I've tried uninstalling / reinstalling openssl then rebuilding the solana tools from source using cargo clean followed by cargo build but I keep getting the same error:

Library not loaded: /usr/local/opt/[email protected]/lib/libssl.1.1.dylib

Everything other than solana-test-validator seems to work fine.

I've tried re-installing homebrew. I've tried in a standard terminal as well as a rosetta 2 terminal.

@nityanandagohain
Copy link

I am facing the same issue as @gxxcastillo :(

@cdrappi
Copy link
Contributor

cdrappi commented Aug 22, 2021

Have you built the solana-test-validator from source using scripts/cargo-install-all.sh?

@gxxcastillo
Copy link
Contributor

gxxcastillo commented Aug 28, 2021

@cdrappi. After a lot of trial and error I was able to get it running via a manual build and run (sorry, I didn't document my steps, I should have).

Now, I'm running into this other issue, I wonder if it might be related to me being on an M1.

I've tried different demos and all of them have the same issue, when I try to deploy my program. Basically it just gets stuck at [0/1] Finalizing transaction...

@gxxcastillo
Copy link
Contributor

Update: My issues have been resolved. I have the solana-test-validator running on my M1 and I've been able to build and deploy. Going back through and making sure everything: Homebrew, openssl, rust, and the solana tools were installed on x86 and that fixed it.

@Mtinkering
Copy link

@gxxcastillo Hi, i'm running into those issues now. Did you build from source on M1? I can't build due to lots of errors

@Mtinkering
Copy link

Okay it works

@Mtinkering
Copy link

Guys I summarized what I encountered in this note. Hope it helps someone

@victordht
Copy link

how do you Delete solana to start from scratch.

@rav3nh0lm
Copy link

@dif71214 actually good question

@gxxcastillo
Copy link
Contributor

@dif71214, @rav3nh0lm, you may just need to delete the solana folder you checked out from github and the ~/.config/solana folder.

There are instruction here in case you need to uninstall Rust: rustup self uninstall

@pindaroso
Copy link

pindaroso commented Nov 9, 2021

Make sure to install Rust using the x86_64-apple-darwin script via arch -x86_64 rust-init. Don't forget about building and linking cargo-build-bpf as well.

cd sdk/cargo-build-bpf
cargo install --path .
ln -s $PROJECT_ROOT/bin/sdk ~/.cargo/bin/sdk

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any activity in past 7 days after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants