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

Error: read ECONNRESET #2053

Closed
Boumour opened this issue Aug 17, 2022 · 8 comments
Closed

Error: read ECONNRESET #2053

Boumour opened this issue Aug 17, 2022 · 8 comments

Comments

@Boumour
Copy link

Boumour commented Aug 17, 2022

wait - compiling...
event - compiled client and server successfully in 457 ms (1516 modules)
warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
wait - compiling /products/[handle] (client and server)...
warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
event - compiled client and server successfully in 217 ms (1673 modules)
wait - compiling /_error (client and server)...
event - compiled client and server successfully in 109 ms (1673 modules)
error - Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:220:20) {
type: 'Error',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
transformRequest: [ null ],
transformResponse: [ null ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'User-Agent': 'axios/0.24.0'
},
baseURL: 'http://localhost:9000',
raxConfig: {
retry: 3,
backoffType: 'exponential',
currentRetryAttempt: 3,
retryDelay: 100,
httpMethodsToRetry: [Array],
noResponseRetries: 2,
checkRetryAfter: true,
maxRetryAfter: 300000,
statusCodesToRetry: [Array]
},
method: 'get',
withCredentials: true,
url: '/store/products?limit=25',
json: true
},
code: 'ECONNRESET',
status: null,
page: '/products/[handle]'
}

@olivermrbl
Copy link
Contributor

olivermrbl commented Aug 17, 2022

Please use our bug template when opening up an issue. We do not have enough information to resolve this one.

@olivermrbl
Copy link
Contributor

Closing until additional details have been provided

@kasperkristensen
Copy link
Contributor

@Boumour Just gonna throw this in here, as I can see you are having an issue with the connection between the Next starter and server resetting. You most likely have some process running on port 9000 other than Medusa, could be something like PHP-FPM or something else that runs in the background on localhost port 9000. Either kill all processes on port 9000 and restart your Medusa server, or change the port of your Medusa server to something else like localhost:9001 and then update NEXT_PUBLIC_MEDUSA_BACKEND_URL in your Next starter environment variables to reflect this change.

@Boumour
Copy link
Author

Boumour commented Aug 17, 2022

@kasperkristensen the problem is not the port 9000 for example home page is working fine and fetching the products but the product page when you access to it you got this error TCP.onStreamRead (node:internal/stream_base_commons:220:20 on the browser also just to let you know the api service works fine on the server side but the nextjs you got the problem of ECONNRESET

@Boumour
Copy link
Author

Boumour commented Aug 17, 2022

Screenshot 2022-08-17 at 21 26 35

@Boumour
Copy link
Author

Boumour commented Aug 17, 2022

Screenshot 2022-08-17 at 21 32 08

Screenshot 2022-08-17 at 21 30 54

Screenshot 2022-08-17 at 21 29 39

Screenshot 2022-08-17 at 21 29 27

Screenshot 2022-08-17 at 21 29 08

@kasperkristensen
Copy link
Contributor

@Boumour Have you tried killing everything on port 9000? I just asking because every time someone has brought up this issue, it was due to them running two things on port 9000 simultaneously. And they had the exact same issue with the getStaticProps on the product page failing with ECONNRESET because it's a larger/longer build step which results in more easily being reset due to other things running on the port.

@jeyip
Copy link

jeyip commented Jan 4, 2024

Just wanted to chime in and confirm what @kasperkristensen said, at least for my case. I was seeing similar ECONNRESET issues, and it turns out that PHP-FPM was running on port 9000 on my machine. Once I switched Medusa to port 9001, everything resolved 👍

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

No branches or pull requests

4 participants