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

AttributeError: 'module' object has no attribute 'poll' #611

Closed
nuklea opened this issue Sep 12, 2013 · 10 comments
Closed

AttributeError: 'module' object has no attribute 'poll' #611

nuklea opened this issue Sep 12, 2013 · 10 comments
Milestone

Comments

@nuklea
Copy link

nuklea commented Sep 12, 2013

After upgrade to 18.0 I've get this error every request. I use gevent-worker and preload_app.

ERROR Error handling request
Traceback (most recent call last):
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/gunicorn/workers/async.py", line 45, in handle
    self.handle_request(listener, req, client, addr)
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 151, in handle_request
    super(GeventWorker, self).handle_request(*args)
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/gunicorn/workers/async.py", line 93, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 236, in __call__
    self.load_middleware()
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/django/core/handlers/base.py", line 59, in load_middleware
    mw_instance = mw_class()
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/django_hosts/middleware.py", line 17, in __init__
    self.host_patterns = get_host_patterns()
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/django/utils/functional.py", line 31, in wrapper
    result = func(*args)
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/django_hosts/reverse.py", line 45, in get_host_patterns
    module = get_hostconf_module(hostconf)
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/django/utils/functional.py", line 31, in wrapper
    result = func(*args)
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/django_hosts/reverse.py", line 31, in get_hostconf_module
    return import_module(hostconf)
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/nuklea/workspace/project/project/hosts.py", line 25, in <module>
    ip_domains = get_servers()
  File "/home/nuklea/workspace/project/project/utils/hosts.py", line 16, in get_servers
    fab_module = load_source('fab_module', join(settings.PROJECT_ROOT + '/fabfile.py'))
  File "/home/nuklea/workspace/project/fabfile.py", line 34, in <module>
    from fabric.api import *
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/fabric/api.py", line 9, in <module>
    from fabric.context_managers import (cd, hide, settings, show, path, prefix,
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/fabric/context_managers.py", line 42, in <module>
    from fabric.state import output, win32, connections, env
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/fabric/state.py", line 10, in <module>
    from fabric.version import get_version
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/fabric/version.py", line 105, in <module>
    __version__ = get_version('short')
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/fabric/version.py", line 56, in get_version
    sha = git_sha()
  File "/home/nuklea/.virtualenvs/project/lib/python2.7/site-packages/fabric/version.py", line 24, in git_sha
    return p.communicate()[0]
  File "/usr/lib64/python2.7/subprocess.py", line 806, in communicate
    return self._communicate(input)
  File "/usr/lib64/python2.7/subprocess.py", line 1382, in _communicate
    stdout, stderr = self._communicate_with_poll(input)
  File "/usr/lib64/python2.7/subprocess.py", line 1412, in _communicate_with_poll
    poller = select.poll()
AttributeError: 'module' object has no attribute 'poll'
@nuklea nuklea closed this as completed Sep 12, 2013
@nuklea
Copy link
Author

nuklea commented Sep 12, 2013

Please, delete this issue.

@jjsoa1
Copy link

jjsoa1 commented Oct 3, 2013

I've come across a similar issue. How was this resolved?

@ibeex
Copy link

ibeex commented Oct 10, 2013

Same issue here. How was this resolved?

@nuklea nuklea reopened this Oct 10, 2013
@jbranc
Copy link

jbranc commented Oct 28, 2013

same here...
update:
fwiw, this is most likely indicitive of a circular import somewhere in the code. in my case, Haystack was causing it. This most likely has nothing to do with gunicorn.

@benoitc
Copy link
Owner

benoitc commented Nov 19, 2013

not related to gunicorn

@benoitc benoitc closed this as completed Nov 19, 2013
@adamhaney
Copy link

@jbranc how did you track down the source of the circular import? I'm using gunicorn and I get this error in django template rendering as a part of django-pipeline, no stack trace just poof poll is gone.

@t-io
Copy link

t-io commented Nov 12, 2014

@adamhaney same here. Was you able to resolve this?

@tilgovi
Copy link
Collaborator

tilgovi commented Nov 13, 2014

@adamhaney @t-io you can try importing your application outside of gunicorn or running it with another server and see if you have any issues.

@benoitc
Copy link
Owner

benoitc commented Nov 13, 2014

using check-config may also return the error.

@xiaolin
Copy link

xiaolin commented Jan 4, 2015

Seems to be a very specific issue with worker_class = 'gevent' and django pipeline package. My fix was to comment out worker_class = 'gevent' in /etc/gunicorn.d/gunicorn.py.

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

No branches or pull requests

9 participants