Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose up fails ERROR: for prometheus #2

Open
LeveL7LLC opened this issue Jan 6, 2023 · 2 comments
Open

docker-compose up fails ERROR: for prometheus #2

LeveL7LLC opened this issue Jan 6, 2023 · 2 comments

Comments

@LeveL7LLC
Copy link

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!

@LeveL7LLC
Copy link
Author

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
Copy link

malachid commented Jan 22, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants