So I got this error using npm run seedDb in the Grand stack starter project:
(base) Kaspers-MBP:api kasperknudsen$ npm run seedDb
> grand-stack-starter-api@0.0.1 seedDb /Users/kasperknudsen/grand-stack-starter-master/api
> babel-node src/seed/seed-db.js
ApolloError: Network error: request to http://localhost:4000/ failed, reason: connect ECONNREFUSED 127.0.0.1:4000
at new ApolloError (/Users/kasperknudsen/grand-stack-starter-master/api/node_modules/apollo-client/bundle.umd.js:92:26)
at Object.error (/Users/kasperknudsen/grand-stack-starter-master/api/node_modules/apollo-client/bundle.umd.js:1329:28)
at notifySubscription (/Users/kasperknudsen/grand-stack-starter-master/api/node_modules/zen-observable/lib/Observable.js:134:18)
at onNotify (/Users/kasperknudsen/grand-stack-starter-master/api/node_modules/zen-observable/lib/Observable.js:165:3)
at SubscriptionObserver.error (/Users/kasperknudsen/grand-stack-starter-master/api/node_modules/zen-observable/lib/Observable.js:224:7)
at /Users/kasperknudsen/grand-stack-starter-master/api/node_modules/apollo-client/bundle.umd.js:1106:37
at Set.forEach (<anonymous>)
at Object.error (/Users/kasperknudsen/grand-stack-starter-master/api/node_modules/apollo-client/bundle.umd.js:1105:21)
at notifySubscription (/Users/kasperknudsen/grand-stack-starter-master/api/node_modules/zen-observable/lib/Observable.js:134:18)
at onNotify (/Users/kasperknudsen/grand-stack-starter-master/api/node_modules/zen-observable/lib/Observable.js:165:3) {
graphQLErrors: [],
networkError: FetchError: request to http://localhost:4000/ failed, reason: connect ECONNREFUSED 127.0.0.1:4000
at ClientRequest.<anonymous> (/Users/kasperknudsen/grand-stack-starter-master/api/node_modules/node-fetch/lib/index.js:1455:11)
at ClientRequest.emit (events.js:210:5)
at ClientRequest.EventEmitter.emit (domain.js:476:20)
at Socket.socketErrorListener (_http_client.js:406:9)
at Socket.emit (events.js:210:5)
at Socket.EventEmitter.emit (domain.js:476:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
message: 'request to http://localhost:4000/ failed, reason: connect ECONNREFUSED 127.0.0.1:4000',
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED'
},
message: 'Network error: request to http://localhost:4000/ failed, reason: connect ECONNREFUSED 127.0.0.1:4000',
extraInfo: undefined
What happens when you call http://localhost:4000/graphql in the browser?
Perhaps it's a problem with the port number.
What is the value of GRAPHQL_LISTEN_PORT in /api/src/.env ?
I could reproduce the ECONNREFUSED error when the api server was not running (if I didn't run 'npm start' in the /api directory).
Which version of neo4j are you using?
Actually solved it by re-clone the starter pack + re-installing npm.
Now my only problem is that I can't get the data from seedDb visually in Neo desktop.
tl;dr - (example solution at bottom) : change the direction "OUT" and "IN" by removing the quotes around them in the api>src>schema.graphql file
So I was having the same error as well :
Error: Error: request to http://0.0.0.0:4001/graphql failed, reason: connect ECONNREFUSED 0.0.0.0:4001
as well as this:
19:51:40 React | [HPM] Error occurred while trying to proxy request /graphql from localhost:3000 to http://localhost:4001/graphql (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
I had just installed using yarn and followed directions to cd myMyNewApp and npm run start (also tried yarn run start) , opened new terminal and cd to api directory then npm run seedDB. Based on the link in the error message, this is my issue:
ECONNREFUSED (Connection refused): No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host.
HOWEVER - the working solution I found on a random site was this:
So, your relation ship should NOT look like this: @relation(name: "IN_GENRE", direction: " OUT " ) But rather like this: @relation(name: "IN_GENRE", direction: OUT)
Hi @Schmarj3 , am I understanding correctly that you had the same problem specifically with npm seedDb or npm start after running create-grandstack-app?
I am having the same problems reported above. Updating the schema does seem to help with the error you report, but the original problem of the refused connection continues.
Interestingly, I notice that in the link you give to where you found the solution they are discussing moving from neo4j-graphql.js version 2.18.0 to 2.19.1. But the current create-grandstack-app is using 2.14.2, so I am surprised that we are still experiencing that problem.
Hi @yyakovson613. Yes, for all of the installs that I have done in the past two weeks (except for today), removing the quotes from all the schema directions worked for me. The only other time I had and slight issue was switching from sandbox to a local db instance. But that was because I didn't update the env file correctly.
Just installed the web-react version again to see if I missed anything else I might have done and created a blank local db instance v4.1.3 - but the first error I got was a vue error:
internal/modules/cjs/loader.js:883
09:00:02 api | throw err;
09:00:02 api | ^
09:00:02 api |
09:00:02 api | Error: Cannot find module '@vue/compiler-dom'
09:00:02 api | Require stack:
...
ran the following which worked
npm i @vue/compiler-dom
but now the module error is about postcss. Was hoping to reconstruct the ECONNREFUSED error but will have to wait.