ERROR: The Compose file './docker-compose.yml' is invalid because: services.graylog.volumes contains an invalid type, it should be an array

getting error when I run docker-compose up -d

ERROR: The Compose file ‘./docker-compose.yml’ is invalid because:
services.graylog.volumes contains an invalid type, it should be an array

he @sanjayakula

the question is - how does your docker-compose file look like?

version: ‘2’

services:

MongoDB: https://hub.docker.com/_/mongo/

mongodb:
image: mongo:3
volumes:
- “/data01/mongodata/db:/mongo/db”
#- “mongodata:/data/db”

Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docker.html

elasticsearch:
#image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.5
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.9
environment:
- http.host=0.0.0.0
- transport.host=localhost
- network.host=0.0.0.0
- xpack.security.enabled=false
- “ES_JAVA_OPTS=-Xms512m -Xmx512m”
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 2g
ports:
- 9200:9200
volumes:
- “/data01/esdata:/usr/share/elasticsearch/data”
#- “esdata:/elasticsearch/data”
#- “/data01/esdata/es/backups:/backups”
#- “./data01/apps/graylog2/es/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml”

Graylog: https://hub.docker.com/r/graylog/graylog/

graylog:
#image: graylog/graylog:3.2
image: graylog/graylog:2.4.6-1
volumes:
- “/data01/graylogdata/data/journal:/graylog/data/journal”
- “/data01/graylogdata/data/config:/graylog/data/config”
#- “./config:/usr/share/graylog/data/config”
environment:
# CHANGE ME (must be at least 16 characters)!
- GRAYLOG_PASSWORD_SECRET=somepasswordpepper
# Password: admin
- GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
- GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/
- GRAYLOG_ELASTICSEARCH_HOSTS=http://elastic:changeme@elasticsearch:9200
- GRAYLOG_TRANSPORT_EMAIL_ENABLED=true
#- GRAYLOG_TRANSPORT_EMAIL_HOSTNAME=
- GRAYLOG_TRANSPORT_EMAIL_PORT=587
- GRAYLOG_TRANSPORT_EMAIL_USE_AUTH=false
- GRAYLOG_TRANSPORT_EMAIL_USE_TLS=false
- GRAYLOG_TRANSPORT_EMAIL_USE_SSL=false
- GRAYLOG_TRANSPORT_EMAIL_SUBJECT_PREFIX=[graylog]
#- GRAYLOG_TRANSPORT_FROM_EMAIL=
links:
- mongodb:mongo
- elasticsearch
depends_on:
- mongodb
- elasticsearch
ports:
# Graylog web interface and REST API
- 172.20.0.4:9000:9000
# Smtp client
- 172.20.0.4:587:587
#- 25:25
# Syslog TCP
- 172.20.0.4:8514:8514
# Syslog UDP
- 172.20.0.4:9514:9514/udp
# GELF TCP
- 172.20.0.4:12201:12201
# GELF UDP
- 172.20.0.4:12201:12201/udp
volumes:
mongodata:
driver: local
esdata:
driver: local
graylogdata:
driver: local

@sanjayakula

if you like to run an ancient version of Graylog, you need to use a docker-compose file that fits to this version. Like in the linked documentation of version 2.4

https://docs.graylog.org/en/2.4/pages/installation/docker.html#persisting-data

Thank you Jan, I will work tonight and let you know if it worked…

Thanks again,

-Sanjay Akula

Why I’m running old version is I’m reproducing my work production env on my home server, I need to do upgrade to 3.2.x version which is stable one…

If I can reproduce the same graylog on my test server, then I can try upgrade on it and If I face some issues then I have to be careful while I’m doing upgrade on production docker server…

Thanks,

-Sanjay Akula

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