Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

JSONDecodeError in client.query() #567

Closed

Description

@Vanclief

I am trying to perform a valid query to a remote influx database. It will fail for certain time frames.

query = "SELECT * FROM {} WHERE \
            time > '{}' and time < '{}'".format(metric, str(start_date)[:10],
                    str(end_date)[:10])

    raw_tweets = client.query(query, database=dbname)

Will fail with:

File "/usr/lib/python3.6/site-packages/influxdb/client.py", line 400, in query
    data = response.json()
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Why would be the response not be a valid JSON object?

Activity

  1. xginn8 commented on Mar 11, 2018

    @xginn8
    Collaborator

    If you execute that same query via the CLI, is there data returned? Also, what version(s) of InfluxDB and this python library are you currently running?

  2. xginn8 commented on Jul 1, 2018

    @xginn8
    Collaborator

    Closing due to lack of response -- we can reopen if needed.

  3. cemanughian commented on Aug 13, 2019

    @cemanughian

    I am having the same issue

  4. vshah-lifesize commented on Oct 10, 2019

    @vshah-lifesize

    Facing the same issue. Please reopen..

  5. rbdm-qnt commented on Mar 26, 2020

    @rbdm-qnt

    Same issue here

  6. william-allen-harris commented on May 1, 2020

    @william-allen-harris

    same problem

  7. salvapinyol commented on Nov 13, 2020

    @salvapinyol

    same problem here using influxdb 2.0.1. Please reopen.

  8. TheOneValen commented on Mar 4, 2021

    @TheOneValen

    same problem 2.0.3

  9. harmv commented on Feb 17, 2022

    @harmv

    Same problem, could not reopen, filed #915 with more details (and a patch/workaround)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions