saleor-platform
saleor-platform copied to clipboard
Apollo fails making connection to 127.0.0.1:8000 (Storefront fails to start)
I just started the saleor platform without changing anything and was unable to run the storefront container. It seems Apollo is unable to connect to the graphql instance.
Opening the graphql editor works like a charm. ie: localhost:8000. The problem is when the storefront tries to connect to the graphql instance. Dashboard works, saleor core works. I am on version 3. Ran the command to update to the latest version for saleor platform.
Storefront is on commit: 4ff54d5598a85f49d9a2ec03196d874eb3f62e20
macOS big sur
I think this is a bug.
EDIT: Tried running on master branch, fails to start.
storefront_1 | { Error: Network error: request to http://localhost:8000/graphql/ failed, reason: connect ECONNREFUSED 127.0.0.1:8000
storefront_1 | at new ApolloError (/app/node_modules/apollo-client/bundle.umd.js:92:26)
storefront_1 | at /app/node_modules/apollo-client/bundle.umd.js:1588:34
storefront_1 | at /app/node_modules/apollo-client/bundle.umd.js:2008:15
storefront_1 | at Set.forEach (<anonymous>)
storefront_1 | at /app/node_modules/apollo-client/bundle.umd.js:2006:26
storefront_1 | at Map.forEach (<anonymous>)
storefront_1 | at QueryManager.broadcastQueries (/app/node_modules/apollo-client/bundle.umd.js:2004:20)
storefront_1 | at /app/node_modules/apollo-client/bundle.umd.js:1483:29
storefront_1 | at process._tickCallback (internal/process/next_tick.js:68:7)
storefront_1 | graphQLErrors: [],
storefront_1 | networkError:
storefront_1 | { FetchError: request to http://localhost:8000/graphql/ failed, reason: connect ECONNREFUSED 127.0.0.1:8000
storefront_1 | at ClientRequest.<anonymous> (/app/node_modules/node-fetch/lib/index.js:1461:11)
storefront_1 | at ClientRequest.emit (events.js:198:13)
storefront_1 | at Socket.socketErrorListener (_http_client.js:401:9)
storefront_1 | at Socket.emit (events.js:198:13)
storefront_1 | at emitErrorNT (internal/streams/destroy.js:91:8)
storefront_1 | at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
storefront_1 | at process._tickCallback (internal/process/next_tick.js:63:19)
storefront_1 | message:
storefront_1 | 'request to http://localhost:8000/graphql/ failed, reason: connect ECONNREFUSED 127.0.0.1:8000',
storefront_1 | type: 'system',
storefront_1 | errno: 'ECONNREFUSED',
storefront_1 | code: 'ECONNREFUSED' },
storefront_1 | message:
storefront_1 | 'Network error: request to http://localhost:8000/graphql/ failed, reason: connect ECONNREFUSED 127.0.0.1:8000',
storefront_1 | extraInfo: undefined }
mailhog_1 | [APIv1] KEEPALIVE /api/v1/events
storefront_1 | (node:27) UnhandledPromiseRejectionWarning: Error: Network error: request to http://localhost:8000/graphql/ failed, reason: connect ECONNREFUSED 127.0.0.1:8000
storefront_1 | at new ApolloError (/app/node_modules/apollo-client/bundle.umd.js:92:26)
storefront_1 | at /app/node_modules/apollo-client/bundle.umd.js:1588:34
storefront_1 | at /app/node_modules/apollo-client/bundle.umd.js:2008:15
storefront_1 | at Set.forEach (<anonymous>)
storefront_1 | at /app/node_modules/apollo-client/bundle.umd.js:2006:26
storefront_1 | at Map.forEach (<anonymous>)
storefront_1 | at QueryManager.broadcastQueries (/app/node_modules/apollo-client/bundle.umd.js:2004:20)
storefront_1 | at /app/node_modules/apollo-client/bundle.umd.js:1483:29
storefront_1 | at process._tickCallback (internal/process/next_tick.js:68:7)
storefront_1 | (node:27) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 305)
I am facing issue too with the frontend, it is not working for me too.
Same thing happening here with latest master(saleor, dash & storefront) on Kubuntu 20.10
ApolloError: Network error: request to http://localhost:8000/graphql/ failed, reason: connect ECONNREFUSED 127.0.0.1:8000
at new ApolloError (/app/node_modules/apollo-client/bundle.umd.js:92:26)
at /app/node_modules/apollo-client/bundle.umd.js:1588:34
at /app/node_modules/apollo-client/bundle.umd.js:2008:15
at Set.forEach (<anonymous>)
at /app/node_modules/apollo-client/bundle.umd.js:2006:26
at Map.forEach (<anonymous>)
at QueryManager.broadcastQueries (/app/node_modules/apollo-client/bundle.umd.js:2004:20)
at /app/node_modules/apollo-client/bundle.umd.js:1483:29
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
graphQLErrors: [],
networkError: FetchError: request to http://localhost:8000/graphql/ failed, reason: connect ECONNREFUSED 127.0.0.1:8000
at ClientRequest.<anonymous> (/app/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:315:20)
at Socket.socketErrorListener (_http_client.js:469:9)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED'
},
extraInfo: undefined
}
Looks like some commit on the storefront(probably https://github.com/mirumee/saleor-storefront/commit/ea54d72fd44644937f1cd9334d49e4241bb97a34 but cannot confirm) introduced server side fetching that trys to fectch from saleor API(http://localhost:8000/graphql/) from inside of the storefront container and fails due to saleor api running in different container.
Quick workaround is to set NEXT_PUBLIC_API_URI to your PCs ip address ie. 192.168.1.10
Where are you configuring the NEXT_PUBLIC_API_URI value?
Hi guys, im experiencing the same issue. Any updates on this one? Also tried to set the --hostname param to --host as i saw somewhere as a suggestion to fix this but it didnt do it for me.
Hi, storefront has been rebuilt a lot, please try updating it
Hello @lkostrowski updating it also fix the issue of saleor-platform? or is there another solution? I ran this with docker compose up. I dockerized this repository (saleor-platform) yesterday in a new VM. Error in the react-storefornt folder.
all containers are running:
this is the error output:
Thank you in advance!
Hi @AlexisHeap , have you tried running fresh git clone
first?
Ok perfect, It's working now, thank you! @lkostrowski
I tried to do git clone again and still the same error "ApolloError"
@lkostrowski
@saleor/storefront-checkout can you check this one?
Storefront is no longer part of the platform, so I'm closing this. Please report related problems in the project's repository.