Cron-trigger failed with ApplicationContextNotFoundException

Bug #1473980 reported by Guy Paz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Rinat Sabitov
Liberty
Fix Released
Medium
Rinat Sabitov

Bug Description

A cron-trigger failed to run with the following exception.
I tried few different workflow and getting the same results.

2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task [-] Error during MistralPeriodicTasks.process_cron_triggers_v2
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task Traceback (most recent call last):
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task File "/usr/local/lib/python2.7/dist-packages/oslo_service/periodic_task.py", line 218, in run_periodic_tasks
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task task(self, context)
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task File "/opt/stack/mistral/mistral/services/periodic.py", line 49, in process_cron_triggers_v2
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task **t.workflow_params
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task File "/opt/stack/mistral/mistral/engine/rpc.py", line 225, in decorator
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task return method(*args, **kwargs)
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task File "/opt/stack/mistral/mistral/engine/rpc.py", line 258, in start_workflow
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task auth_ctx.ctx(),
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task File "/opt/stack/mistral/mistral/context.py", line 90, in ctx
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task raise exc.ApplicationContextNotFoundException()
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task ApplicationContextNotFoundException: Application context not found
2015-07-13 12:32:59.717 25060 ERROR oslo_service.periodic_task

I m running on the latest devstack (master) and been tested on two setups.
Using this simple workflow:

---
version: '2.0'

local_workflow1:
  type: direct

  tasks:
    task1:
      action: std.noop

Create a cron-trigger with this command (run every minute):
mistral cron-trigger-create -f value --pattern "*/1 * * * *" cron_test local_workflow1

Guy Paz (guy-paz)
description: updated
Revision history for this message
Rinat Sabitov (histrio) wrote :

With any workflow cron trigger fails with same error. It seems that mistral can't find greenlets locals for its local_id (mistal/utils/__init__.py:43)
As I understand, locals populate only in _wrapper function (mistal/context.py:101) which call only inside spawn function. But this method not used at all.

P.S.
Why mistal should raise exception if current context is empty/not found?

Revision history for this message
Rinat Sabitov (histrio) wrote :

Update: It seems to that get_indent for eventlet returns different id in one thread.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

Fix proposed to branch: master
Review: https://review.openstack.org/202129

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/202129
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=0a8fd07a0ed02403f926dfc630eb3a458aa3d933
Submitter: Jenkins
Branch: master

commit 0a8fd07a0ed02403f926dfc630eb3a458aa3d933
Author: Rinat Sabitov <email address hidden>
Date: Wed Jul 15 17:08:46 2015 +0300

    Fixed lack of context for triggers

    If set auth_enable to false in Mistral config keystone would not be used. So
    triggers would not get a trust_id. Without this id context is not assigned.

    Change-Id: I6d7d99da08cd78c1db83afff6fb79d37816f99ff
    Closes-Bug: #1473980

Changed in mistral:
status: In Progress → Fix Committed
Changed in mistral:
milestone: 1.0.0 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.