Validate Asset Package

3123
6
03-27-2019 07:26 AM

Validate Asset Package

We have been asked a few times, is there a way to validate the asset package without having to apply it to a Utility Network.  Here is a simple toolbox that will do that.  It is limited to the first 100 errors.  We will look at exposing this limit in the future.

Here is an example output:

Tags (1)
Attachments
Comments

Any ideas on this error message?

2019-05-29 11:05:13 Starting AssociationsValidation.main
2019-05-29 11:05:13 Starting AssociationsValidation._validate_associations_have_rules
2019-05-29 11:05:13 Finished AssociationsValidation._validate_associations_have_rules 0.022342499999993493
2019-05-29 11:05:13 Finished AssociationsValidation.main 0.03964140000000782
2019-05-29 11:05:13 Creating UN data element
2019-05-29 11:05:13  Reading B_AttributeIndex - None
2019-05-29 11:05:14  Reading B_AttributeIndex_Fields - None
2019-05-29 11:05:14  Reading _Version - None
2019-05-29 11:05:14 Removing the following items from XML:
{}
2019-05-29 11:05:15 Finished AssetPackage._initialize 10.683466899999999
2019-05-29 11:05:15 Purging describe cache: CacheInfo(hits=0, misses=0, maxsize=128, currsize=0)
2019-05-29 11:05:15 Starting UtilityNetwork._initialize
 2019-05-29 11:05:15 A python error occurred.
 2019-05-29 11:05:15 EXCEPTION
Traceback (most recent call last):
  File "C:\Users\cmartin\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\untools\common\wrappers.py", line 83, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\cmartin\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\untools\gptools\tools.py", line 546, in run
    un = UtilityNetwork.from_cache(f'{uuid.uuid4().hex}/FeatureDataset/UtilityNetwork', item=cache.as_posix())
  File "C:\Users\cmartin\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\untools\utility_network\un.py", line 75, in from_cache
    return cls(utility_network=utility_network, cache=item)
  File "C:\Users\cmartin\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\untools\utility_network\un.py", line 40, in __init__
    self._properties = self._initialize(kwargs.pop('cache', None))
  File "C:\Users\cmartin\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\untools\common\wrappers.py", line 288, in wrapper
    result = func(*args, **kwargs)
  File "C:\Users\cmartin\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\untools\utility_network\un.py", line 47, in _initialize
    self._xml = read_xml(cache)
  File "C:\Users\cmartin\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone2\lib\site-packages\untools\utils\serializer.py", line 27, in read_xml
    return lxml.etree.parse(str(xml_file), parser=parser).getroot()
  File "src/lxml/etree.pyx", line 3426, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1840, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1866, in lxml.etree._parseDocumentFromURL
  File "src/lxml/parser.pxi", line 1770, in lxml.etree._parseDocFromFile
  File "src/lxml/parser.pxi", line 1163, in lxml.etree._BaseParser._parseDocFromFile
  File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 638, in lxml.etree._raiseParseError
OSError: Error reading file 'C:/Users/cmartin/AppData/Local/ESRI/conda/envs/arcgispro-py3-clone2/lib/site-packages/untools/data_files/un.json': failed to load external entity "C:/Users/cmartin/AppData/Local/ESRI/conda/envs/arcgispro-py3-clone2/lib/site-packages/untools/data_files/un.json"
 Failed to execute (ValidateAP).

Uninstalled UNTools Python Pkg > installed updated version > restart ArcGIS Pro > works now.

The update pkgs tools wasn't picking up the most recent version so needed reinstall.

Hello, I have downloaded the Asset Package validation toolbox Validate Asset Package, unzipped and followed Use a custom geoprocessing tool instructions to install. When double-click on the tool it opens without any parameters (cannot enter the Asset Package name to validate). I am using ArcGIS Pro 2.4.1. Am I not using the tool correctly? Please advise

This is what you should see in Pro 2.4.1 with untools 2.4.1

Can you check which version of untools you have?

Thank you for a tip. I had untools 2.4.1 installed. To troubleshoot further, I deleted the cloned Python environment , created new clone and installed untools again. Once Pro was re-strated, the tool  worked as expected. Thank you for a prompt response.

is there a validate asset pakage for last untools v3.1.1?

Thank you

Version history
Last update:
‎03-27-2019 07:26 AM
Updated by:
Contributors