Jump to content

Emby Metrics Exporter


Bagul

Recommended Posts

Bagul
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.

Link to comment
Share on other sites

dylan62370

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 😕

Capture d’écran 2023-04-17 à 17.10.43.png

Link to comment
Share on other sites

jaycedk

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 ?

  • Agree 1
Link to comment
Share on other sites

Bagul
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 😕

Capture d’écran 2023-04-17 à 17.10.43.png

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.

Link to comment
Share on other sites

Bagul

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

 

  • Like 1
Link to comment
Share on other sites

dylan62370

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#

 

Link to comment
Share on other sites

Bagul
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 by Bagul
Link to comment
Share on other sites

dylan62370

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#

 

Capture d’écran 2023-04-18 à 22.53.11.png

Link to comment
Share on other sites

Bagul
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.

 

Link to comment
Share on other sites

Bagul

What system are you on? The natural behavior of Docker when you give it a destination folder is to create all the folders provided.

Link to comment
Share on other sites

dylan62370

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?

 

Capture d’écran 2023-04-19 à 09.57.15.png

Link to comment
Share on other sites

Bagul

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.

Link to comment
Share on other sites

dylan62370

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

 

Capture d’écran 2023-04-19 à 10.38.58.png

Link to comment
Share on other sites

Bagul

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.

Capture d’écran 2023-04-19 à 10.48.09.png

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.

Link to comment
Share on other sites

dylan62370

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.

Capture d’écran 2023-04-19 à 11.12.08.png

Link to comment
Share on other sites

Bagul
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.

Capture d’écran 2023-04-19 à 11.12.08.png

Can you run this command: docker inspect <name_of_your_container>

And share the "Mounts" section

Link to comment
Share on other sites

dylan62370

Hello @Bagul

Yes, here it is

        "Mounts": [
            {
                "Type": "bind",
                "Source": "/emby_exporter_go/config",
                "Destination": "/config",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

 

Link to comment
Share on other sites

Bagul
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

 

Link to comment
Share on other sites

dylan62370

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.

Link to comment
Share on other sites

Bagul
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'?

Link to comment
Share on other sites

dylan62370

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!

 

 

Capture d’écran 2023-04-20 à 23.15.17.png

Link to comment
Share on other sites

dylan62370

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

 

Capture d’écran 2023-04-20 à 23.22.19.png

Capture d’écran 2023-04-20 à 23.24.12.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...