Connection was reset when using provided docker-compose.yml

Hi, I am using the docker-compose.yml details provided in the official Graylog documentation but I am receiving a " Connection was reset" error when I try access the web interface.

The only related topic I could find suggests that the GRAYLOG_HTTP_BIND_ADDRESS=0.0.0.0:9000 environment variable be added but adding this did not fix the problem.

There are no errors in the logs at all and if I try curl the http://127.0.0.1:9000 address from within the Graylog Docker container it is successful. So it appears that Graylog is running fine but is missing some vital mapping configuration that would allow me to access the web interface from the host.

Any assistance would be greatly appreciated.

The docker-compose I am using is as follows:

version: ‘3’
services:
mongo:
image: mongo:4.2
networks:
- graylog
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
environment:
- http.host=0.0.0.0
- transport.host=localhost
- network.host=0.0.0.0
- “ES_JAVA_OPTS=-Xms512m -Xmx512m”
ulimits:
memlock:
soft: -1
hard: -1
deploy:
resources:
limits:
memory: 1g
networks:
- graylog
graylog:
image: graylog/graylog:4.0
environment:
- GRAYLOG_PASSWORD_SECRET=somepasswordpepper
- GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
- GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/

 # Tried adding the following settings
 - GRAYLOG_HTTP_ENABLE_CORS=true
 - GRAYLOG_HTTP_BIND_ADDRESS=0.0.0.0:9000

entrypoint: /usr/bin/tini – wait-for-it elasticsearch:9200 – /docker-entrypoint.sh
networks:
- graylog
restart: always
depends_on:
- mongo
- elasticsearch
ports:
- 9000:9000
- 1514:1514
- 1514:1514/udp
- 12201:12201
- 12201:12201/udp
networks:
graylog:
driver: bridge

Hi, Garth,

Welcome to the community! Glad you’re here.

I’ve moved your question to a place where it should receive expert responses. In the meanwhile, you may want to check out this issue and let me know if it’s helpful.

Thanks David. Unfortunately the link you provided doesn’t help me resolve the problem as it is the opposite of what I am experiencing i.e. for me connection between containers is fine but the service is not accessible from the host due to a “Connection was reset” error.

I have done further investigation and found that the docker-compose.yml file works fine in an Ubuntu 20.04 environment. So my problem seems to be particular to the Windows 10 environment I am trying to run it in.

Any suggestions would be greatly appreciated

Hmmmm, that example may be problematic.

Can you try this one?

version: '3'
services:
  # MongoDB: https://hub.docker.com/_/mongo/
  mongo:
    image: mongo:4
    container_name: mongodb
    networks:
      - graylog
    ports:
      - 27018:27017
  # Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docker.html
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
    container_name: elasticsearch
    environment:
      - http.host=0.0.0.0
      - transport.host=localhost
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    networks:
      - graylog
  # Graylog: https://hub.docker.com/r/graylog/graylog/
  graylog:
    image: graylog/graylog:4.1.0-1
    container_name: graylog
    environment:
      - GRAYLOG_PASSWORD_SECRET=<PASS HERE>
      - GRAYLOG_ROOT_PASSWORD_SHA2=<SECRET HERE>
      - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/
      - GRAYLOG_ELASTICSEARCH_VERSION=7
      - GRAYLOG_HTTP_ENABLE_CORS=true
    networks:
      - graylog
    depends_on:
      - mongo
      - elasticsearch
    ports:
      # Graylog web interface and REST API
      - 9000:9000
      # Syslog TCP
      - 1514:1514
      # Syslog UDP
      - 1514:1514/udp
      # GELF TCP
      - 12201:12201
      # GELF UDP
      - 12201:12201/udp
networks:
  graylog:
    driver: bridge

And let me know how you get along?

2 Likes

Thanks very much for the assistance Aaron.

I tried out your script and managed to narrow the problem down. Oddly enough the problem seems to be with Firefox, so http://localhost:9000 returns a “The connection was reset” on Firefox but on Chrome it works and correctly displays the Graylog webpage. I tried clearing all the cookies and site data on Firefox, but the problem persists.

There was also what I assume was a bit of a knowledge gap on my part in that I was trying http://127.0.0.1:9000 (which does not work anywhere) rather than using “localhost” which as I mentioned does work on Chrome

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.