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

Failed to update metrics (player) #2

Open
mr190e opened this issue Feb 1, 2025 · 3 comments
Open

Failed to update metrics (player) #2

mr190e opened this issue Feb 1, 2025 · 3 comments
Labels
question Further information is requested

Comments

@mr190e
Copy link

mr190e commented Feb 1, 2025

since the last update (I pulled it more or less accidently via docker because I changed some settings), I get these errors:

2025-02-01T22:27:05Z ERR Failed to send 'players' command error="connection to server is down, need reconnect"

2025-02-01T22:27:05Z ERR Error updating metrics error="connection to server is down, need reconnect" context=player

2025-02-01T22:27:05Z FTL Failed to update metrics (player)

It almost looks to me like either RCON is down, but this would be really weird as it just worked until before the update. I think I came from version 0.1.1

Has there been a change in the config maybe?

@WoozyMasta
Copy link
Owner

Probably just the logs became more detailed

If you had problems with the configuration, the exporter would not start at all, since the first thing it does is check the connection and try to initialize the metrics. You would simply get the error "Failed to establish connections to RCON" when starting.

According to the description, it looks more like your server is being restarted according to a schedule. And while the DayZ server is off, an attempt is made to collect metrics.

And if this is so, then this is normal behavior, because the server is currently off, you can just forget about it, and let the exporter also restart with the server shutdown. Or if you want a correct termination, then stop and start the exporter yourself along with the server restart.

@WoozyMasta WoozyMasta added the question Further information is requested label Feb 4, 2025
@mr190e
Copy link
Author

mr190e commented Feb 10, 2025

When I role back to version 0.3.0 everything is fine. Its just that since 0.3.1 nothing seems to work anymore. I didnt touch anything in configs. I just so happen to stop the docker container and I renamed them, which lead to re-pulling the latest image (I had this checkbox checked).

@WoozyMasta
Copy link
Owner

When does the problem occur? Immediately upon launching the application, or after some time? If after some time, then after what time and how often?


I can't reproduce this problem, and between 0.3.0 and 0.3.1 there were no changes in this part

# get 0.3.1 image and config example

docker pull ghcr.io/woozymasta/dayz-exporter:0.3.1
docker run --rm -ti ghcr.io/woozymasta/dayz-exporter:latest \
  --get-yaml > dayz-exporter-tmp.yaml

# change ip, port and password in dayz-exporter-tmp.yaml and run it

docker run  --rm -ti -p 8098:8098 \
  -v "$PWD/dayz-exporter-tmp.yaml:/config.yaml" \
  ghcr.io/woozymasta/dayz-exporter:0.3.1

I just launched it, everything works

2025-02-11T10:03:44Z INF Connected to "WM vanilla [Cherno]" (chernarusplus) server on 192.168.1.12:27021
2025-02-11T10:03:44Z INF Starting metrics server at 0.0.0.0:8098
2025-02-11T10:04:09Z INF HTTP request completed duration=0.049274 method=GET remote=10.0.2.100:41302 size=2546 status=200 url=/
2025-02-11T10:04:09Z INF HTTP request completed duration=0.035708 method=GET remote=10.0.2.100:41302 size=2546 status=200 url=/favicon.ico
2025-02-11T10:04:11Z TRC Server A2S metrics updated
2025-02-11T10:04:11Z TRC Player metrics updated
2025-02-11T10:04:11Z DBG Ban metrics disabled, skipping update
2025-02-11T10:04:11Z DBG Metrics updated
2025-02-11T10:04:11Z INF HTTP request completed duration=83.028991 method=GET remote=10.0.2.100:41302 size=2261 status=200 url=/metrics
2025-02-11T10:04:16Z TRC Server A2S metrics updated
2025-02-11T10:04:16Z TRC Player metrics updated
2025-02-11T10:04:16Z DBG Ban metrics disabled, skipping update
2025-02-11T10:04:16Z DBG Metrics updated
2025-02-11T10:04:16Z INF HTTP request completed duration=61.519443 method=GET remote=10.0.2.100:41302 size=2279 status=200 url=/metrics

I changed the password to a deliberately incorrect one and it doesn't work

2025-02-11T10:04:37Z FTL Failed to establish connections to RCON port 192.168.1.12:23015

changed the port to a known wrong one and it doesn't work

2025-02-11T10:05:12Z FTL Failed to establish connections to RCON port 192.168.1.12:2301

Everything works correctly, metrics are collected, if the config is incorrect the application simply does not start


Or maybe you use both the config and environment variables at the same time?

DAYZ_EXPORTER_RCON_PASSWORD=right

and in the config

rcon:
password: wrong

the config in this case has a higher priority than the environment variables, this is written in the help

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

No branches or pull requests

2 participants