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

gevent 1.0rc2 breaks plivo #96

Open
trane opened this issue Jan 25, 2013 · 13 comments · May be fixed by #132
Open

gevent 1.0rc2 breaks plivo #96

trane opened this issue Jan 25, 2013 · 13 comments · May be fixed by #132

Comments

@trane
Copy link

trane commented Jan 25, 2013

Testing an inbound call, with TRACE enabled succeeds with the gevent installed through pip.

However, it fails when using the newest gevent based off of libev.

This is using the newest code from the master branch of plivoframework.

2013-01-25 12:13:12,516 plivo-outbound[1866]: INFO: OutboundServer started at '127.0.0.1:8084'
2013-01-25 12:13:37,485 plivo-outbound[1866]: INFO: (1) New request from ('127.0.0.1', 52571)
2013-01-25 12:13:37,486 plivo-outbound[1866]: DEBUG: (1) [TRACE] run now
2013-01-25 12:13:37,486 plivo-outbound[1866]: DEBUG: (1) Execute: connect args=''
2013-01-25 12:13:37,486 plivo-outbound[1866]: DEBUG: (1) [TRACE] _protocol_send connect 
2013-01-25 12:13:37,490 plivo-outbound[1866]: DEBUG: (1) [TRACE] _protocol_send connect wait ...
2013-01-25 12:13:37,491 plivo-outbound[1866]: ERROR: (1) Traceback (most recent call last):
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)   File "/usr/local/lib/python2.7/dist-packages/plivo/rest/freeswitch/outboundsocket.py", line 308, in run
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)     self._run()
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)   File "/usr/local/lib/python2.7/dist-packages/plivo/rest/freeswitch/outboundsocket.py", line 318, in _run
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)     self.connect()
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)   File "/usr/local/lib/python2.7/dist-packages/plivo/core/freeswitch/outboundsocket.py", line 54, in connect
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)     connect_response = self._protocol_send("connect")
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)   File "/usr/local/lib/python2.7/dist-packages/plivo/rest/freeswitch/outboundsocket.py", line 140, in _protocol_send
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)     command, args)
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)   File "/usr/local/lib/python2.7/dist-packages/plivo/core/freeswitch/eventsocket.py", line 376, in _protocol_send
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)     _uuid, event = _async_res.get()
2013-01-25 12:13:37,492 plivo-outbound[1866]: ERROR: (1)   File "/usr/local/lib/python2.7/dist-packages/gevent/event.py", line 226, in get
2013-01-25 12:13:37,493 plivo-outbound[1866]: ERROR: (1)     result = self.hub.switch()
2013-01-25 12:13:37,493 plivo-outbound[1866]: ERROR: (1)   File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 330, in switch
2013-01-25 12:13:37,493 plivo-outbound[1866]: ERROR: (1)     switch_out()
2013-01-25 12:13:37,493 plivo-outbound[1866]: ERROR: (1)   File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 334, in switch_out
2013-01-25 12:13:37,493 plivo-outbound[1866]: ERROR: (1)     raise AssertionError('Impossible to call blocking function in the event loop callback')
2013-01-25 12:13:37,493 plivo-outbound[1866]: ERROR: (1) AssertionError: Impossible to call blocking function in the event loop callback
2013-01-25 12:13:37,493 plivo-outbound[1866]: DEBUG: (1) [TRACE] disconnect now
2013-01-25 12:13:37,493 plivo-outbound[1866]: DEBUG: (1) Releasing Connection ...
2013-01-25 12:13:37,493 plivo-outbound[1866]: DEBUG: (1) [TRACE] releasing ...
2013-01-25 12:13:37,493 plivo-outbound[1866]: DEBUG: (1) [TRACE] releasing forced


@mike-plivo
Copy link
Member

ok do you have an idea when gevent (version/commit) added this assertion check ?

@whitebook
Copy link

@xmglin
Copy link

xmglin commented Sep 13, 2013

Will plivoframework team plan to support gevent-1.0rc2?
Is there any schedule?

@BrightLedSigns
Copy link

Any chance you could make a note about this issue on this page http://docs.plivo.org/get-started/ ?

I'm new to Plivo, and it took me a while to find this issue and figure out I wasn't doing anything wrong...

@BrightLedSigns
Copy link

I should have been more specific...

In it's current state, you can't install the plivo framework.

Within plivo_install.sh, there's these two lines:

pip install --upgrade -f http://gevent.googlecode.com/files/gevent-1.0a3.tar.gz gevent
pip install -e git+${PLIVO_GIT_REPO}@${BRANCH}#egg=plivo

The first does install the older version of gevent, but the second triggers some dependency that installs the latest gevent due to some dependency...which renders the install broken due to this issue.

I tried working around it by doing a pip install of the older version, but that triggers a different gevent bug where it requires cython to do the build. That, in turns, fails because cython complains about "default encoding required for conversion" on one of the core files in plivo.

In short, again, at least on a debian box, you can't get a working install of plivo by running the simple "get started" install.

@mike-plivo
Copy link
Member

Is it still the same error : "AssertionError: Impossible to call blocking function in the event loop callback"

