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

Looping instead of erroring when MySQL query returned all strings #138

Open
lchopfpt opened this issue Dec 23, 2022 · 1 comment
Open

Looping instead of erroring when MySQL query returned all strings #138

lchopfpt opened this issue Dec 23, 2022 · 1 comment

Comments

@lchopfpt
Copy link

This one took me awhile to figure out.

This was definitely a user error, that made the tool get stuck in a loop blocking all other queries.

Using mysql, the query was accidentally formulated to return all strings.
It was supposed to get max timestamp value from table and also return two labels.
It ended up looking like (fake query below)
select max('columnname here') metric1, 'tablename' as 'label1', 'columnname' as 'label2' from tablename

The results were that it seemed like several metrics were not ever being queried. No Logs, no Errors. I finally tracked down the connection on the db, and saw that it was looping. Continuing to retry this query over and over.
The retries were also not getting calculated under query counts, nor query errors and so was infinitely looping and blocking everything else from happening.

The request is to catch when no value returned is a float.

I did see other errors that caught similar like:
TypeError: float() argument must be a string or a real number, not 'datetime.datetime'
when not wrapping a timestamp in unix_timestamp

@lchopfpt
Copy link
Author

Realized my query wasn't clear.
select max('varchar columnname here') metric1, 'tablename' as 'label1', 'columnname' as 'label2' from tablename
So it returns something like:

metric1   label1    label2
foo          table      column

The output did not like that none of those were integers.

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

No branches or pull requests

1 participant