991jo / srcds_exporter

an prometheus exporter for SRCDS based gameservers (like CSGO, TF2, L4D2, ...).
17 stars 5 forks source link

Error when using exporter #6

Closed larrryfisherthefisherman closed 5 years ago

larrryfisherthefisherman commented 5 years ago

This is the output I get when I run the script. (I added traceback)

Python Version: Python 3.5.3

Running it with the debug URL:

[14/04/2019 01:06] INFO test <module> 19: Using uvloop
[14/04/2019 01:07] ERROR test handler 134: 'coroutine' object is not iterable
Traceback (most recent call last):
  File "main.py", line 83, in handler
    status, stats = rcon_query(ip, port, password)
TypeError: 'coroutine' object is not iterable
[14/04/2019 01:07] INFO web_log log 233: 127.0.0.1 [14/Apr/2019:01:07:10 +0000] "GET /metrics?target=127.0.0.1:27015&password=password HTTP/1.1" 200 227 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"

Running it from Promethus:

[14/04/2019 01:11] ERROR test handler 134: 'coroutine' object is not iterable
Traceback (most recent call last):
  File "main.py", line 83, in handler
    status, stats = rcon_query(ip, port, password)
TypeError: 'coroutine' object is not iterable
[14/04/2019 01:11] INFO web_log log 233: 127.0.0.1 [14/Apr/2019:01:11:21 +0000] "GET /metrics?password=password&target=127.0.0.1:27015 HTTP/1.1" 200 227 "-" "Prometheus/2.8.1
991jo commented 5 years ago

Seems like I haven't tested properly. I will fix that later today. If you need a working version got back to this commit: https://github.com/991jo/srcds_exporter/commit/f388f6a3351461e162e645195fbf46f99bc6a8a2

991jo commented 5 years ago

I have to correct my statement regarding which commit is working. b550d71 is working for me.

991jo commented 5 years ago

Okay, found the error. There is a bug in the aiorcon https://github.com/skmendez/aiorcon library for which the workaround got removed in https://github.com/991jo/srcds_exporter/pull/1 . The bug has an open pull request in the upstream repo. https://github.com/skmendez/aiorcon/pull/1 The bug is fixed in the latest commit.