Bind() to 0.0.0.0:80 failed (98: Address already in use)

The standalone KoBo toolbox installation becomes semi-functional from time to time - data downloads stop working amongst other things, although users can login and do basic actions.

By inspecting logs, here is the line from log/nginx/error.log that marks the onset of the problem:

error.log:2019/10/30 06:28:24 [crit] 20#20: the changing binary signal is ignored: you should shutdown or terminate before either old or new binary's process

Then it continues down the log:

2019/10/30 06:28:35 [emerg] 1128#1128: bind() to 0.0.0.0:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: bind() to [::]:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: bind() to 0.0.0.0:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: bind() to [::]:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: bind() to 0.0.0.0:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: bind() to [::]:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: bind() to 0.0.0.0:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: bind() to [::]:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: bind() to 0.0.0.0:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: bind() to [::]:80 failed (98: Address already in use)
2019/10/30 06:28:35 [emerg] 1128#1128: still could not bind()

After the docker-compose restart, the situation is back to normal.

The installation of the system was done with kobo-install, and the versions of images are:

mongo                                      3.4                           0a998023eb2d        3 months ago        427MB
kobotoolbox/nginx                          latest                        0b73b2eaea00        4 months ago        641MB
kobotoolbox/enketo-express-extra-widgets   1.77.0-jnm-grunt-workaround   ab42c120b286        4 months ago        1.59GB
kobotoolbox/kpi                            2.019.23                      aa9cd9bc7b21        4 months ago        1.51GB
kobotoolbox/kobocat                        2.019.22                      b4c8c3e6f89c        4 months ago        1.48GB
nginx                                      1.15-alpine                   dd025cdfe837        5 months ago        16.1MB
certbot/certbot                            latest                        4bdc1514009b        6 months ago        113MB
mdillon/postgis                            9.5                           a9a97c2d2458        7 months ago        622MB
redis                                      3.2                           87856cc39862        12 months ago       76MB

How can we correct this problem?

Thanks,

Hi @maric.vladimir,
bind() to 0.0.0.0:80 failed is a known bug that would be fixed a future release.
You need to enter the nginx container.

$kobo-install> ./run.py -cf exec nginx bash
$root> sv stop nginx

Thank you @nolive

Hi @nolive we are regularly hitting the same problem - are you able to please let us know what the ticket number is for the known bug that is to be fixed in a future release, so we can keep an eye out? Thanks a lot!

Hi @nat,

There were no issues in GH related to this (even it is in our backlog).
I have created one https://github.com/kobotoolbox/kobo-docker/issues/270.

Except creating a ton of useless logs, does it make your server stop running correctly?

1 Like

Thanks for the feedback and ticket ref @nolive ! Most appreciated.
Yes, we are having problems with our server at the moment - and this error seems to appear in the logs at around the time that things go wonky. We don’t yet know for sure whether this error is the cause of the issues we are having though. @pynnonel are you able to please follow up?

Yes thanks @nat, I will be happy to help. We’re currently trying to figure out if this might be an issue that has already been fixed in a latter build. In other words we’re trying to update our kobotoolbox without breaking it more…