question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

listen() returning error

See original GitHub issue

Getting the following error from the listen() function.

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "fb_chat.py", line 59, in handle_new_message
    client.listen()
  File "/usr/local/lib/python2.7/dist-packages/fbchat/client.py", line 517, in listen
    sticky, pool = self._getSticky()
  File "/usr/local/lib/python2.7/dist-packages/fbchat/client.py", line 442, in _getSticky
    j = get_json(r.text)
  File "/usr/local/lib/python2.7/dist-packages/fbchat/utils.py", line 18, in get_json
    return json.loads(re.sub(r"^[^{]*", '', text, 1))
  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

With the following lines,

print r
print '-----'
print r.text

I got this output

<Response [400]>
-----

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
Zulexcommented, Nov 28, 2016
0reactions
carpedm20commented, Jan 30, 2017

Merged #77

Read more comments on GitHub >

github_iconTop Results From Across the Web

Socket Programming: Error on listen() - visual c++
You can't use listen() on a datagram socket, thus the WSAEOPNOTSUPP error you are seeing: If no error occurs, listen returns zero.
Read more >
listen() — Prepare the server for incoming client requests - IBM
The listen() call indicates a readiness to accept client connection requests. It transforms an active socket into a passive socket. Once called, socket...
Read more >
listen
RETURN VALUE. Upon successful completions, listen() shall return 0; otherwise, -1 shall be returned and errno set to indicate the error.
Read more >
listen(2) - Linux manual page - man7.org
RETURN VALUE top​​ On success, zero is returned. On error, -1 is returned, and errno is set to indicate the error.
Read more >
explain_listen(3): explain listen errors - Linux man page
The explain_errno_listen function is used to obtain an explanation of an error returned by the listen(2) system call. The least the message will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found