-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Intermittently Gatsby doesn't cleanly exit and the process refuses to be killed #26214
Comments
Is the error you encounter like this?
If so it might be related to either of these PRs: #25863 #25915 You could try testing with |
This appears to be an issue with our service discovery mechanism not correctly releasing locks on CTRL+C. While I don't know how to resolve that, we already use the minimum possible stale duration for the lockfiles of 5s so after five seconds it should work again: gatsby/packages/gatsby-core-utils/src/service-lock.ts Lines 28 to 31 in 76cddc7
That means we could quickly patch this annoyance for users by changing the error log to something like "Looks like develop for this site is already running, can you visit http://localhost:8000? If it is not, try again in five seconds!" |
I'm getting the error:
I have tried killing all the node processes, deleting .cache/ and public/, even restarting my laptop - I'm still getting the same error. It's really weird. When I open http://localhost:8000, nothing is running there. Can someone help me figure out what's wrong? |
Description
About once a day, when I restart my Gatsby server it tells me that there is an instance of the project already running. It won't allow me to start another instance on a different port because it is already running.
However, I have no interactive process open. I closed all terminals and reopened but the process is still running.
When I check to see what is listening on the port with
lsof -n -i4TCP:8000 | grep LISTEN
, I get a node PID. But the process won't be killed either withkill PID
orsudo kill PID
.The only fix I've found is to restart the machine.
Steps to reproduce
This is an intermittent problem and I haven't been able to find a clear reproducible case. I'm keeping notes and will hopefully be able to update this issue when I have a clear use case. Part of this issue is to see if there is a shared problem here and other wisdom I can learn from.
Expected result
gatsby develop
to always cleanly kill the processActual result
Process doesn't properly end when exiting terminal.
https://share.getcloudapp.com/P8ubp6z6
Environment
System:
OS: macOS 10.15.6
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.2 - ~/.nvm/versions/node/v12.16.2/bin/node
Yarn: 1.22.4 - ~/.nvm/versions/node/v12.16.2/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v12.16.2/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 84.0.4147.105
Firefox: 72.0.1
Safari: 13.1.2
npmPackages:
gatsby: 2.24.9 => 2.24.9
gatsby-image: ^2.4.13 => 2.4.13
gatsby-plugin-postcss: ^2.3.11 => 2.3.11
gatsby-plugin-react-svg: ^3.0.0 => 3.0.0
gatsby-plugin-sharp: ^2.6.22 => 2.6.22
gatsby-source-filesystem: ^2.3.7 => 2.3.22
gatsby-source-wordpress-experimental: 1.0.7 => 1.0.7
gatsby-transformer-sharp: ^2.5.11 => 2.5.11
gatsby-wordpress-experimental-inline-images: ^0.0.3 => 0.0.3
npmGlobalPackages:
gatsby-cli: 2.12.63
The text was updated successfully, but these errors were encountered: