{"record":{"id":"7faf00de193f804a","repo":"python-telegram-bot/python-telegram-bot","slug":"ignoring-conversation-timeout-because-the-applic-7faf00","errorCode":null,"errorMessage":"Ignoring `conversation_timeout` because the Applications JobQueue is not running.","messagePattern":"Ignoring `conversation_timeout` because the Applications JobQueue is not running\\.","errorType":"console","errorClass":"Warning","httpStatus":null,"severity":"warning","filePath":"src/telegram/ext/_handlers/conversationhandler.py","lineNumber":863,"sourceCode":"                new_state = application.create_task(\n                    coroutine=handler.handle_update(\n                        update, application, handler_check_result, context\n                    ),\n                    update=update,\n                    name=f\"ConversationHandler:{update.update_id}:handle_update:non_blocking_cb\",\n                )\n        except ApplicationHandlerStop as exception:\n            new_state = exception.state\n            raise_dp_handler_stop = True\n        async with self._timeout_jobs_lock:\n            if self.conversation_timeout:\n                if application.job_queue is None:\n                    warn(\n                        \"Ignoring `conversation_timeout` because the Application has no JobQueue.\",\n                        stacklevel=1,\n                    )\n                elif not application.job_queue.scheduler.running:\n                    warn(\n                        \"Ignoring `conversation_timeout` because the Applications JobQueue is \"\n                        \"not running.\",\n                        stacklevel=1,\n                    )\n                elif isinstance(new_state, asyncio.Task):\n                    # Add the new timeout job\n                    # checking if the new state is self.END is done in _schedule_job\n                    application.create_task(\n                        self._schedule_job_delayed(\n                            new_state, application, update, context, conversation_key\n                        ),\n                        update=update,\n                        name=f\"ConversationHandler:{update.update_id}:handle_update:timeout_job\",\n                    )\n                else:\n                    self._schedule_job(new_state, application, update, context, conversation_key)\n\n        if isinstance(self.map_to_parent, dict) and new_state in self.map_to_parent:","sourceCodeStart":845,"sourceCodeEnd":881,"githubUrl":"https://github.com/python-telegram-bot/python-telegram-bot/blob/d3b69d2e9fb7af6c796f84516cfda751752c7cb7/src/telegram/ext/_handlers/conversationhandler.py#L845-L881","documentation":"This warning is emitted by ConversationHandler when a `conversation_timeout` is configured but the Application's JobQueue scheduler is not running, so no timeout job can be scheduled. The timeout feature relies on JobQueue to fire the TIMEOUT state after inactivity. Without a running scheduler the timeout is silently ignored and conversations never time out.","triggerScenarios":"Building an Application with `ConversationHandler(conversation_timeout=...)` while either (a) no JobQueue is installed (application.job_queue is None — the adjacent branch warns about that), or (b) a JobQueue exists but its APScheduler `scheduler.running` is False, e.g. the application was not started via `application.run_polling()`/`run_webhook()`, or a custom JobQueue was set with `Application.builder().job_queue(custom)` and never started, or `application.initialize()` was called without `start()`.","commonSituations":"Running the bot manually with initialize/start of only the updater (skipping application.start()), testing with pytest and ApplicationBuilder without a running job queue, installing `python-telegram-bot[job-queue]` missing so job_queue is None (nearby warning), or providing a custom JobQueue whose scheduler isn't started in async/PTB v20+ migrations.","solutions":["Ensure the bot is run via application.run_polling() or application.run_webhook() so the JobQueue scheduler is started","If managing the lifecycle manually, call await application.start() (which starts the JobQueue) before updates are processed","If using a custom JobQueue, start its scheduler before the application handles updates, e.g. await application.job_queue.scheduler.start()","Install the optional extra pip install 'python-telegram-bot[job-queue]' if job_queue is None (the sibling warning)"],"exampleFix":"# before\napp = Application.builder().token(TOKEN).build()\n# manually: scheduler never started\nawait app.initialize()\nawait app.updater.start_polling()\n\n# after\napp = Application.builder().token(TOKEN).build()\nawait app.initialize()\nawait app.start()          # starts the JobQueue scheduler\nawait app.updater.start_polling()","handlingStrategy":"validation","validationCode":"def job_queue_ready(application) -> bool:\n    jq = application.job_queue\n    return jq is not None and jq.scheduler.running\n\n# before handling updates:\nif conv_timeout_used and not job_queue_ready(app):\n    logging.warning(\"conversation_timeout will be ignored: start the application first\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always start apps via run_polling()/run_webhook() so the JobQueue scheduler starts with it","In tests, use ApplicationBuilder().job_queue(None) builds or start the scheduler before asserting timeout behavior","Install the job-queue extra if you use conversation_timeout or JobQueue features"],"tags":["telegram","conversation-timeout","job-queue","scheduler","python-telegram-bot"],"backgroundTag":"scheduler-not-running","analyzedSha":"d3b69d2e9fb7af6c796f84516cfda751752c7cb7","analyzedAt":"2026-08-28T16:18:54.805Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}