Bagul 177 Posted April 17, 2023 Author Posted April 17, 2023 2 hours ago, dylan62370 said: Hello, On my side it doesn't work when I run docker I get this error: 2023/04/17 09:48:07 open config.yml: no such file or directory panic: open config.yml: no such file or directory goroutine 1 [running]: log.Panicf(0x958042, 0x2, 0xc000147df0, 0x1, 0x1) /usr/local/go/src/log/log.go:361 +0xc5 TOomaAh/emby_exporter_go/conf.NewConfig(0x7ffc9d24af47, 0xa, 0x0, 0x0, 0x0) /app/conf/conf.go:38 +0xf5 main.main() /app/main.go:34 +0xf8 Yet I created a config folder in the emby_exporter_go folder then in the config folder I created the config.yml file. Hey! Can you share your docker-compose or the docker command you use.
dylan62370 6 Posted April 17, 2023 Posted April 17, 2023 Hello @Bagul! I used this command docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=config.yml \ -v '/emby_exporter_go/config/config.yml:/config/file.yml' \ bagul/goemby_exporter:latest I installed portainer to have more visibility on the problem and I see no volume created
Neminem 796 Posted April 17, 2023 Posted April 17, 2023 Hmm whats you config file name. Here you are looking for config.yml -e CONFIG_FILE=config.yml \ And here your at telling docker to look for file.yml -v '/emby_exporter_go/config/config.yml:/config/file.yml' \ But the file is named config.yml right ? 1
Bagul 177 Posted April 17, 2023 Author Posted April 17, 2023 12 minutes ago, dylan62370 said: Hello @Bagul! I used this command docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=config.yml \ -v '/emby_exporter_go/config/config.yml:/config/file.yml' \ bagul/goemby_exporter:latest I installed portainer to have more visibility on the problem and I see no volume created Ok, I see. The variable 'CONFIG_FILE' allows to define another name for the configuration file. So, if you put '[...]:/config/file.yml', you will create a configuration file called 'file.yml' in the config folder. But you have to specify the same name in the CONFIG_FILE variable.
Bagul 177 Posted April 17, 2023 Author Posted April 17, 2023 It should look like this: docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=config.yml \ -v '/emby_exporter_go/config/config.yml:/config/config.yml' \ bagul/goemby_exporter:latest or: docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=file.yml \ -v '/emby_exporter_go/config/config.yml:/config/file.yml' \ bagul/goemby_exporter:latest And you have to check at the location '/emby_exporter_go/config/' on the parent system that the item 'config.yml' or 'file.yml' is a file and not a folder and then fill in the information that looks like this: server: url: "http://<ip|domain name>" port: 8096 token: "your token" userID: "your userID" options: # optional geoip: true # optional : default false 1
dylan62370 6 Posted April 17, 2023 Posted April 17, 2023 Hello, So here is what I put, however I always get an error, I have before launching the docker command I created the config.yml file in the /emby_exporter_go/config folder root@emby:~/emby_exporter_go# docker run -d -it \ > --name=emby_exporter \ > -e CONFIG_FILE=config.yml \ > -v '/emby_exporter_go/config/config.yml:/config/config.yml' \ > bagul/goemby_exporter:latest 3dcf9afa9cd41365fd2cff21b1ef3112a75f204039a6cdbfc9a5dece92ec6433 docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/emby_exporter_go/config/config.yml" to rootfs at "/config/config.yml": mount /emby_exporter_go/config/config.yml:/config/config.yml (via /proc/self/fd/7), flags: 0x5000: 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. root@emby:~/emby_exporter_go#
Bagul 177 Posted April 18, 2023 Author Posted April 18, 2023 (edited) 23 hours ago, dylan62370 said: Hello, So here is what I put, however I always get an error, I have before launching the docker command I created the config.yml file in the /emby_exporter_go/config folder root@emby:~/emby_exporter_go# docker run -d -it \ > --name=emby_exporter \ > -e CONFIG_FILE=config.yml \ > -v '/emby_exporter_go/config/config.yml:/config/config.yml' \ > bagul/goemby_exporter:latest 3dcf9afa9cd41365fd2cff21b1ef3112a75f204039a6cdbfc9a5dece92ec6433 docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/emby_exporter_go/config/config.yml" to rootfs at "/config/config.yml": mount /emby_exporter_go/config/config.yml:/config/config.yml (via /proc/self/fd/7), flags: 0x5000: 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. root@emby:~/emby_exporter_go# It's a docker error. Try this: docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=config.yml \ -v '/emby_exporter_go/config:/config' \ bagul/goemby_exporter:latest And if you have a folder with this name: 'config.yml' in your 'emby_exporter_folder/config' delete it. Edited April 18, 2023 by Bagul
dylan62370 6 Posted April 18, 2023 Posted April 18, 2023 Hello @Bagul So as you indicated I deleted the config.yml file that I had created in /emby_exporter_go/config However, after launching as you can see, it didn't create any config.yml file so I could set up my configuration. I added in screenshot the docker logs if needed. root@emby:~/emby_exporter_go# ls conf config Dockerfile emby entrypoint.sh example geoip go.mod go.sum main.go metrics README.md series root@emby:~/emby_exporter_go# docker run -d -it \ > --name=emby_exporter \ > -e CONFIG_FILE=config.yml \ > -v '/emby_exporter_go/config:/config' \ > bagul/goemby_exporter:latest Unable to find image 'bagul/goemby_exporter:latest' locally latest: Pulling from bagul/goemby_exporter 8921db27df28: Pull complete 3341ad9eda33: Pull complete fc067ad41f0d: Pull complete efd49ed78728: Pull complete a2d4a022afd2: Pull complete 4bee21df7bd4: Pull complete Digest: sha256:5bcd69514c2d70ac7101207cb23c3131daabb4a11e3fc1025b7851a68ef0508d Status: Downloaded newer image for bagul/goemby_exporter:latest 7ced2b10038742b39a63bcf76d51ebe9ff8a15aaf20ff92e4b13c3b057b999b2 root@emby:~/emby_exporter_go# ls conf config Dockerfile emby entrypoint.sh example geoip go.mod go.sum main.go metrics README.md series root@emby:~/emby_exporter_go# cd config root@emby:~/emby_exporter_go/config#
Bagul 177 Posted April 19, 2023 Author Posted April 19, 2023 14 hours ago, Bagul said: And if you have a folder with this name: 'config.yml' in your 'emby_exporter_folder/config' delete it. 10 hours ago, dylan62370 said: So as you indicated I deleted the config.yml file that I had created in /emby_exporter_go/config No. I asked to delete the 'config.yml' folder if there was one. You must have a config.yml file but docker creates a folder not a file.
dylan62370 6 Posted April 19, 2023 Posted April 19, 2023 Docker does not create any volume, it does not create a config.yml folder.
Bagul 177 Posted April 19, 2023 Author Posted April 19, 2023 What system are you on? The natural behavior of Docker when you give it a destination folder is to create all the folders provided.
dylan62370 6 Posted April 19, 2023 Posted April 19, 2023 I have just placed the order again and it has just created a volume for me. It has created a config.yml folder. Or should I create a config.yml file to integrate my configuration?
Bagul 177 Posted April 19, 2023 Author Posted April 19, 2023 It is therefore necessary: 1. Delete the config.yml folder 2. Create a config.yml file in the same location The config.yml element must be a file.
dylan62370 6 Posted April 19, 2023 Posted April 19, 2023 Here is how I did it. I deleted the config.yml folder and the _data folder that was present in the config.yml folder. I then created a config.yml file in /var/lib/docker/volumes/ and I put my configuration in it. I then started my docker but it still shows me the same errors. And I still see the volume as unused. 2023/04/19 08:36:14 open config.yml: no such file or directory panic: open config.yml: no such file or directory goroutine 1 [running]: log.Panicf(0x958042, 0x2, 0xc00014ddf0, 0x1, 0x1) /usr/local/go/src/log/log.go:361 +0xc5 TOomaAh/emby_exporter_go/conf.NewConfig(0x7ffeb366df47, 0xa, 0x0, 0x0, 0x0) /app/conf/conf.go:38 +0xf5 main.main() /app/main.go:34 +0xf8
dylan62370 6 Posted April 19, 2023 Posted April 19, 2023 This is the current volume configuration. Since the creation I have not made any changes.
Bagul 177 Posted April 19, 2023 Author Posted April 19, 2023 Ok I didn't see the destination path. Let's start again... The tool you are trying to implement needs a configuration file. The basic command to install on docket that works is this: docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=file.yml \ -v '/path/to/your/config/file.yml:/config/file.yml' \ bagul/goemby_exporter:latest So if I run this command, docker should create the path '/path/to/your/config/file.yml/'. with file.yml which will be a folder and not a file because docker doesn't know it is a file. In your example it is a docker volume and not a folder that you specified. The config.yml folder should not contain anything since it is a file. So I invite you to recreate the container correctly by deleting all the volumes that were created for the export and ONLY the volumes created for the exporter. 2 minutes ago, dylan62370 said: This is the current volume configuration. Since the creation I have not made any changes. This should work if you have created the config.yml file in the '/emby_exporter_go/config/' folder So like this: '/emby_exporter_go/config/config.yml' (taking into account the name you provided in the 'CONFIG_FILE' variable.
Bagul 177 Posted April 19, 2023 Author Posted April 19, 2023 (edited) N/A Edited April 19, 2023 by Bagul
dylan62370 6 Posted April 19, 2023 Posted April 19, 2023 I tested the basic command to see if docker creates a path. It does not create any path or volume... docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=file.yml \ -v '/path/to/your/config/file.yml:/config/file.yml' \ bagul/goemby_exporter:latest I then tested with this command by adding in the /emby_exporter_go/config folder the config.yml file. docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=config.yml \ -v '/emby_exporter_go/config:/config' \ bagul/goemby_exporter:latest With this command, it does not create a volume because I think it uses the config.yml file that I created in the /emby_exporter_go/config folder Here are the logs: 2023/04/19 09:11:05 open config.yml: no such file or directory panic: open config.yml: no such file or directory goroutine 1 [running]: log.Panicf(0x958042, 0x2, 0xc000147df0, 0x1, 0x1) /usr/local/go/src/log/log.go:361 +0xc5 TOomaAh/emby_exporter_go/conf.NewConfig(0x7fffb48aaf47, 0xa, 0x0, 0x0, 0x0) /app/conf/conf.go:38 +0xf5 main.main() /app/main.go:34 +0xf8 And in screenshot is the volume created with the config.yml file that I created in the config folder.
Bagul 177 Posted April 19, 2023 Author Posted April 19, 2023 7 minutes ago, dylan62370 said: I tested the basic command to see if docker creates a path. It does not create any path or volume... docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=file.yml \ -v '/path/to/your/config/file.yml:/config/file.yml' \ bagul/goemby_exporter:latest I then tested with this command by adding in the /emby_exporter_go/config folder the config.yml file. docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=config.yml \ -v '/emby_exporter_go/config:/config' \ bagul/goemby_exporter:latest With this command, it does not create a volume because I think it uses the config.yml file that I created in the /emby_exporter_go/config folder Here are the logs: 2023/04/19 09:11:05 open config.yml: no such file or directory panic: open config.yml: no such file or directory goroutine 1 [running]: log.Panicf(0x958042, 0x2, 0xc000147df0, 0x1, 0x1) /usr/local/go/src/log/log.go:361 +0xc5 TOomaAh/emby_exporter_go/conf.NewConfig(0x7fffb48aaf47, 0xa, 0x0, 0x0, 0x0) /app/conf/conf.go:38 +0xf5 main.main() /app/main.go:34 +0xf8 And in screenshot is the volume created with the config.yml file that I created in the config folder. Can you run this command: docker inspect <name_of_your_container> And share the "Mounts" section
dylan62370 6 Posted April 20, 2023 Posted April 20, 2023 Hello @Bagul Yes, here it is "Mounts": [ { "Type": "bind", "Source": "/emby_exporter_go/config", "Destination": "/config", "Mode": "", "RW": true, "Propagation": "rprivate" } ],
Bagul 177 Posted April 20, 2023 Author Posted April 20, 2023 7 hours ago, dylan62370 said: Hello @Bagul Yes, here it is "Mounts": [ { "Type": "bind", "Source": "/emby_exporter_go/config", "Destination": "/config", "Mode": "", "RW": true, "Propagation": "rprivate" } ], Wow I'm stupid... sorry Run this: docker run -d -it \ --name=emby_exporter \ -e CONFIG_FILE=/config/config.yml \ -v '/emby_exporter_go/config:/config' \ bagul/goemby_exporter:latest
dylan62370 6 Posted April 20, 2023 Posted April 20, 2023 Here are the container logs after its creation. 2023/04/20 20:55:58 Cannot decode config file: yaml: input error: read /config/config.yml: is a directory panic: Cannot decode config file: yaml: input error: read /config/config.yml: is a directory goroutine 1 [running]: log.Panicf(0x962d22, 0x1d, 0xc000147df0, 0x1, 0x1) /usr/local/go/src/log/log.go:361 +0xc5 TOomaAh/emby_exporter_go/conf.NewConfig(0x7ffcf7e07f37, 0x12, 0x0, 0x0, 0x0) /app/conf/conf.go:50 +0x305 main.main() /app/main.go:34 +0xf8 I don't understand why it says it's a folder when it's really a file, in any case the error is not the same. root@emby:~/emby_exporter_go/config# ls config.yml This is still the file I created at the beginning.
Bagul 177 Posted April 20, 2023 Author Posted April 20, 2023 4 minutes ago, dylan62370 said: Here are the container logs after its creation. 2023/04/20 20:55:58 Cannot decode config file: yaml: input error: read /config/config.yml: is a directory panic: Cannot decode config file: yaml: input error: read /config/config.yml: is a directory goroutine 1 [running]: log.Panicf(0x962d22, 0x1d, 0xc000147df0, 0x1, 0x1) /usr/local/go/src/log/log.go:361 +0xc5 TOomaAh/emby_exporter_go/conf.NewConfig(0x7ffcf7e07f37, 0x12, 0x0, 0x0, 0x0) /app/conf/conf.go:50 +0x305 main.main() /app/main.go:34 +0xf8 I don't understand why it says it's a folder when it's really a file, in any case the error is not the same. root@emby:~/emby_exporter_go/config# ls config.yml This is still the file I created at the beginning. Wasn't the folder created in '/emby_exporter_go/config' and not in '~/emby_exporter_go/config'?
dylan62370 6 Posted April 20, 2023 Posted April 20, 2023 Good point! It finally works! The container is working thank you very much for your help and patience! I'll be able to get the metrics now!
dylan62370 6 Posted April 20, 2023 Posted April 20, 2023 Well... the container is on its way but however it does not bring up any metrics... goroutine 1 [running]: log.Panicf(0x962d22, 0x1d, 0xc000147df0, 0x1, 0x1) /usr/local/go/src/log/log.go:361 +0xc5 TOomaAh/emby_exporter_go/conf.NewConfig(0x7ffcf7e07f37, 0x12, 0x0, 0x0, 0x0) /app/conf/conf.go:50 +0x305 main.main() /app/main.go:34 +0xf8 2023/04/20 21:14:55 Beginning to serve on port 9210 2023/04/20 21:14:55 You can see the metrics on http://localhost:9210/metrics 2023/04/20 21:19:14 Beginning to serve on port 9210 2023/04/20 21:19:14 You can see the metrics on http://localhost:9210/metrics 2023/04/20 21:21:35 Beginning to serve on port 9210 2023/04/20 21:21:35 You can see the metrics on http://localhost:9210/metrics
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now