question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught error is thrown when port for notifier server is already in use

See original GitHub issue

Uncaught error is thrown when port for notifier server is already in use

Expected Behavior

The error EADDRINUSE should be caught and handled. Idealy the error would be bubbled up to the app if it can’t be handled (see #94).

There are two cases this error might occur:

1.) appauth by itself already started a server on the given port (see #89) Eventually an already created server could be closed and a new one created (this might interrupt a previously startet auth flow). Another solution could be to change the server so it could handle mutliple auth flows. Alternatively bubble up the error to the app, so the app can handle it.

2.) another process is already listening on the given port Bubble up the error to the app, so it can react accordingly.

Describe the problem

Actual Behavior

The error is not caught, and may only be caught with process.on('UncaughtException', (err) => {})

Steps to reproduce the behavior

1.) Start the example electron app (see googlesamples/appauth-js-electron-sample/pull/3 with update to appauth v1.1.1) 2.) Click “Sign in” 3.) Go back to the app without completing consent screen 4.) Click “Sign in” again

Results in

Uncaught Error: listen EADDRINUSE :::8000

Environment

  • AppAuth-JS version: 1.1.1 (similar issue already in previous versions)
  • AppAuth-JS Environment: Node/Electron

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
pixtroncommented, Aug 21, 2019

@agonzalez0515 the port number is already configurable, just pass the desired port number to the constructor of NodeBaseHandler.

0reactions
tikurahulcommented, Jul 29, 2021

We don’t want to allow multiple concurrent auth flows.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improved error handling for NodeBasedHandler #94 - GitHub
It would be usefull, if ON_UNABLE_TO_START errors would be ... Uncaught error is thrown when port for notifier server is already in use...
Read more >
Tomcat Server Error - Port 8080 already in use - Stack Overflow
Open Eclipse · Go to Servers panel · Right click on Tomcat Server select Open , Overview window will appear. · Open the...
Read more >
System Error Codes (500-999) (WinError.h) - Win32 apps
The Netlogon service cannot start because another Netlogon service running in the domain conflicts with the specified role.
Read more >
How to fix HTTP 500 internal server error? - IONOS
The error message appears whenever a web server can't display the website that the user is trying to access. There are many reasons...
Read more >
Errors | Node.js v19.3.0 Documentation
EADDRINUSE (Address already in use): An attempt to bind a server ( net , http , or https ) to a local address...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found