cancel
Showing results for 
Search instead for 
Did you mean: 

ezspantree crashes when I run it

ezspantree crashes when I run it

James_A
Valued Contributor
I'm finally setting up my first EXOS switch, and while I think I have configured it with a single STP domain in MSTP with all VLANs and ports in it, I decided to enable ezspantree.py to be sure. However, when I run it, I get the following crash:
* jblockx.143 # run script ezspantree.py start
Spanning Tree Easy Setup
- Configures spanning tree s0 mode to MSTP/CIST
- Scans all VLANs
if a VLAN is not connected to spanning tree, it is added to s0
if a VLAN is already connected to spanning tree s0, it is updated
VLANs connected to spanning tree(s) other than s0 are not affected
- Starts a VLAN monitoring process for any new VLANS
newly created VLANS are automatically added to spanning tree s0

Do you wish to proceed? [y/N] y
Traceback (most recent call last):
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 896, in
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 289, in __call__
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 405, in start_ezspantree
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 454, in start_process
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 412, in is_mstp_configured
TypeError: 'NoneType' object is not iterable

I tried to look at the source but it's some sort of binary.

Also is there a good way to test that STP is working? I tried plugging a cable into two ports on the same VLAN, but couldn't work out if it did anything.
7 REPLIES 7

Hmm, I ran it again with -d and this time it worked. But then on another already-configured switch it failed in a different spot, then I ran it again and it worked:
fblockx.104 # run script ezspantree.py -d start
DEBUG:MainThread:ezspantree:start_ezspantree.392:: Called
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show one epm.epmpcb name=ezspantree
DEBUG:MainThread:ezspantree:is_process_running.576:: Process is not running
Spanning Tree Easy Setup
- Configures spanning tree s0 mode to MSTP/CIST
- Scans all VLANs
if a VLAN is not connected to spanning tree, it is added to s0
if a VLAN is already connected to spanning tree s0, it is updated
VLANs connected to spanning tree(s) other than s0 are not affected
- Starts a VLAN monitoring process for any new VLANS
newly created VLANS are automatically added to spanning tree s0

Do you wish to proceed? [y/N] y
DEBUG:MainThread:ezspantree:start_process.448:: Called
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show one stp.stp_domain stpd_name=s0
STP s0 is already configured for MSTP
Enabling STP s0
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show one epm.epmpcb name=ezspantree
DEBUG:MainThread:ezspantree:is_process_running.576:: Process is not running
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=create process ezspantree python-module ezspantree start on-demand -- -d
ezspantree started
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=start process ezspantree
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=delete process ezspantree
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=create process ezspantree python-module ezspantree start auto -- -d
DEBUG:MainThread:ezspantree:add_vlans_to_stp_at_startup.501:: Called
Scanning all VLANs
VLANs not connected to STP will be automatically added to s0

DEBUG:MainThread:ezspantree:build_vlan_stp_db.206:: Called
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show next stp.stp_domain_enable stpd_name=None
DEBUG:MainThread:ezspantree:json_clicmd.199:: JSON format error
Traceback (most recent call last):
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 896, in
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 289, in __call__
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 406, in start_ezspantree
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 510, in add_vlans_to_stp_at_startup
File "/exos/tools/lib/python2.7/site-packages/./ezspantree.py", line 217, in build_vlan_stp_db
TypeError: 'NoneType' object is not iterable
fblockx.105 # run script ezspantree.py -d start
DEBUG:MainThread:ezspantree:start_ezspantree.392:: Called
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show one epm.epmpcb name=ezspantree
DEBUG:MainThread:ezspantree:is_process_running.573:: Process is running
ezspantree is already running
Do you wish to restart the MSTP/CIST configuration? [y/N] y
Spanning Tree Easy Setup
- Configures spanning tree s0 mode to MSTP/CIST
- Scans all VLANs
if a VLAN is not connected to spanning tree, it is added to s0
if a VLAN is already connected to spanning tree s0, it is updated
VLANs connected to spanning tree(s) other than s0 are not affected
- Starts a VLAN monitoring process for any new VLANS
newly created VLANS are automatically added to spanning tree s0

Do you wish to proceed? [y/N] y
DEBUG:MainThread:ezspantree:start_process.448:: Called
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show one stp.stp_domain stpd_name=s0
STP s0 is already configured for MSTP
Enabling STP s0
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show one epm.epmpcb name=ezspantree
DEBUG:MainThread:ezspantree:is_process_running.573:: Process is running
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=restart process ezspantree
ezspantree restarted
DEBUG:MainThread:ezspantree:add_vlans_to_stp_at_startup.501:: Called
Scanning all VLANs
VLANs not connected to STP will be automatically added to s0

DEBUG:MainThread:ezspantree:build_vlan_stp_db.206:: Called
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show next stp.stp_domain_enable stpd_name=None
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show next stp.stp_vlan_stats stpd_name=s0 search_dir=1 vlan_name=None
.DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show next stp.stp_vlan_stats stpd_name=s0 search_dir=2 vlan_name=None
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show next stp.stp_vlan_stats stpd_name=s0 search_dir=3 vlan_name=None
.DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show next stp.stp_vlan_stats stpd_name=s0 search_dir=1 vlan_name=None
.DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show next stp.stp_vlan_stats stpd_name=s0 search_dir=2 vlan_name=None
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show next stp.stp_vlan_stats stpd_name=s0 search_dir=3 vlan_name=None
.DEBUG:MainThread:ezspantree:build_vlan_stp_db.235:: {u'iPad': u's0', u'Guest': u's0', u'Default': u's0', u'VOIP_Phones': u's0', u'Student_laptops': u's0', u'Wireless': u's0', u'AV': u's0', u'Boarders': u's0', u'Staff': u's0'}
DEBUG:MainThread:ezspantree:build_vlan_db.580:: Called
DEBUG:MainThread:ezspantree:json_clicmd.190:: debug cfgmgr show next vlan.vlanMap vlanList=None
DEBUG:MainThread:ezspantree:build_vlan_db.590:: [u'Default', u'Student_laptops', u'Boarders', u'Guest', u'Staff', u'AV', u'iPad', u'Wireless', u'VOIP_Phones']
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=config stpd s0 add vlan Default ports all
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0 auto-bind vlan Default
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=config stpd s0 add vlan Student_laptops ports all
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0 auto-bind vlan Student_laptops
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=config stpd s0 add vlan Boarders ports all
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0 auto-bind vlan Boarders
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=config stpd s0 add vlan Guest ports all
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0 auto-bind vlan Guest
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=config stpd s0 add vlan Staff ports all
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0 auto-bind vlan Staff
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=config stpd s0 add vlan AV ports all
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0 auto-bind vlan AV
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=config stpd s0 add vlan iPad ports all
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0 auto-bind vlan iPad
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=config stpd s0 add vlan Wireless ports all
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0 auto-bind vlan Wireless
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=config stpd s0 add vlan VOIP_Phones ports all
DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=enable stpd s0 auto-bind vlan VOIP_Phones

DEBUG:MainThread:ezspantree:exsh_clicmd.322:: command=save
It didn't change my configuration, so at least I had it right before, which is good to know.

James_A
Valued Contributor
This is using the built-in version of the script in 22.4.1.4. And for STP logging I enabled these:
configure log filter DefaultFilter add events STP.State.Topology configure log filter DefaultFilter add events STP.State.PortState configure log filter DefaultFilter add events STP.State.PortRole

James_A
Valued Contributor
When I run the script on a fresh switch, just upgraded to 22.4.1.4, which hasn't had any STP configuration, then it runs fine.

GTM-P2G8KFN