cancel
Showing results for 
Search instead for 
Did you mean: 
Create a Post
Highlighted
PhongNN
Ivory

Error when trying to export package by import_export_package.py

Hi all

I have a trouble when trying to export a package from SMC. The message like this :

Exporting NAT policy

Getting information from show-nat-rulebase

Retrieved 50 out of 65 rules (76%)

Traceback (most recent call last):
File "import_export_package.py", line 59, in <module>
export_package(client, args)
File "D:\Python\ExportImportPolicyPackage-master\exporting\export_package.py", line 59, in export_package
nat_data_dict, nat_unexportable_objects = export_nat_rulebase(show_package.data["name"], client)
File "D:\Python\ExportImportPolicyPackage-master\exporting\export_nat_rulebase.py", line 13, in export_nat_rulebase
rulebase_rules, general_objects = get_query_nat_rulebase_data(client, {"package": package})
File "D:\Python\ExportImportPolicyPackage-master\exporting\export_objects.py", line 174, in get_query_nat_rulebase_data
if "Automatic Generated Rules : " in rulebase_item["name"]:
KeyError: 'name'

Does anyone have any ideas for this ?

Thank you

Regards

0 Kudos
5 Replies
Admin
Admin

Re: Error when trying to export package by import_export_package.py

To troubleshoot, we’d need to see those first 50 NAT rules in the policy.
It’s possible there’s something there the script doesn’t like.
0 Kudos
PhongNN
Ivory

Re: Error when trying to export package by import_export_package.py

Thanks for your reply

This is 50 rules nat

Screenshot_12.pngScreenshot_15.png

0 Kudos
Admin
Admin

Re: Error when trying to export package by import_export_package.py

Try enabling the disabled rules (don't push policy obviously) and see if it helps.
Note that most of the rules are automatic NAT rules which shouldn't necessarily get exported.
0 Kudos
PhongNN
Ivory

Re: Error when trying to export package by import_export_package.py

Thanks for your solution but it's does not work

enabled all disabled rules but the error message still appears

Thank you

 

0 Kudos
Admin
Admin

Re: Error when trying to export package by import_export_package.py

The log file that is created by running the export might provide some clue as might api.elg from the manager (believe it's in $FWDIR/log).
0 Kudos