Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8083237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:23:52+00:00 2026-06-05T17:23:52+00:00

I have Django set up under Windows (Win2008 Server R2, IIS 7.5, MS SQL).

  • 0

I have Django set up under Windows (Win2008 Server R2, IIS 7.5, MS SQL). I’m trying to implement celery 2.4.1 (with RabbitMQ) for task processing and running into a very frustrating problem.

I start celeryd with the recommended:

manage.py celeryd --settings=settings

and it runs OK. Then in my django project, I trigger a task to start (for testing I’m just using the simple “add” example:

@task
def add(x, y):
    return x + y

and that’s called in my views.py as:

tasks.add.delay(1,2)

When celeryd picks this up, a couple of things happen, sometimes:
1) I get a Windows dialog, “python.exe has stopped working”, and an option to close it.
2) After closing that, in the cmd where celeryd is running, I get:

[date-time: ERROR/MainProcess] Task [taskUUID] raised exception: WorkerLostError('Worker exited prematurely.',)
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\celery\concurrency\processes\pool.py", line 610, in _join_exited_workers
    raise WorkerLostError("Worker exited prematurely.")
WorkerLostError: Worker exited prematurely.

I’ve tried very tediously tinkering with just about every celery setting, one at a time, that could possibly affect workers (CELERYD_CONCURRENCY, CELERYD_PREFETCH_MULTIPLIER, CELERYD_MAX_TASKS_PER_CHILD, etc.) with no effect whatsoever on this.

What’s really strange is that sometimes, after that has happened (and I just leave celeryd running…it doesn’t kill that process…?), I can trigger the task again, with no python.exe crash, and the task will complete successfully.

My celery-relevant settings from settings.py:

BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_VHOST = "/"

CELERY_IMPORTS = ("myproject.tasks",)
CELERY_RESULT_BACKEND = "database"

CELERY_SEND_EVENTS=True #same as '-E' option from cmd

I strongly suspect a celery bug (possibly specific to Windows implementation?) but I don’t quite have the chops yet to identify it or propose a fix.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:23:53+00:00Added an answer on June 5, 2026 at 5:23 pm

    Finally, after many months of tinkering on and off with this, I believe I have figured it out.

    The problem appears to be coming from the use of django-mssql as the Django database engine. django-mssql relies on pywin32, and one of the calls there uses ole32.dll and causes a crash there, which consequently brings down Python, hence the WorkerLostError.

    I’ve switched to django-pyodbc which does not use the problematic pywin32/ole32.dll call, and have not experienced an unexplained WorkerLostError such as these since switching.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Django set up on my server at http://stevencampbell.org/ I want to be
I have set up Django on Windows 7 on Apache/mod_wsgi. I need to stop,
I have a Django site and I am trying to set a cookie in
I've set up django with haystack but im having a few problems. I have
I have set up a few models in a simple django project. When I
I have an odd problem with Django. I have a set of objects that
I was trying to setup django . I do have Django-1.1-alpha-1. I was trying
I'm using django-piston for my REST json api, and I have it all set
I'm new to Django and trying to set up a Facebook connected site. There
Have a Django / MySQL set up. There's a model, Survey, which currently looks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.