Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

No JSON object could be decoded #89

@Fkawala

Description

@Fkawala

Hi,

I have trouble using queues (python-librato/librato/queue.py). I create the queue as demonstrated in the docs (see below). The queue auto-submit fails with a ValueError exception that is raised when the response from the server is parsed.

Best,
François.

Minimum example:

LIBRATO_USER = '****'
LIBRATO_TOKEN = '****'
api = librato.connect(LIBRATO_USER, LIBRATO_TOKEN)
q = api.new_queue(auto_submit_count=1)
q.add('sdfsdf',1)

Error stack:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/librato/queue.py", line 61, in add
    self.submit()
  File "/usr/local/lib/python2.7/dist-packages/librato/queue.py", line 95, in submit
    self.connection._mexe("metrics", method="POST", query_props=c)
  File "/usr/local/lib/python2.7/dist-packages/librato/__init__.py", line 170, in _mexe
    resp_data, success, backoff = self._process_response(resp, backoff)
  File "/usr/local/lib/python2.7/dist-packages/librato/__init__.py", line 147, in _process_response
    resp_data = json.loads(body.decode(_getcharset(resp)))
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

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