unit test reports None type does not have __dict__ in Stack object

Bug #1432936 reported by Kanagaraj Manickam
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Low
Angus Salkeld

Bug Description

while unit testing, following exception is thrown

Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 862, in emit
Traceback (most recent call last):
  File "/opt/stack/heat/.tox/py27/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 457, in fire_timers
    timer()
  File "/opt/stack/heat/.tox/py27/local/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "/opt/stack/heat/.tox/py27/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 214, in main
    result = function(*args, **kwargs)
  File "heat/engine/service.py", line 109, in _start_with_trace
    return func(*args, **kwargs)
  File "heat/engine/service.py", line 643, in _stack_create
    stack.adopt()
  File "/opt/stack/heat/.tox/py27/local/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)
  File "heat/engine/stack.py", line 759, in adopt
    creator(timeout=self.timeout_secs())
  File "heat/engine/scheduler.py", line 178, in __call__
    self.run_to_completion(wait_time=wait_time)
  File "heat/engine/scheduler.py", line 236, in run_to_completion
    while not self.step():
  File "heat/engine/scheduler.py", line 222, in step
    next(self._runner)
  File "heat/engine/scheduler.py", line 323, in wrapper
    subtask = next(parent)
  File "heat/engine/stack.py", line 685, in stack_task
    self.state_set(action, stack_status, reason)
  File "/opt/stack/heat/.tox/py27/local/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)
  File "heat/engine/stack.py", line 582, in state_set
    'status_reason': reason})
  File "heat/objects/stack.py", line 142, in update_and_save
    self.refresh()
  File "heat/objects/stack.py", line 156, in refresh
    show_deleted=True,
  File "heat/objects/stack.py", line 69, in _from_db_object
    stack[field] = db_stack.__dict__.get(field)
AttributeError: 'NoneType' object has no attribute '__dict__'

Revision history for this message
Sergey Kraynev (skraynev) wrote :

How did you catch it? I run test locally against last master and can not get the same error.
Also I have not met such error in logs for gate jobs.

Revision history for this message
Kanagaraj Manickam (kanagaraj-manickam) wrote :

I have oberserved consistenly and unit test didn't consider it and was repoting as successful one.
i updated the code to master and tried, it doesnt occur. so i will invalidate this bug

Changed in heat:
status: New → Invalid
Revision history for this message
Angus Salkeld (asalkeld) wrote :

I am getting this now (very similar to the above report):

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 457, in fire_timers
    timer()
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py", line 214, in main
    result = function(*args, **kwargs)
  File "heat/engine/service.py", line 112, in _start_with_trace
    return func(*args, **kwargs)
  File "heat/engine/service.py", line 695, in _stack_create
    stack.create()
  File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)
  File "heat/engine/stack.py", line 765, in create
    creator(timeout=self.timeout_secs())
  File "heat/engine/scheduler.py", line 193, in __call__
    self.start(timeout=timeout)
  File "heat/engine/scheduler.py", line 219, in start
    self.step()
  File "heat/engine/scheduler.py", line 242, in step
    next(self._runner)
  File "heat/engine/scheduler.py", line 308, in wrapper
    subtask = next(parent)
  File "heat/engine/stack.py", line 804, in stack_task
    'Stack %s started' % action)
  File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)
  File "heat/engine/stack.py", line 721, in state_set
    'status_reason': reason})
  File "heat/objects/stack.py", line 159, in update_and_save
    self.refresh()
  File "heat/objects/stack.py", line 169, in refresh
    db_stack.refresh()
AttributeError: 'NoneType' object has no attribute 'refresh'

Changed in heat:
status: Invalid → Confirmed
importance: Undecided → Low
Angus Salkeld (asalkeld)
Changed in heat:
assignee: nobody → Angus Salkeld (asalkeld)
milestone: none → liberty-1
Changed in heat:
status: Confirmed → In Progress
Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-1 → 5.0.0
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.