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

strconv.ParseFloat: parsing "???": invalid syntax #4827

Closed
Teumaat opened this issue Oct 8, 2018 · 7 comments
Closed

strconv.ParseFloat: parsing "???": invalid syntax #4827

Teumaat opened this issue Oct 8, 2018 · 7 comments
Labels
area/mqtt bug unexpected problem or unintended behavior

Comments

@Teumaat
Copy link

Teumaat commented Oct 8, 2018

Telegraf 1.8.1 (git: HEAD ae9efb2f)
Ubuntu 16.04.5 LTS

telegraf.conf
[[inputs.mqtt_consumer]]
...
data_format = "value"
data_type = "float"

syslog error
2018-10-08T07:59:30Z E! Error in plugin [inputs.mqtt_consumer]: E! MQTT Parse Error
message: ???
error: strconv.ParseFloat: parsing "???": invalid syntax

MQTT value
events/cv/otmonitor/modulation ???

I am running OpenTherm monitor (http://otgw.tclcode.com/) to publish stats about my HVAC to MQTT. One of the values contains ??? which Telegraf does not seem to like. This is not a problem for me but Telegraf seems to hang on this parse error and does nothing further.

@glinton glinton added bug unexpected problem or unintended behavior area/mqtt labels Oct 8, 2018
@glinton
Copy link
Contributor

glinton commented Oct 8, 2018

Do you have a simple way to reproduce this (config example/test)? thanks

@danielnelson
Copy link
Contributor

Does this exact topic contain good data as well? If not, perhaps we can just exclude this topic?

@Teumaat
Copy link
Author

Teumaat commented Oct 9, 2018

Do you have a simple way to reproduce this (config example/test)? thanks

What do you need? I have included a snippet from my config file and the MQTT topic with value.

Does this exact topic contain good data as well? If not, perhaps we can just exclude this topic?

No this topic always contains ??? because my HVAC does not supply this information on the OpenTherm bus. How can I exclude a topic? Still this needs to be fixed I think. I don't see why a single incorrect value can break the entire workings of Telegraf.

@danielnelson
Copy link
Contributor

Using the topics option can you not subscribe to this topic? I don't think there is an way to exclude topics in MQTT but maybe you can select around this topic.

  ## Topics to subscribe to
  topics = [
    "telegraf/host01/cpu",
    "telegraf/+/mem",
    "sensors/#",
  ]

I don't see why a single incorrect value can break the entire workings of Telegraf.

I don't see any reason in the current code that this would cause processing to stop, but we will try to replicate with a real MQTT broker. However, since you are subscribed to a topic to parse messages that contains data formatted in an unexpected way I don't think we would remove the log message.

@Teumaat
Copy link
Author

Teumaat commented Oct 10, 2018

I think I might be having issue 4594 because Telegraf just stops reporting. When I try to kill Telegraf it also does not want to die. Only a kill -9 does the trick.

Yes seems that way:
2018-10-10T14:05:10Z I! MQTT Client Connected
2018-10-10T14:05:10Z I! MQTT Client Connected

@danielnelson
Copy link
Contributor

I put together a PR for the connection/reconnection issues #4846, do you think you could test with one of the builds here: #4846 (comment)

On the issue where you cannot shutdown, I believe I have a fix for that too but the PR is not quite ready. There are a few open issues that are describe this or are closely related: #4610, #4457. I'm planning to have this fixed in 1.9 as it ended up requiring some rather large changes.

@Teumaat
Copy link
Author

Teumaat commented Oct 11, 2018

Nice :) I've installed the deb and everything seems to be working fine for now. I have restarted Telegraf a few times and I have not seen any double connects so that fix is working :)

@Teumaat Teumaat closed this as completed Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mqtt bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants