Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Andrew-OCD
Contributor

Error when using Import/Export script - not in singular_to_plural_dictionary[client.api_version]

Dear Check Mates,

I recently uploaded the latest version of the following files:-

ExportImportPolicyPackage-master

cp_mgmt_api_python_sdk-master

to my MDSM and when I try to use the import_export_package.py I am getting the following error on a relatively simple policy.

 

This is the error I get returned:-

Exporting Access Control layers

Exporting Access Layer [TEMPLATE-FWOT001-Policy Network]

Retrieved 14 out of 14 rules (100%)

Traceback (most recent call last):
File "/home/Andrew/Python/ExportImportPolicyPackage-master/import_export_package.py", line 73, in <module>
export_package(client, args)
File "/home/Andrew/Python/ExportImportPolicyPackage-master/exporting/export_package.py", line 44, in export_package
= export_access_rulebase(show_package.data["name"], access_layer["name"], access_layer["uid"], client, timestamp, tar_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/Andrew/Python/ExportImportPolicyPackage-master/exporting/export_access_rulebase.py", line 16, in export_access_rulebase
get_query_rulebase_data(client, "access-rulebase", {"name": layer, "uid": layer_uid, "package": package})
File "/home/Andrew/Python/ExportImportPolicyPackage-master/exporting/export_objects.py", line 118, in get_query_rulebase_data
check_for_export_error(general_object, client)
File "/home/Andrew/Python/ExportImportPolicyPackage-master/utils.py", line 474, in check_for_export_error
general_object["type"] not in singular_to_plural_dictionary[client.api_version]):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: '2.0.1'

 

This is the output I get in the import_export.log:-

Checking existence of package [TEMPLATE-FWOT001-Policy]

Exporting Access Control layers

Exporting Access Layer [TEMPLATE-FWOT001-Policy Network]

Getting layer information for layer [TEMPLATE-FWOT001-Policy Network]

Getting information from show-access-rulebase

Retrieved 14 out of 14 rules (100%)

##Show presented object of type RulebaseAction with name Accept

##Show presented object of type CpmiAnyObject with name Any

##Show presented object of type host with name BROADCAST

 

I have tried to perform this export with multiple policies and I get the same error message.

Has anybody else seen such behaviour and can suggest a course of action to track down the fault? 

Thanks

Andrew

0 Kudos
4 Replies
Andrew-OCD
Contributor

FYI

MDSM running R82 JHF Take 91

0 Kudos
Tal_Paz-Fridman
MVP Platinum CHKP MVP Platinum CHKP
MVP Platinum CHKP

Hi @Andrew-OCD 

I will forward your post to the relevant owners in R&D to see if they can help

Thanks

0 Kudos
Andrew-OCD
Contributor

Dear,

I have been doing some further checking on this topic and found out that even if I create a simple policy which only contains nothing other than the default Clean up rule Any Any Block it fails in the same way.

This really looks like something very fundamental that has got broken when the addition of the api version 2 & 2.0.1 was added to the package.

I also note that this problem was logged as an issue in April when someone was asking about version 2.0.1 support.

In the meantime does anybody have a suggestion how I might go about performing this type of function manually?

Best Regards

Andrew

0 Kudos
tomerassa
Employee
Employee

Hi Andrew,

Please check you're really running the latest version of the tool from the master branch — it works for me with a management API version 2.0.1.

Regards,
Tomer

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    Tue 16 Jun 2026 @ 09:30 AM (BST)

    DDOS MasterClass in London!
    CheckMates Events