plivo / plivoframework

Open Source Telephony Application Prototyping Framework
http://www.plivo.com/open-source/
Other
419 stars 179 forks source link

lockingSwitchOutError: Impossible to call blocking function in the event loop callback #143

Open shashiece opened 6 years ago

shashiece commented 6 years ago

I don't have work experience python,but i want to use plivo opensource but getting below error please help

2018-03-03 23:30:36,635 plivo-outbound[4059]: INFO: OutboundServer started at '127.0.0.1:8084' 2018-03-03 23:30:46,046 plivo-outbound[4059]: INFO: (1) New request from ('127.0.0.1', 56672) 2018-03-03 23:30:46,049 plivo-outbound[4059]: DEBUG: (1) Execute: connect args='' 2018-03-03 23:30:46,054 plivo-outbound[4059]: ERROR: (1) Traceback (most recent call last): 2018-03-03 23:30:46,054 plivo-outbound[4059]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/rest/freeswitch/outboundsocket.py", line 315, in run 2018-03-03 23:30:46,055 plivo-outbound[4059]: ERROR: (1) self._run() 2018-03-03 23:30:46,055 plivo-outbound[4059]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/rest/freeswitch/outboundsocket.py", line 325, in _run 2018-03-03 23:30:46,055 plivo-outbound[4059]: ERROR: (1) self.connect() 2018-03-03 23:30:46,056 plivo-outbound[4059]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/core/freeswitch/outboundsocket.py", line 54, in connect 2018-03-03 23:30:46,056 plivo-outbound[4059]: ERROR: (1) connect_response = self._protocol_send("connect") 2018-03-03 23:30:46,056 plivo-outbound[4059]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/rest/freeswitch/outboundsocket.py", line 140, in _protocol_send 2018-03-03 23:30:46,056 plivo-outbound[4059]: ERROR: (1) command, args) 2018-03-03 23:30:46,057 plivo-outbound[4059]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/core/freeswitch/eventsocket.py", line 376, in _protocol_send 2018-03-03 23:30:46,057 plivo-outbound[4059]: ERROR: (1) _uuid, event = _async_res.get() 2018-03-03 23:30:46,057 plivo-outbound[4059]: ERROR: (1) File "/usr/local/plivo/local/lib/python2.7/site-packages/gevent/event.py", line 382, in get 2018-03-03 23:30:46,058 plivo-outbound[4059]: ERROR: (1) self._wait_core(timeout, ()) 2018-03-03 23:30:46,058 plivo-outbound[4059]: ERROR: (1) File "/usr/local/plivo/local/lib/python2.7/site-packages/gevent/event.py", line 106, in _wait_core 2018-03-03 23:30:46,058 plivo-outbound[4059]: ERROR: (1) result = self.hub.switch() 2018-03-03 23:30:46,058 plivo-outbound[4059]: ERROR: (1) File "/usr/local/plivo/local/lib/python2.7/site-packages/gevent/hub.py", line 629, in switch 2018-03-03 23:30:46,059 plivo-outbound[4059]: ERROR: (1) switch_out() 2018-03-03 23:30:46,059 plivo-outbound[4059]: ERROR: (1) File "/usr/local/plivo/local/lib/python2.7/site-packages/gevent/hub.py", line 633, in switch_out 2018-03-03 23:30:46,059 plivo-outbound[4059]: ERROR: (1) raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') 2018-03-03 23:30:46,060 plivo-outbound[4059]: ERROR: (1) BlockingSwitchOutError: Impossible to call blocking function in the event loop callback 2018-03-03 23:30:46,060 plivo-outbound[4059]: DEBUG: (1) Releasing Connection ... 2018-03-03 23:30:46,061 plivo-outbound[4059]: DEBUG: (1) Releasing Connection Done

hitokiri82 commented 6 years ago

I dont know if you are still looking for a solution for this, but basically this code will only run with an old version of gevent. We are using https://github.com/gevent/gevent/archive/1.0a3.tar.gz but I've read in other comments that some people are using 1.1.0 Also, it breaks with python versions >= 2.7.8

mattwilliamson commented 3 years ago

PR https://github.com/plivo/plivoframework/issues/96 seems to fix it