Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection refused error with solana-test-validator up and running in a separate pane #392

Open
1776M opened this issue Dec 31, 2021 · 9 comments

Comments

@1776M
Copy link

1776M commented Dec 31, 2021

Hi, I am sure this must be a simple thing but it has happened on two different ubuntu instances where I tried to run the example-helloworld app. I am sure there is something I am doing wrong.

I am using Ubuntu to try and get the example-helloworld up and running.

I have followed the steps to build and deploy the app, which has all worked fine in a terminal pane. I have also started a "solana-test-validator" in a separate terminal pane, together with "solana logs" in a third pane.

I have also ensured I have solana's web3.js installed. When I run the command "npm start" in the first pane I get the following error show below. The solana-test-validator process seems to get killed when I run "npm start". Is there a obvious fix for this, to stop it getting killed?


FetchError: request to http://localhost:8899/ failed, reason: connect ECONNREFUSED 127.0.0.1:8899
at ClientRequest. (/root/example-helloworld/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (node:events:390:28)
at ClientRequest.emit (node:domain:475:12)
at Socket.socketErrorListener (node:_http_client:447:9)
at Socket.emit (node:events:390:28)
at Socket.emit (node:domain:475:12)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED'

@qpwo
Copy link

qpwo commented Jan 18, 2022

Try using node 16 instead of 17 if you're on 17

#375

@jacobtyq
Copy link

Ran into the same issue as what @1776M experienced. I was on node v17 and switching to node 16 works.

nvm use 17
> Now using node v17.3.0 (npm v8.3.0)
npm run start

> [email protected] start
> ts-node src/client/main.ts

Let's say hello to a Solana account...
FetchError: request to http://localhost:8899/ failed, reason: connect ECONNREFUSED ::1:8899
    at ClientRequest.<anonymous> (/Users/jacob/Repo/example-helloworld/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (node:events:390:28)
    at ClientRequest.emit (node:domain:475:12)
    at Socket.socketErrorListener (node:_http_client:442:9)
    at Socket.emit (node:events:390:28)
    at Socket.emit (node:domain:475:12)
    at emitErrorNT (node:internal/streams/destroy:164:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}

Switched to either node v16 or v14

nvm use 16
> Now using node v16.13.1 (npm v8.1.2)

> [email protected] start
> ts-node src/client/main.ts

Let's say hello to a Solana account...
Connection to cluster established: http://localhost:8899 { 'feature-set': 3258470607, 'solana-core': '1.9.4' }
Using account <ACCOUNT_ID> containing 499999999.1546446 SOL to pay for fees
Using program <PROGRAM_ID>
Saying hello to <PROGRAM_ID>
<PROGRAM_ID> has been greeted 4 time(s)
Success

@ericlau-solid
Copy link

Thanks for this. Ran into same issue as well.

@iinstances
Copy link

iinstances commented Jan 20, 2022

Try using node 16 instead of 17 if you're on 17

#375

This solution worked for me.
Thanks a lot!

@Kubikasz
Copy link

I am with Mac m1 and tried 17 and it failed. But nvm use 16 worked.

@turanzv
Copy link

turanzv commented May 16, 2022

Try using node 16 instead of 17 if you're on 17

#375

Solution worked for me. Much appreciated!

@alanrichards86
Copy link

Can't seem to get it to work with any version sadly enough....

@0xPratik
Copy link

I am facing the same issue cant get it work with any version

@mariesco
Copy link

For me work this:

  1. First install Solana from brew or with curl.
  2. Clone the repository of solana.
  3. git checkout v1.9.4.
  4. cargo build --release --bin solana-test-validator
  5. cd validator
  6. ./solana-test-validator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants