surrealdb / docker.surrealdb.com

Configuration files for running a multi-node SurrealDB cluster using Docker
https://docker.surrealdb.com
Apache License 2.0
36 stars 5 forks source link

docker-compose up fails ERROR: for prometheus #2

Open Vertex21 opened 1 year ago

Vertex21 commented 1 year ago

Just started playing with this today. After creating the docker-compose.yml I ran: docker-compose --profile monitoring up -d && docker-compose logs -f Everything pulled fine but I got an error at "Creating surrealdb-prometheus ... error" After everything was done pulling and creating, this was the error it gave: ERROR: for prometheus Cannot start service prometheus: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/my/path/to/surrealdb/config/prometheus.yml" to rootfs at "/etc/prometheus/prometheus.yml": mount /my/path/to/surrealdb/config/prometheus.yml:/etc/prometheus/prometheus.yml (via /proc/self/fd/6), flags: 0x5001: 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

I went into config and noticed that all of the following were directories instead of files: pd.rules.yml, prometheus.yml, tidb.rules.yml, tikv.rules.yml. I'm assuming these are supposed to be regular yml configuration files but they got created as directories for some reason. Any thoughts on how to fix this? Or point me to what those yml files are supposed to contain and I'll recreate them and try again.

Thanks!

Vertex21 commented 1 year ago

Also just tried running docker compose without the monitoring by, docker-compuse up -d && docker-compose logs -f, and I get a bunch of log outputs of : surrealdb-grafana | GF_PATHS_CONFIG='/etc/grafana/grafana.ini' is not readable. surrealdb-grafana | You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migration-from-a-previous-version-of-the-docker-container-to-5-1-or-later surrealdb-grafana | t=2023-01-06T15:48:39+0000 lvl=crit msg="Failed to parse /etc/grafana/grafana.ini, open /etc/grafana/grafana.ini: no such file or directory"

malachid commented 1 year ago

I also ran into the above issue. I also noticed that all the local files were created as root rather than the local user. Wiped out the directories, updated the userns-remap and verified that even when the files are created as my local user; the prometheus bit fails since everything in config is a directory.

If I run this before docker-compose, prometheus no longer complains. There are other errors in the logs about grafana's ini file, etc... but docker appears to startup.

#!/bin/bash

mkdir -p ${PWD}/config
touch $PWD/config/pd.rules.yml
touch $PWD/config/prometheus.yml
touch $PWD/config/tidb.rules.yml
touch $PWD/config/tikv.rules.yml