Merge pull request #5136 from pallavibharadwaj/issue_1914

descriptive log for port unavailable and port-retries=0
Zachary Sailer 6 years ago committed by GitHub
commit f354740e57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1490,10 +1490,13 @@ class NotebookApp(JupyterApp):
self.http_server.listen(port, self.ip)
except socket.error as e:
if e.errno == errno.EADDRINUSE:
self.log.info(_('The port %i is already in use, trying another port.') % port)
if self.port_retries:
self.log.info(_('The port %i is already in use, trying another port.') % port)
else:
self.log.info(_('The port %i is already in use.') % port)
continue
elif e.errno in (errno.EACCES, getattr(errno, 'WSAEACCES', errno.EACCES)):
self.log.warning(_("Permission to listen on port %i denied") % port)
self.log.warning(_("Permission to listen on port %i denied.") % port)
continue
else:
raise
@ -1502,8 +1505,12 @@ class NotebookApp(JupyterApp):
success = True
break
if not success:
self.log.critical(_('ERROR: the notebook server could not be started because '
if self.port_retries:
self.log.critical(_('ERROR: the notebook server could not be started because '
'no available port could be found.'))
else:
self.log.critical(_('ERROR: the notebook server could not be started because '
'port %i is not available.') % port)
self.exit(1)
@property

Loading…
Cancel
Save