you see when using last gevent version ?

@BrightLedSigns
Copy link

Yes, the same error. I tried it a few more times, and wrote up something with more detail on the Plivo-User's group, here;

https://groups.google.com/forum/#!topic/plivo-users/q3gdHEcDXsU

I was wrong in my assumption that the newer version of gevent was overwriting the older version. It's more straightforward than that. This line:

pip install --upgrade -f http://gevent.googlecode.com/files/gevent-1.0a3.tar.gz gevent

Does not install gevent-1.0a3.tar.gz...it grabs the lastest version of gevent. Must be something about how pip works internally?

@astravoice
Copy link

Yes.

On 12/9/13 2:11 PM, Michael Ricordeau wrote:

Is it still the same error : "AssertionError: Impossible to call
blocking function in the event loop callback"

you see when using last gevent version ?


Reply to this email directly or view it on GitHub
#96 (comment).

@BrightLedSigns
Copy link

I finally hit on something that worked. I replaced this line in plivo_install.sh

pip install --upgrade -f http://gevent.googlecode.com/files/gevent-1.0a3.tar.gz gevent

With this:

pip uninstall gevent
pip install -Iv http://gevent.googlecode.com/files/gevent-1.0a3.tar.gz

FYI, that -Iv switch above is a capital letter i, not a lowercase l. The font here on github isn't great for telling the difference.... I and l look the same.

And re-ran the installer. It does prompt me for confirmation during the install, but everything is working now, no "AssertionError: Impossible to call blocking function in the event loop callback" problems with inbound calls.

@pubyun
Copy link
Contributor

pubyun commented Dec 10, 2013

please refer to second commit of
#108

@emamirazavi
Copy link
Contributor

I've downloaded last version of plivo source with cloning of git in plivo_install.sh
I have problem that i think belongs to this issue. Any solution:
2014-01-21 17:00:00,821 plivo-outbound[3251]: INFO: (1) New request from ('127.0.0.1', 59134)
2014-01-21 17:00:00,823 plivo-outbound[3251]: DEBUG: (1) Execute: connect args=''
2014-01-21 17:00:00,827 plivo-outbound[3251]: ERROR: (1) Traceback (most recent call last):
2014-01-21 17:00:00,827 plivo-outbound[3251]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/rest/freeswitch/outboundsocket.py", line 319, in run
2014-01-21 17:00:00,827 plivo-outbound[3251]: ERROR: (1) self._run()
2014-01-21 17:00:00,827 plivo-outbound[3251]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/rest/freeswitch/outboundsocket.py", line 329, in _run
2014-01-21 17:00:00,828 plivo-outbound[3251]: ERROR: (1) self.connect()
2014-01-21 17:00:00,828 plivo-outbound[3251]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/core/freeswitch/outboundsocket.py", line 54, in connect
2014-01-21 17:00:00,828 plivo-outbound[3251]: ERROR: (1) connect_response = self._protocol_send("connect")
2014-01-21 17:00:00,828 plivo-outbound[3251]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/rest/freeswitch/outboundsocket.py", line 140, in _protocol_send
2014-01-21 17:00:00,828 plivo-outbound[3251]: ERROR: (1) command, args)
2014-01-21 17:00:00,829 plivo-outbound[3251]: ERROR: (1) File "/usr/local/plivo/src/plivo/src/plivo/core/freeswitch/eventsocket.py", line 375, in _protocol_send
2014-01-21 17:00:00,829 plivo-outbound[3251]: ERROR: (1) _uuid, event = _async_res.get()
2014-01-21 17:00:00,829 plivo-outbound[3251]: ERROR: (1) File "/usr/local/plivo/lib/python2.6/site-packages/gevent/event.py", line 226, in get
2014-01-21 17:00:00,829 plivo-outbound[3251]: ERROR: (1) result = self.hub.switch()
2014-01-21 17:00:00,830 plivo-outbound[3251]: ERROR: (1) File "/usr/local/plivo/lib/python2.6/site-packages/gevent/hub.py", line 330, in switch
2014-01-21 17:00:00,830 plivo-outbound[3251]: ERROR: (1) switch_out()
2014-01-21 17:00:00,830 plivo-outbound[3251]: ERROR: (1) File "/usr/local/plivo/lib/python2.6/site-packages/gevent/hub.py", line 334, in switch_out
2014-01-21 17:00:00,830 plivo-outbound[3251]: ERROR: (1) raise AssertionError('Impossible to call blocking function in the event loop callback')
2014-01-21 17:00:00,830 plivo-outbound[3251]: ERROR: (1) AssertionError: Impossible to call blocking function in the event loop callback
2014-01-21 17:00:00,831 plivo-outbound[3251]: DEBUG: (1) Releasing Connection ...

@csik
Copy link

csik commented Aug 12, 2014

Just to confirm that BrightLedSigns' fix worked for me; I didn't have to rerun install.sh, just restarted the plivo processes.

@AndreiPashkin
Copy link

Fixed it in #132

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

Successfully merging a pull request may close this issue.

10 participants