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

0.0.0.0:80: bind: address already in use, errors in logs #24

Open
biguphpc opened this issue Jul 24, 2020 · 4 comments
Open

0.0.0.0:80: bind: address already in use, errors in logs #24

biguphpc opened this issue Jul 24, 2020 · 4 comments
Assignees

Comments

@biguphpc
Copy link

Hi, we've having constant errors in the logs when starting this container.

...more
2020/07/24 16:29:22 http[logs,routes]:80 ended: listen tcp 0.0.0.0:80: bind: address already in use,
# logspout v3.2.6-custom by gliderlabs,
# adapters: logdna,
# options : persist:/mnt/routes,
# jobs    : pump routes http[logs,routes]:80,
# routes  :,
#   ADAPTER	ADDRESS	CONTAINERS	SOURCES	OPTIONS,
#   logdna					map[],
2020/07/24 16:30:22 http[logs,routes]:80 ended: listen tcp 0.0.0.0:80: bind: address already in use,
# logspout v3.2.6-custom by gliderlabs,
# adapters: logdna,
# options : persist:/mnt/routes,
# jobs    : http[logs,routes]:80 pump routes,
# routes  :,
#   ADAPTER	ADDRESS	CONTAINERS	SOURCES	OPTIONS,
#   logdna					map[],
2020/07/24 16:31:23 http[logs,routes]:80 ended: listen tcp 0.0.0.0:80: bind: address already in use,
...more

This seems to happen every minute. Here's the docker-compose.yaml we're using:

version: '3'
services:
  logdna-containers:
    image: logdna/logspout:latest
    restart: unless-stopped
    network_mode: host
    hostname: logdna-containers
    container_name: logdna-containers
    environment:
        LOGDNA_KEY: "xxxx"
        TAGS: "container"
    volumes:
      - /etc/hostname:/etc/host_hostname:ro
      - /var/run/docker.sock:/var/run/docker.sock
  1. Can you tell us what is going on ?
  2. What is the use of listening to port 80 ?

Thanks

@dm36 dm36 assigned dm36 and smusali Jul 24, 2020
@dm36
Copy link

dm36 commented Jul 24, 2020

hi @biguphpc thank you for opening this issue! @smusali and I are looking into this and will get back to you.

Does this issue also surface if you use one of our other available Docker setup methods? For example:

sudo docker run --name="logdna" --restart=always \
-d -v=/var/run/docker.sock:/var/run/docker.sock \
-e LOGDNA_KEY="<LogDNA Ingestion Key>" \
logdna/logspout:latest 

Also do you have any other processes running on port 80? You can run lsof -i:80 to check and send a kill -9 with the associated pid (https://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac)

@biguphpc
Copy link
Author

Yes we do have other processes running on port 80 and do not want to kill our web server running on port 80.
This only happens when the container is runs on bridge networking mode.

@dm36
Copy link

dm36 commented Aug 3, 2020

I understand @biguphpc. So it looks like official logspout listens on port 80 by default (https://github.com/gliderlabs/logspout) and it can be configured via the PORT variable (see the environment variable section of the logspout README). Would update the environment section in your docker compose file to contain the desired port.

Environment variables (section in the official logspout README):
PORT or HTTP_PORT - configure which port to listen on (default 80)

Sample docker compose file using the PORT environment variable:

 version: '3'
 services:
   logdna-containers:
     image: logdna/logspout:latest
     restart: unless-stopped
     network_mode: host
     hostname: logdna-containers
     container_name: logdna-containers
     environment:
         LOGDNA_KEY: "xxxx"
         TAGS: "container"
         PORT: 90
     volumes:
       - /etc/hostname:/etc/host_hostname:ro
       - /var/run/docker.sock:/var/run/docker.sock

@dm36
Copy link

dm36 commented Aug 4, 2020

@biguphpc following up- did that help resolve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants