jorge07 / symfony-6-es-cqrs-boilerplate

Symfony 6 DDD ES CQRS backend boilerplate.
MIT License
1.07k stars 187 forks source link

Kibana container fails to start #150

Closed jon-ht closed 4 years ago

jon-ht commented 4 years ago

Hi,

Another bug I forget to report is that Kibana service was failing on make start:

ERROR: for kibana  Cannot start service kibana: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/etc/dev/kibana/config\\\" to rootfs \\\"/var/lib/docker/overlay2/0c082366804a731edea9418580e8cb5088b0a4a66ea5ff23f49b8bfdf98f21b8/merged\\\" at \\\"/var/lib/docker/overlay2/0c082366804a731edea9418580e8cb5088b0a4a66ea5ff23f49b8bfdf98f21b8/merged/usr/share/kibana/config/kibana.yml\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.

At the begin of Docker execution, I noticed this

WARNING: The PWD variable is not set. Defaulting to a blank string.

So I edited this line https://github.com/jorge07/symfony-5-es-cqrs-boilerplate/blob/f696654ca5250763f0679566d5a9303080307f8d/docker-compose.dev.yml#L28 by

  kibana:
    image: docker.elastic.co/kibana/kibana:7.6.2
    ports:
      - 5601:5601
    volumes:
-      - "$PWD/etc/dev/kibana/config:/usr/share/kibana/config/kibana.yml"
+      - "./etc/dev/kibana/config:/usr/share/kibana/config/kibana.yml"

Kibana is now up and ready ! (or not yet...). If I do a docker-compose -f docker-compose.yml -f docker-compose.dev.yml ps, that's what I'm getting

                     Name                                  Command               State                                              Ports
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
symfony-5-es-cqrs-boilerplate_elasticsearch_1   /usr/local/bin/docker-entr ...   Up       0.0.0.0:9200->9200/tcp, 9300/tcp
symfony-5-es-cqrs-boilerplate_kibana_1          /usr/local/bin/dumb-init - ...   Exit 1
symfony-5-es-cqrs-boilerplate_mysql_1           docker-entrypoint.sh --def ...   Up       0.0.0.0:3306->3306/tcp, 33060/tcp
symfony-5-es-cqrs-boilerplate_nginx_1           nginx -g daemon off;             Up       0.0.0.0:80->80/tcp
symfony-5-es-cqrs-boilerplate_php_1             /sbin/tini -- supervisord  ...   Up       0.0.0.0:2323->22/tcp, 9000/tcp
symfony-5-es-cqrs-boilerplate_rmq_1             docker-entrypoint.sh rabbi ...   Up       15671/tcp, 0.0.0.0:15672->15672/tcp, 25672/tcp, 4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp
symfony-5-es-cqrs-boilerplate_workers_1         /sbin/tini -- /app/bin/con ...   Up       22/tcp, 9000/tcp

symfony-5-es-cqrs-boilerplate_kibana_1 exited with 1 🤔

Look at logs with docker-compose -f docker-compose.yml -f docker-compose.dev.yml logs kibana

Attaching to symfony-5-es-cqrs-boilerplate-sync_kibana_1
kibana_1         | {"type":"log","@timestamp":"2020-05-08T16:13:45Z","tags":["info","plugins-service"],"pid":6,"message":"Plugin \"case\" is disabled."}
kibana_1         | {"type":"log","@timestamp":"2020-05-08T16:14:17Z","tags":["fatal","root"],"pid":6,"message":"{ Error: [config validation of [elasticsearch].url]: definition for this key is missing\n    at ObjectType.validate (/us
r/share/kibana/node_modules/@kbn/config-schema/target/out/types/type.js:59:19)\n    at ConfigService.validateAtPath (/usr/share/kibana/src/core/server/config/config_service.js:188:19)\n    at MapSubscriber.getDistinctConfig.pipe.con
fig [as project] (/usr/share/kibana/src/core/server/config/config_service.js:196:81)\n    at MapSubscriber._next (/usr/share/kibana/node_modules/rxjs/internal/operators/map.js:49:35)\n    at MapSubscriber.Subscriber.next (/usr/share
/kibana/node_modules/rxjs/internal/Subscriber.js:66:18)\n    at DistinctUntilChangedSubscriber._next (/usr/share/kibana/node_modules/rxjs/internal/operators/distinctUntilChanged.js:69:30)\n    at DistinctUntilChangedSubscriber.Subsc
riber.next (/usr/share/kibana/node_modules/rxjs/internal/Subscriber.js:66:18)\n    at MapSubscriber._next (/usr/share/kibana/node_modules/rxjs/internal/operators/map.js:55:26)\n    at MapSubscriber.Subscriber.next (/usr/share/kibana
/node_modules/rxjs/internal/Subscriber.js:66:18)\n    at ReplaySubject._subscribe (/usr/share/kibana/node_modules/rxjs/internal/ReplaySubject.js:76:28)\n    at ReplaySubject.Observable._trySubscribe (/usr/share/kibana/node_modules/r
xjs/internal/Observable.js:44:25)\n    at ReplaySubject.Subject._trySubscribe (/usr/share/kibana/node_modules/rxjs/internal/Subject.js:102:51)\n    at ReplaySubject.Observable.subscribe (/usr/share/kibana/node_modules/rxjs/internal/
Observable.js:30:22)\n    at MapSubscriber.shareReplayOperation (/usr/share/kibana/node_modules/rxjs/internal/operators/shareReplay.js:44:32)\n    at Observable.subscribe (/usr/share/kibana/node_modules/rxjs/internal/Observable.js:2
5:31)\n    at MapOperator.call (/usr/share/kibana/node_modules/rxjs/internal/operators/map.js:32:23)\n  cause:\n   { Error: definition for this key is missing\n       at ObjectType.onError (/usr/share/kibana/node_modules/@kbn/config
-schema/target/out/types/type.js:84:20)\n       at type.Type.schema.error (/usr/share/kibana/node_modules/@kbn/config-schema/target/out/types/type.js:49:53)\n       at finish (/usr/share/kibana/node_modules/joi/lib/types/any/index.j
s:529:50)\n       at type._validate (/usr/share/kibana/node_modules/joi/lib/types/any/index.js:618:24)\n       at type._validateWithOptions (/usr/share/kibana/node_modules/joi/lib/types/any/index.js:674:29)\n       at module.exports
.internals.Any.root.validate (/usr/share/kibana/node_modules/joi/lib/index.js:146:23)\n       at ObjectType.validate (/usr/share/kibana/node_modules/@kbn/config-schema/target/out/types/type.js:54:72)\n       at ConfigService.validat
eAtPath (/usr/share/kibana/src/core/server/config/config_service.js:188:19)\n       at MapSubscriber.getDistinctConfig.pipe.config [as project] (/usr/share/kibana/src/core/server/config/config_service.js:196:81)\n       at MapSubscr
iber._next (/usr/share/kibana/node_modules/rxjs/internal/operators/map.js:49:35)\n       at MapSubscriber.Subscriber.next (/usr/share/kibana/node_modules/rxjs/internal/Subscriber.js:66:18)\n       at DistinctUntilChangedSubscriber._
next (/usr/share/kibana/node_modules/rxjs/internal/operators/distinctUntilChanged.js:69:30)\n       at DistinctUntilChangedSubscriber.Subscriber.next (/usr/share/kibana/node_modules/rxjs/internal/Subscriber.js:66:18)\n       at MapS
ubscriber._next (/usr/share/kibana/node_modules/rxjs/internal/operators/map.js:55:26)\n       at MapSubscriber.Subscriber.next (/usr/share/kibana/node_modules/rxjs/internal/Subscriber.js:66:18)\n       at ReplaySubject._subscribe (/
usr/share/kibana/node_modules/rxjs/internal/ReplaySubject.js:76:28) cause: undefined, path: [ 'url' ] } }"}
kibana_1         |
kibana_1         |  FATAL  Error: [config validation of [elasticsearch].url]: definition for this key is missing
kibana_1         |

After looking at docs, it look like replacing this line solved my problem https://github.com/jorge07/symfony-5-es-cqrs-boilerplate/blob/f696654ca5250763f0679566d5a9303080307f8d/etc/dev/kibana/config#L7

-elasticsearch.url: http://elasticsearch:9200
+elasticsearch.hosts: ["http://elasticsearch:9200"]

That beign said, the link in Kibana config file is pointing to a 404 https://github.com/jorge07/symfony-5-es-cqrs-boilerplate/blob/f696654ca5250763f0679566d5a9303080307f8d/etc/dev/kibana/config#L3

The new docs references seems to be https://github.com/elastic/kibana/blob/master/config/kibana.yml

jorge07 commented 4 years ago

Thanks for report it should be fixed in master now