Skip to content

fix: add logger_task to CELERY_IMPORTS so process_logs is registered in worker#8929

Open
vdaluz wants to merge 1 commit intomakeplane:previewfrom
vdaluz:fix/logger-task-celery-imports
Open

fix: add logger_task to CELERY_IMPORTS so process_logs is registered in worker#8929
vdaluz wants to merge 1 commit intomakeplane:previewfrom
vdaluz:fix/logger-task-celery-imports

Conversation

@vdaluz
Copy link
Copy Markdown

@vdaluz vdaluz commented Apr 24, 2026

Fixes #8928

What

Adds plane.bgtasks.logger_task to CELERY_IMPORTS in plane/settings/common.py.

Why

logger_task.py was introduced in #8245 with a @shared_task decorator, but was never added to CELERY_IMPORTS. The Celery worker only imports modules listed there, so process_logs is never registered. Every API request queues this task (via APITokenLogMiddleware) and the worker discards it with:

KeyError: 'plane.bgtasks.logger_task.process_logs'

This silently breaks API activity logging and floods worker logs with errors.

Change

 CELERY_IMPORTS = (
     ...
     # issue version tasks
     "plane.bgtasks.issue_version_sync",
     "plane.bgtasks.issue_description_version_sync",
+    # API activity logging
+    "plane.bgtasks.logger_task",
 )

One line added. No other changes.

Summary by CodeRabbit

  • Chores
    • Registered a new background task module with the task scheduler to enable logging functionality in background operations.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 24, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 30790e65-afce-4628-a96b-e1ab7d4c9b4c

📥 Commits

Reviewing files that changed from the base of the PR and between 03a2be8 and 98a1c45.

📒 Files selected for processing (1)
  • apps/api/plane/settings/common.py

📝 Walkthrough

Walkthrough

A single configuration entry "plane.bgtasks.logger_task" is added to the CELERY_IMPORTS tuple in the settings file, enabling the Celery worker to load and register the logger task module that was previously unregistered.

Changes

Cohort / File(s) Summary
Celery Configuration
apps/api/plane/settings/common.py
Added "plane.bgtasks.logger_task" to CELERY_IMPORTS tuple to ensure the logger task module is loaded by Celery worker at startup.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A task that wandered, lost in the dark,
Now finds its way with this tiny spark!
One little string, so small yet grand,
Brings logger tasks back to the promised land. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding logger_task to CELERY_IMPORTS to fix task registration in the worker.
Description check ✅ Passed The description covers What, Why, and Change sections with clear context, but lacks formal section structure and testing information from the template.
Linked Issues check ✅ Passed The PR directly addresses issue #8928 by adding the missing logger_task module to CELERY_IMPORTS, which resolves the root cause of unregistered task errors.
Out of Scope Changes check ✅ Passed The changes are limited to a single line addition in CELERY_IMPORTS, directly addressing the issue requirements with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Successfully merging this pull request may close these issues.

[Bug] logger_task not registered in Celery worker — process_logs tasks silently dropped

2 participants