solana-test-validator: No such file or directory panic - solana

I am trying to run Solana rust hello world example locally (https://github.com/solana-labs/example-helloworld). I went through the readme but the step "Start local Solana cluster" (https://github.com/solana-labs/example-helloworld#start-local-solana-cluster) is not working for me. I am receiving thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', validator/src/bin/solana-test-validator.rs:294:71 error.
My solana-test-validator version is 1.7.9
This is my config.yml file:
Config File: /home/work/.config/solana/cli/config.yml
RPC URL: http://127.0.0.1:8899
WebSocket URL: ws://127.0.0.1:8900/ (computed)
Keypair Path: /home/work/.config/solana/id.json
Commitment: confirmed
Do you have any idea whats wrong? Or what should I fix / check?

I solved it with installing a stable version like this: sh -c "$(curl -sSfL https://release.solana.com/stable/install)"

try cd into validator folder inside solana directory
and then run ./solana-test-validator

Related

Run solana-test-validator shows initializing but does not work

macOS 11.6.3
solana-cli 1.9.6 (src:781609b2; feat:2191737503)
Config File: /Users/sumbuk/.config/solana/cli/config.yml
RPC URL: http://localhost:8899
WebSocket URL: ws://localhost:8900/ (computed)
Keypair Path: /Users/sumbuk/.config/solana/id.json
Commitment: confirmed
After running solana-test-validator, the message showed 'initializing...' briefly but after that nothing happened. Can anyone kindly point me in a direction? Thanks.
Ledger location: test-ledger
Log: test-ledger/validator.log

yarn deploy give error with Command failed with exit code 1 when running collection-examples-as

I am trying to run the collection-examples-as near example but when I run yarn deploy it gives me the following error
$ near dev-deploy --wasmFile="./contract.wasm"
Starting deployment. Account id: dev-1637744501224-6323200, node:
https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file:
./contract.wasm
An error occurred
Error: ENOENT: no such file or directory, open './contract.wasm'
[Error: ENOENT: no such file or directory, open './contract.wasm'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './contract.wasm'
}
error Command failed with exit code 1.
I think the error is it can't find the path to ./contract.wasm so I run yarn build the I tried to deploy it again using yarn deploy but I got another error which is:
$ near dev-deploy --wasmFile="./contract.wasm"
Starting deployment. Account id: dev-1637744501224-6323200, node:
https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file:
./contract.wasm
An error occurred
Error: Can not sign transactions for account dev-1637744501224-6323200 on network
default, no matching key pair found in
InMemorySigner(MergeKeyStore(UnencryptedFileSystemKeyStore(/home/rasha/.near-
credentials), UnencryptedFileSystemKeyStore(/home/rasha/collection-examples-
as/neardev))).
{
type: 'KeyNotFound',
context: undefined
}
any help or suggestions?
There's an issue with old versions of near-cli and dev-deploy.
As a workaround, you can try running the latest cli directly from your terminal:
near dev-deploy --wasmFile="./contract.wasm" -f
Just check that you installed the latest version of near-cli, currently 2.2.0. You can check your version with near --version.
Be sure to run yarn build first, so you'll have the compiled contract.wasm file.
Note: When you run yarn deploy, it uses the old near-cli version defined in package.json. (probably some old version like 1.6.0)
You might also want to check this GitHub issue (dev-deploy error): https://github.com/near/create-near-app/issues/1408

pre-commit for local hook gives error: "unrecognized arguments: .pre-commit-config.yaml"

I have the following repo in pre-commit file .pre-commit-config.yaml
- repo: local
hooks:
- id: check_pip
name: Check pip file
description: This hook checks if requirements-dev.txt is up to date.
language: system
entry: python -m scripts.check_pip_requirements
args: ["--compare"]
But it keeps giving me the error:
error: unrecognized arguments: .pre-commit-config.yaml
As it passes the filename as an argument to my python script. How can I prevent this?
to clean up your example a little bit -- and use files to only run when the necessary files change:
- repo: local
hooks:
- id: check_pip
name: Check pip file
description: This hook checks if requirements-dev.txt is up to date.
language: system
entry: python -m scripts.check_pip_requirements --compare
files: ^requirements-dev.txt$
pass_filenames: false
note that I did a couple things:
args doesn't really make sense for local hooks, you can just put that in entry
pass_filenames (as you did) -- pre-commit is a framework based on passing filenames to executables, but you can turn that off
files: this will make it so the hook only gets triggered if requirements-dev.txt changes
alternatively (if you expect changes outside requirements-dev.txt to need to run this hook) you can drop files and use always_run: true
disclaimer: I'm the author of pre-commit
I spent quite some time figuring out what caused this and how to solve this. It's not documented well, eventually I fixed it by trial and error. We have to use pass_filenames: false in our hook:
- repo: local
hooks:
- id: check_pip
name: Check pip file
description: This hook checks if requirements-dev.txt is up to date.
language: system
entry: python -m scripts.check_pip_requirements
pass_filenames: false
args: ["--compare"]

Wercker: Build failing on 'set up environment'. Why?

I have a Jekyll blog which I'm trying to push to an AWS S3 bucket. I have followed this tutorial.
The build keeps failing. Wercker gives me the following error message:
Build failed on master
setup environment
GET https://registry.hub.docker.com/v1/repositories/wercker/ruby/images returned 404
It the displays my wercker.yml file:
box: wercker/ruby
no-response-timeout: 10
build:
steps:
- bundle-install
- script:
name: Run Jekyll doctor
code: bundle exec jekyll doctor
- script:
name: Build Jekyll site
code: bundle exec jekyll build --trace
deploy:
steps:
- s3sync:
key_id: $AWS_ACCESS_KEY_ID
key_secret: $AWS_SECRET_ACCESS_KEY
bucket_url: $AWS_BUCKET_URL
source_dir: _site/
opts: --acl-public --add-header=Cache-Control:max-age=3600
I'm out of my depth here. Google is only returning other Wercker pages with the same error message. What is causing the error? What steps do I need to take to fix this?
Here's a link to the error page itself.
Any help would be appreciated! Thanks.
Solved!
It appears that the tutorial is outdated.
I needed to update wercker.yml to work with Wercker v2.
To do this, I changed:
box: wercker/ruby
to
box: ruby.

grunt-rsync from Windows client fails

I want to use Grunt and rsync deploy some code from my computer (Windows) to a server (Linux).
My Gruntfile.js is
module.exports = function(grunt) {
grunt.initConfig({
rsync: {
options: {
args: ['--verbose', '--chmod=777'],
exclude: ['*.git', 'node_modules'],
recursive: true
},
production: {
options: {
src: './bitzl.com',
dest: '/home/marcus/bitzl.com',
host: 'marcus#bitzl.com',
syncDest: true
}
}
}
});
grunt.loadNpmTasks('grunt-rsync');
}
Please note that I use the homedirectory of marcus and chmod=777 just to simplify testing.
Running grunt rsync fails:
Running "rsync:production" (rsync) task
rsyncing ./example.com >>> /home/marcus/bitzl.com
Shell command was: rsync ./bitzl.com marcus#bitzl.com:/home/marcus/bitzl.com --rsh ssh --recursive --delete --delete-exc
luded --exclude=*.git --exclude=node_modules --verbose --chmod=777
ERROR
Error: rsync exited with code 12
Warning: Task "rsync:production" failed. Use --force to continue.
Error: Task "rsync:production" failed.
at Task.<anonymous> (D:\git\bitzl.com\node_modules\grunt\lib\util\task.js:200:15)
at null._onTimeout (D:\git\bitzl.com\node_modules\grunt\lib\util\task.js:236:33)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
Aborted due to warnings.
However, running the rsync command from above without Grunt works fine:
rsync ./bitzl.com marcus#bitzl.com:/home/marcus/bitzl.com --rsh ssh --recursive --delete --delete-excluded --exclude=*.git --exclude=node_modules --verbose --chmod=777
Rsync promts for the passphrase of my public key (via Grunt it doesn't) and syncs like a breeze.
Authentication on the server works via public key (with passphrase). Password authentication would be fine, too.
My guess is that somehow the password promt breaks and rsync fails with a protocol error (that's exit code 12).
What I am missing to get grunt-rsync working on Windows?
Update:
From a Linux VM (Ubuntu 12.04 via Virtualbox/Vagrant) it works like on would expect.
It turned out as a bug in grunt-rsync. A pull request I've filled in for rsyncwrapper has been accepted, and with the recent version of grunt-rsync everything works as expected.
If you still experience problems, make sure you have at least grunt-rsync version 0.6.0 installed.

Resources