Graylog2 / graylog-docker

Official Graylog Docker image
https://hub.docker.com/r/graylog/graylog/
Apache License 2.0
356 stars 133 forks source link

FATAL tini (7)] exec wait-for-it failed: No such file or directory #180

Closed nicolaibaralmueller closed 2 years ago

nicolaibaralmueller commented 2 years ago

Hi,

Attempting to migrate from local graylog installation to docker. However, each attempt fails with:

mongodb_1        | 2021-09-14T10:30:26.562+0000 I  SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:30,293Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "version[7.10.2], pid[8], build[oss/docker/747e1cc71def077253878a59143c1f785afa92b9/2021-01-13T00:42:12.435326Z], OS[Linux/4.18.0-240.el8.x86_64/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/15.0.1/15.0.1+9]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:30,301Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "JVM home [/usr/share/elasticsearch/jdk], using bundled JDK [true]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:30,302Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "JVM arguments [-Xshare:auto, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -XX:+ShowCodeDetailsInExceptionMessages, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,COMPAT, -Xms1g, -Xmx1g, -XX:+UseG1GC, -XX:G1ReservePercent=25, -XX:InitiatingHeapOccupancyPercent=30, -Djava.io.tmpdir=/tmp/elasticsearch-15509236375760798409, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Des.cgroups.hierarchy.override=/, -Xms1g, -Xmx1g, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=oss, -Des.distribution.type=docker, -Des.bundled_jdk=true]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,921Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [aggs-matrix-stats]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,922Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [analysis-common]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,922Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [geo]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,923Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [ingest-common]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,923Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [ingest-geoip]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,924Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [ingest-user-agent]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,924Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [kibana]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,925Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [lang-expression]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,925Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [lang-mustache]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,925Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [lang-painless]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,926Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [mapper-extras]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,926Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [parent-join]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,927Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [percolator]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,927Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [rank-eval]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,928Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [reindex]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,928Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [repository-url]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,928Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "loaded module [transport-netty4]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:31,929Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "no plugins loaded" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:32,000Z", "level": "INFO", "component": "o.e.e.NodeEnvironment", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/mapper/cl_graylog2-root)]], net usable_space [28.7gb], net total_space [34.9gb], types [xfs]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:32,006Z", "level": "INFO", "component": "o.e.e.NodeEnvironment", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "heap size [1gb], compressed ordinary object pointers [true]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:32,218Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "node name [b3ef8c180448], node ID [wXd-pU6SRLavWUihiug-ww], cluster name [docker-cluster], roles [master, remote_cluster_client, data, ingest]" }
graylog_graylog_1 exited with code 127
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (6)] exec wait-for-it failed: No such file or directory
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:38,935Z", "level": "INFO", "component": "o.e.t.NettyAllocator", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=1gb}]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:39,069Z", "level": "INFO", "component": "o.e.d.DiscoveryModule", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "using discovery type [single-node] and seed hosts providers [settings]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:39,549Z", "level": "WARN", "component": "o.e.g.DanglingIndicesState", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:39,860Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "initialized" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:39,861Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "starting ..." }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:40,142Z", "level": "INFO", "component": "o.e.t.TransportService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "publish_address {172.26.0.2:9300}, bound_addresses {0.0.0.0:9300}" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:40,746Z", "level": "INFO", "component": "o.e.c.c.Coordinator", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "cluster UUID [3GdIdrRPTa6GafHp0pdNpQ]" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:40,988Z", "level": "INFO", "component": "o.e.c.s.MasterService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "elected-as-master ([1] nodes joined)[{b3ef8c180448}{wXd-pU6SRLavWUihiug-ww}{2e0y2JAcRj-Uyvl-TtmhCQ}{172.26.0.2}{172.26.0.2:9300}{dimr} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 3, version: 5, delta: master node changed {previous [], current [{b3ef8c180448}{wXd-pU6SRLavWUihiug-ww}{2e0y2JAcRj-Uyvl-TtmhCQ}{172.26.0.2}{172.26.0.2:9300}{dimr}]}" }
graylog_graylog_1 exited with code 127
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (6)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:41,178Z", "level": "INFO", "component": "o.e.c.s.ClusterApplierService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "master node changed {previous [], current [{b3ef8c180448}{wXd-pU6SRLavWUihiug-ww}{2e0y2JAcRj-Uyvl-TtmhCQ}{172.26.0.2}{172.26.0.2:9300}{dimr}]}, term: 3, version: 5, reason: Publication{term=3, version=5}" }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:41,234Z", "level": "INFO", "component": "o.e.h.AbstractHttpServerTransport", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "publish_address {172.26.0.2:9200}, bound_addresses {0.0.0.0:9200}", "cluster.uuid": "3GdIdrRPTa6GafHp0pdNpQ", "node.id": "wXd-pU6SRLavWUihiug-ww"  }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:41,235Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "started", "cluster.uuid": "3GdIdrRPTa6GafHp0pdNpQ", "node.id": "wXd-pU6SRLavWUihiug-ww"  }
elasticsearch_1  | {"type": "server", "timestamp": "2021-09-14T10:30:41,303Z", "level": "INFO", "component": "o.e.g.GatewayService", "cluster.name": "docker-cluster", "node.name": "b3ef8c180448", "message": "recovered [0] indices into cluster_state", "cluster.uuid": "3GdIdrRPTa6GafHp0pdNpQ", "node.id": "wXd-pU6SRLavWUihiug-ww"  }
graylog_graylog_1 exited with code 127
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (6)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (6)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_1        | [FATAL tini (7)] exec wait-for-it failed: No such file or directory
graylog_graylog_1 exited with code 127

