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.

exceptions.AttributeError: '_SIGCHLDWaker' object has no attribute 'doWrite'

See original GitHub issue

Hello,

Thank your for your fantastic project. We are facing a really hard to solve bug while running scapy inside celery task. Sometimes we get this error:

Unhandled Error
Traceback (most recent call last):
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/twisted/python/log.py", line 101, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/twisted/python/log.py", line 84, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/home/wirebot/.virtualenvs/cayzn_tracking.scraping/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 602, in _doReadOrWrite
    why = selectable.doWrite()
exceptions.AttributeError: '_SIGCHLDWaker' object has no attribute 'doWrite'

I think it’s related to a threading problem (I am not sure twisted is very thread safe) but maybe you already have an explanation ? Anyway, it seems bloated to run scrapy inside celery tasks because we need to recreate the crawler for each task, do you have any good advice on how to built a system to distribute crawls ? We are open to use scrapinghub but we have some very specific pipelines & download middlewares which prevent us to do so 😦

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
chainstaircommented, May 4, 2020

I am still having issues at the moment. First I thought that it had to do with Python 3.8. I tried now with Python 3.7 and I still experience the same issues with Multiprocessing and ThreadPool.

Please get this fixed. 🙏

0reactions
thomaszdxsncommented, May 14, 2018

happen a similar problem with my project too. And I used the multiprocessing and apscheduler to manage various spiders.

I find a answer from stackoverflow, it say can replace reactor to asyncioreactor, and I heard reactor cannot restart in one process, maybe this is solution?

after do that, no more exception

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why I am Getting '_SIGCHLDWaker' object has no attribute ...
doWrite () exceptions.AttributeError: '_SIGCHLDWaker' object has no attribute 'doWrite'. I am using: celery==3.1.19 Django==1.9.4 Scrapy==1.3.0.
Read more >
[solved] Weird <type 'exceptions.AttributeError'> 'Row' object ...
Hi, just for other developers sake to save some time. I was getting this error: <type 'exceptions.AttributeError'> 'Row' object has no attribute 'id'....
Read more >
Python Twisted Scrapy Attributeerror - ADocLib
I can't see any class exceptions.RuntimeError: AttributeError: UnixWaker instance has no attribute 'doWrite' 'SIGCHLDWaker' object has no attribute ...
Read more >
AttributeError at / 'NoneType' object has no attribute 'strip', why ...
Coding example for the question AttributeError at / 'NoneType' object has no attribute 'strip', why and how? stuck here for a while-django.
Read more >
Exceptions and common tracebacks - Plone Documentation
AttributeError : 'module' object has no attribute 'HTTPSConnection'¶. Python has not been compiled with HTTPS support. Try installing your Python, for example, ...
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