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.

Admin integration is broken when using ORM as a broker with a different database

See original GitHub issue

Hello,

I’m using ORM as a broker and I have exactly followed the same steps mentioned at the docs regarding using a separate DB for django_q and applying migrations.

However, when browsing admin dashboard I always get relation "django_q_schedule" does not exist when trying to open anything under DJANGO_Q section except for Queued tasks, this was clearly about that it doesn’t use the correct DB, so I looked at admin.py and my guess was right, using() connection is only respected with QueueAdmin and others are not at all, I have even tried to add using() for TaskAdmin and it worked as expected, so it is all about that.

I’m using Django 2.2.16 and PostgreSQL 12.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pfgotingcommented, Jul 29, 2022

Hello! Sorry for resurrecting this old thread since I just encountered the same issue as the original poster. So if my understanding is correct, when using another database as a broker, all task-related data except Queued tasks are still saved on the default database. Therefore, 2 migrations need to be run. The first migration is to have django_q_schedule and django_q_task on your default DB, while the second would be for django_q_ormq on your broker database.

I think this was designed such that even when changing brokers, the task data would remain intact on only one database. Think of a scenario wherein you started using another DB as a broker but then switched to Redis. This would result in you still keeping the separate broker database even though it outlived its main purpose already.

1reaction
Koed00commented, Sep 12, 2020

Good spot. Seems like an easy enough fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django Q Documentation
Failure and success database or cache. • Result hooks, groups and chains. • Django Admin integration. • PaaS compatible with multiple ...
Read more >
Troubleshoot SQL Server Service Broker issues - Operations ...
In SQL Server Management Studio, go to Databases > OperationsManager > Service Broker. Expand Queues and Services. Verify that there's a queue ...
Read more >
Who's Really Doing Continuous Integration of SQL Server ...
What benefits have you achieved by using CI? (New) Is the application deployed in only one database, or across many nearly-identical copies of ......
Read more >
Queues against Tables in messaging systems - Stack Overflow
Similarly - you'd never use a database to do load balancing of HTTP ... Tables are accessed through this peculiar "other language" (SQL), ......
Read more >
Developers and Identity Services - Oracle
manageable for enterprise users from IT administrators to business users. ... from other role provider can also be leveraged through integration.
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