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 6955193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:42:16+00:00 2026-05-27T14:42:16+00:00

I have two servers: one running a django app and one running both a

  • 0

I have two servers: one running a django app and one running both a rabbitmq queue and a celery worker. My tasks.py on the server running the queue/worker contains a task as follows:

@task(queue="reports")
def test_task():
    time.sleep(120)

My goal is to execute this task from a django view. Since the code for the task is on a different server than the django view I’d like to call the task, I’m trying to use the following code to send the task from django to the worker machine.

send_task("tasks.test_task", task_id=task_id, args=[], kwargs={}, publisher=publisher, queue=queue)

I found this method here, but so far testing it hasn’t worked.

I’m testing with tail -F on the celery worker logfile on the celery worker server, then navigating to the url of the view containing send_task in a browser. I’m looking for the task to show up as ‘received’ in the tail output, but it doesn’t.

The celery worker’s log level is DEBUG, the logfile shows that the task is registered with the proper name, and the django app’s settings.py contains the correct IP and credentials for the rabbitmq server. In trying different approaches, I’ve occasionally seen an error message in the celery logfile when I changed the string passed to send_task to something that wasn’t a valid task (ie send_task(‘asdf’)). This caused an UnregisteredError in the logfile. However, this only happens sometimes, and so far in testing different combinations of settings and calls, I haven’t found a way to reliably replicate the behavior.

Also, this is the relevant section of settings.py on the django project (with actual values removed):

CELERY_RESULT_BACKEND = 'amqp'
BROKER_HOST = 'the.correct.IP.address'
BROKER_USER = 'the_correct_user'
BROKER_PASSWORD = 'the_correct_pass'
BROKER_VHOST = 'the_correct_vhost'
BROKER_PORT = 5672

I’ve googled around and haven’t found much on send_task. Any ideas on what I might be doing wrong?

  • 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-05-27T14:42:17+00:00Added an answer on May 27, 2026 at 2:42 pm

    Resolved, turns out the publisher keyword arg i was passing to send_task was invalid and throwing an error. Didn’t see the error because I was AJAX-requesting the page rather than navigating to it directly. Everything else about this situation was correct. I also removed the unnecessary keyword args and args being passed to send_task.

    send_task("tasks.test_task", task_id=task_id, queue=queue)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two servers, both running CentOS 5.7 and cPanel-CURRENT. One is x86 and
On my Unix web server, I have two MySQL database servers running. One on
I have two servers - one Django, the other likely to be written in
if i have two IIS servers 5v on one network running winxp each hosting
I have two servers running git, one main instance with gitorious installed and another
We have two zope servers running our company's internal site. One is the live
I have one table spread across two servers running MySql 4. I need to
I have two servers, both running phpmyadmin, and I exported a mysql dump on
We have two servers in the same network. One of them is the server
I have a rails application running over Postgres. I have two servers: one for

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.