openvstorage / framework-alba-plugin

The Framework ALBA plugin extends the OpenvStorage GUI with functionality to manage ASDs (Alternate Storage Daemon) and Seagate Kinetic drives.
Other
2 stars 3 forks source link

Remove node: local variable 'osd' referenced before assignment #183

Closed openvstorage-ci closed 8 years ago

openvstorage-ci commented 8 years ago

From @JeffreyDevloo on August 10, 2016 13:1

Problem description

Got 'local variable 'osd' referenced before assignment' when invoking ovs remove node.

Possible root of the problem

There weren't any ASDs claimed for the back-end. Perhaps there is no check on the existence of ASDs?

Possible solution

Add a check.

Temporary solution

None

Additional information

Happend on the remove hook: Stacktracing:

Demote complete

Removing node from model

\++\+ Running "remove" hooks \++\+

\++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\+

\++\+  An unexpected error occurred:                      \++\+

\++\+  local variable 'osd' referenced before assignment  \++\+

\++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\+

root@ovs-node1:~#

root@ovs-node1:~# less /var/log/ovs/lib.log

2016-08-10 11:41:25 83200 \+0200 - ovs-node1 - 3571/140406494132032 - lib/setup - 188 - INFO -

2016-08-10 11:41:25 83300 \+0200 - ovs-node1 - 3571/140406494132032 - lib/setup - 189 - ERROR - An unexpected error occurred:

Traceback (most recent call last):

File "ovs/lib/setup.py", line 703, in remove_nodes

SetupController._run_hooks('remove', storage_router.ip)

File "ovs/lib/setup.py", line 1653, in \_run_hooks

function(cluster_ip=cluster_ip, \**kwargs)

File "ovs/lib/helpers/..//albacontroller.py", line 713, in on_remove

AlbaNodeController.remove_disk(node_guid=osd.alba_disk.alba_node_guid, disk=osd.alba_disk.name)

UnboundLocalError: local variable 'osd' referenced before assignment

2016-08-10 11:41:25 83300 \+0200 - ovs-node1 - 3571/140406494132032 - lib/setup - 190 - ERROR - local variable 'osd' referenced before assignment

Traceback (most recent call last):

File "ovs/lib/setup.py", line 703, in remove_nodes

SetupController._run_hooks('remove', storage_router.ip)

File "ovs/lib/setup.py", line 1653, in \_run_hooks

function(cluster_ip=cluster_ip, \**kwargs)

File "ovs/lib/helpers/..//albacontroller.py", line 713, in on_remove

AlbaNodeController.remove_disk(node_guid=osd.alba_disk.alba_node_guid, disk=osd.alba_disk.name)

UnboundLocalError: local variable 'osd' referenced before assignment

Setup

Hyperconverged setup

Copied from original issue: openvstorage/framework#797

khenderick commented 8 years ago

Fixed by #184 in openvstorage-backend-1.7.2-rev.672.249a91a

JeffreyDevloo commented 8 years ago

Verified, could no longer reproduce the issue using the same setup.