Skip to content

Commit

Permalink
Fixed Bazarr not starting when configured IP isn't available for bind…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
morpheus65535 committed Dec 26, 2024
1 parent 8346ea9 commit b71daad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bazarr/app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ def configure_server(self):
threads=100)
self.connected = True
except OSError as error:
if error.errno == 49:
if error.errno == errno.EADDRNOTAVAIL:
logging.exception("BAZARR cannot bind to specified IP, trying with 0.0.0.0")
self.address = '0.0.0.0'
self.connected = False
super(Server, self).__init__()
elif error.errno == 48:
elif error.errno == errno.EADDRINUSE:
if self.port != '6767':
logging.exception("BAZARR cannot bind to specified TCP port, trying with default (6767)")
self.port = '6767'
Expand All @@ -64,7 +64,7 @@ def configure_server(self):
logging.exception("BAZARR cannot bind to default TCP port (6767) because it's already in use, "
"exiting...")
self.shutdown(EXIT_PORT_ALREADY_IN_USE_ERROR)
elif error.errno == 97:
elif error.errno == errno.ENOLINK:
logging.exception("BAZARR cannot bind to IPv6 (*), trying with 0.0.0.0")
self.address = '0.0.0.0'
self.connected = False
Expand Down

0 comments on commit b71daad

Please sign in to comment.