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

Attempting to close CLI server does not stop all running services [Windows] #96

Closed
craigshoemaker opened this issue Mar 1, 2021 · 4 comments
Labels
os: windows Issues happened on a Windows environment (not WSL). priority: high (P0) High priority scope: ci Issues related to the CI type: bug Something isn't working
Projects

Comments

@craigshoemaker
Copy link
Contributor

On Windows, attempting to close the CLI server using ctrl-c does not stop all running services. Additionally, sometimes a response is very delayed after pressing ctrl-c, and at times there is no response at all.

Steps to reproduce

  1. Start a SWA site with the swa start <APP_LOCATION>
  2. Type ctrl-c to stop the CLI server
  3. Try to start the site again with swa start <APP_LOCATION>
  4. See error 👇

Expected behavior

When you close the CLI server using ctrl-c, all services are stopped so you can start it again successfully.

Desktop

  • OS: Windows
  • Browser: n/a
  • Version: n/a

Error

$ swa start ./__sapper__/export

INFO: Found SWA configuration file: C:\Users\cshoe\Documents\data\code\projects\website\.github\workflows\azure-static-web-apps-red-bay-09fca812.yml
>> detected runtime: node.js
[ swa] SWA listening on http://0.0.0.0:4280
[auth] events.js:288
[auth]       throw er; // Unhandled 'error' event
[auth]       ^
[auth]
[auth] Error: listen EADDRINUSE: address already in use 0.0.0.0:4242
[auth]     at Server.setupListenHandle [as _listen2] (net.js:1309:16)
[auth]     at listenInCluster (net.js:1357:12)
[auth]     at doListen (net.js:1496:7)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
[auth] Emitted 'error' event on Server instance at:
[auth]     at emitErrorNT (net.js:1336:8)
[auth]     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
[auth]   code: 'EADDRINUSE',
[auth]   errno: 'EADDRINUSE',
[auth]   syscall: 'listen',
  address: '0.0.0.0',
  port: 4242
[auth] }
[ swa] events.js:288
      throw er; // Unhandled 'error' event
[ swa]       ^
[ swa]
[ swa] Error: listen EADDRINUSE: address already in use 0.0.0.0:4280
[ swa]     at Server.setupListenHandle [as _listen2] (net.js:1309:16)
    at listenInCluster (net.js:1357:12)
[ swa]     at doListen (net.js:1496:7)
[ swa]     at processTicksAndRejections (internal/process/task_queues.js:85:21)
Emitted 'error' event on Server instance at:
[ swa]     at emitErrorNT (net.js:1336:8)
[ swa]     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
[ swa]   code: 'EADDRINUSE',
  errno: 'EADDRINUSE',
  syscall: 'listen',
[ swa]   address: '0.0.0.0',
[ swa]   port: 4280
[ swa] }
[ swa] node ../proxy/server.js exited with code 1
[ swa] node ../proxy/server.js restarted
[auth] node ../auth/server.js --host=0.0.0.0 --port=4242 exited with code 1
[auth] node ../auth/server.js --host=0.0.0.0 --port=4242 restarted
[ app] Starting up http-server, serving C:\Users\cshoe\Documents\data\code\projects\website\__sapper__\export
[ app] Available on:
[ app]   http://192.168.1.2:4200
[ app]   http://100.64.76.144:4200
[ app]   http://127.0.0.1:4200
[ app]   http://172.22.16.1:4200
[ app] Unhandled requests will be served from: http://0.0.0.0:4280/?
[ app] Hit CTRL-C to stop the server
[auth] events.js:288
      throw er; // Unhandled 'error' event
[auth]       ^
[auth]
[auth] Error: listen EADDRINUSE: address already in use 0.0.0.0:4242
[auth]     at Server.setupListenHandle [as _listen2] (net.js:1309:16)
    at listenInCluster (net.js:1357:12)
    at doListen (net.js:1496:7)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
[auth] Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1336:8)
[auth]     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
[auth]   code: 'EADDRINUSE',
[auth]   errno: 'EADDRINUSE',
  syscall: 'listen',
  address: '0.0.0.0',
[auth]   port: 4242
[auth] }
[ swa] SWA listening on http://0.0.0.0:4280
[ swa] events.js:288
      throw er; // Unhandled 'error' event
[ swa]       ^
[ swa]
[ swa] Error: listen EADDRINUSE: address already in use 0.0.0.0:4280
[ swa]     at Server.setupListenHandle [as _listen2] (net.js:1309:16)
    at listenInCluster (net.js:1357:12)
[ swa]     at doListen (net.js:1496:7)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
[ swa] Emitted 'error' event on Server instance at:
[ swa]     at emitErrorNT (net.js:1336:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
[ swa]   code: 'EADDRINUSE',
[ swa]   errno: 'EADDRINUSE',
[ swa]   syscall: 'listen',
[ swa]   address: '0.0.0.0',
  port: 4280
[ swa] }
[auth] node ../auth/server.js --host=0.0.0.0 --port=4242 exited with code 1
[ swa] node ../proxy/server.js exited with code 1
@manekinekko
Copy link
Member

Does it happen all the time? Or is it random?

@manekinekko manekinekko added priority: high (P0) High priority scope: ci Issues related to the CI type: bug Something isn't working labels Mar 1, 2021
@manekinekko manekinekko added this to To do in Post-GA via automation Mar 1, 2021
@manekinekko manekinekko added the os: windows Issues happened on a Windows environment (not WSL). label Mar 1, 2021
@craigshoemaker
Copy link
Contributor Author

Sadly, it seem to happen intermittently.

@manekinekko manekinekko added this to To do in Pre-GA via automation Mar 9, 2021
@manekinekko manekinekko removed this from To do in Post-GA Mar 9, 2021
@manekinekko manekinekko moved this from To do to In progress in Pre-GA Mar 12, 2021
@manekinekko manekinekko moved this from In progress to Review in progress in Pre-GA Mar 12, 2021
@manekinekko
Copy link
Member

@craigshoemaker would you mind giving this another try (main branch) and let me know if you are still having this issue?

@Reshmi-Sriram
Copy link
Contributor

This issue should be resolved. @craigshoemaker - please do reopen if you still face any issues.

Pre-GA automation moved this from Review in progress to Done Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: windows Issues happened on a Windows environment (not WSL). priority: high (P0) High priority scope: ci Issues related to the CI type: bug Something isn't working
Projects
No open projects
Pre-GA
  
Done
Development

No branches or pull requests

3 participants