This is my yml file:

version: '2'
services:
  # MongoDB: https://hub.docker.com/_/mongo/
  mongodb:
    image: mongo:4.2
    volumes:
      - mongo_data:/data/db
      #- /opt/graylog/mongo_data:/data/db
  # Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docker.html
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
    volumes:
      - es_data:/usr/share/elasticsearch/data
      #- /opt/graylog/es_data:/usr/share/elasticsearch/data
    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
    mem_limit: 1g
  # Graylog: https://hub.docker.com/r/graylog/graylog/
  graylog:
    image: graylog/graylog:3.3
    volumes:
      - graylog_data:/usr/share/graylog/data
      #- /opt/graylog/graylog_data:/usr/share/graylog/data
      #- /opt/graylog/plugin:/usr/share/graylog/plugin
      #- /opt/graylog/graylog/severity-to-level.csv:/etc/graylog/severity-to-level.csv
    environment:
      # CHANGE ME (must be at least 16 characters)!
      - GRAYLOG_PASSWORD_SECRET=""
      # Password: admin
      - GRAYLOG_ROOT_PASSWORD_SHA2=""
      - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/
    entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 --  /docker-entrypoint.sh
    links:
      - mongodb:mongo
      - elasticsearch
    restart: always
    depends_on:
      - mongodb
      - 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
# Volumes for persisting data, see https://docs.docker.com/engine/admin/volumes/volumes/
volumes:
  mongo_data:
    driver: local
#    driver_opts:
#      type: none
#      o: bind
#      device: /opt/graylog/mongo_data
  es_data:
    driver: local
#    driver_opts:
#      type: none
#      o: bind
#      device: /opt/graylog/mongo_data
  graylog_data:
    driver: local
#    driver_opts:
#      type: none
#      o: bind
#      device: /opt/graylog/graylog_data
malcyon commented 2 years ago

Try changing this line:

entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 --  /docker-entrypoint.sh

To:

entrypoint: "/usr/bin/tini /docker-entrypoint.sh"

The 3.3 image didn't have the wait-for-it script. It should still work without it.

nicolaibaralmueller commented 2 years ago

Try changing this line:

entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 --  /docker-entrypoint.sh

To:

entrypoint: "/usr/bin/tini /docker-entrypoint.sh"

The 3.3 image didn't have the wait-for-it script. It should still work without it.

Thanks for the suggestion. That did not work either. Also tried with 3.1 image. Does this mean versions below 4 are incompatible with docker?

malcyon commented 2 years ago

No, the 3.3 and 3.1 images work with Docker just fine.

I duplicated your issue on my laptop and tested the fix myself before posting it. Graylog started up for me after the fix. It's just a misconfiguration in the docker-compose.yml.

Can you re-post your modified Dockerfile and the output you're getting from it?

nicolaibaralmueller commented 2 years ago

No, the 3.3 and 3.1 images work with Docker just fine.

I duplicated your issue on my laptop and tested the fix myself before posting it. Graylog started up for me after the fix. It's just a misconfiguration in the docker-compose.yml.

Can you re-post your modified Dockerfile and the output you're getting from it?

I apologize... wrote your change wrong and forgot the qotation marks. Error is now gone! Thx

malcyon commented 2 years ago

I apologize... wrote your change wrong and forgot the qotation marks. Error is now gone! Thx

Glad to hear it!