I am using Pro 2.2.2 and trying to run the GP tool 'apply asset package' and load data. I get the following error that 'year 0 is out of range'. Is there any way to find out what date is causing this problem? I looked at the data in the asset package and all the dates I find are from Sep 2018. If I run 'apply asset package' and do not load the data, then the GP successfully completes.
Start Time: Friday, September 28, 2018 8:17:57 AM
Running script AssetPackageToUtilityNetwork...
ArcGIS Pro 2.2.2.12813
untools 2.2.0
A python error occurred.
EXCEPTIONTraceback (most recent call last): File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\common\wrappers.py", line 84, in wrapper return func(*args, **kwargs) File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\gptools\tools.py", line 258, in run un = UtilityNetworkTools(utility_network) File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\utils\utility_network.py", line 31, in __init__ self.refresh() File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\utils\utility_network.py", line 87, in refresh self.cache['describe'] = un_helper.Helper(self._un) File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\un_helper.py", line 1232, in __init__ super().__init__(utility_network) File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 845, in __init__ self.domainNetworks = [DomainNetworks(x) for x in d.domainNetworks or []] File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 845, in <listcomp> self.domainNetworks = [DomainNetworks(x) for x in d.domainNetworks or []] File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 524, in __init__ self.tiers = [Tiers(x) for x in d.tiers or []] File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 524, in <listcomp> self.tiers = [Tiers(x) for x in d.tiers or []] File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 450, in __init__ self.aggregatedLinesForSubnetLine = [AssetGroups(x) for x in d.aggregatedLinesForSubnetLine or []] File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 450, in <listcomp> self.aggregatedLinesForSubnetLine = [AssetGroups(x) for x in d.aggregatedLinesForSubnetLine or []] File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 305, in __init__ self.assetTypes = [AssetTypes(x, source) for x in d.assetTypes or []] File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 305, in <listcomp> self.assetTypes = [AssetTypes(x, source) for x in d.assetTypes or []] File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 260, in __init__ self.creationTime = convert_time(getattr(d, 'creationTime', None)) File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\untools\abstract\describe.py", line 51, in convert_time return dateutil.parser.parse(stamp) File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\dateutil\parser\_parser.py", line 1356, in parse return DEFAULTPARSER.parse(timestr, **kwargs) File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\dateutil\parser\_parser.py", line 653, in parse ret = self._build_naive(res, default) File "C:\Users\pe_gis\AppData\Local\ESRI\conda\envs\UN-environment\lib\site-packages\dateutil\parser\_parser.py", line 1227, in _build_naive naive = default.replace(**repl)ValueError: year 0 is out of range
Failed to execute (AssetPackageToUtilityNetwork).
Failed at Friday, September 28, 2018 8:18:04 AM (Elapsed Time: 7.45 seconds)
Solved! Go to Solution.
I submitted a case to esri about this and found that the connection I was using when running the 'Apply Asset Package' GP tool needed to have its geodatabase connection properties set to use 'Traditional' versioning. I had it set to use 'Branch' versioning. I ended up deleting the Utility Network dataset and running 'Stage Utility Network' GP tool again. Then I ran 'Apply Asset Package' and loaded the data successfully.
This looks like a timestamp in the UN that is causing the issue. This error occurs when reading the UN (though that doesn't explain why you don't get the error when not loading data).
I submitted a case to esri about this and found that the connection I was using when running the 'Apply Asset Package' GP tool needed to have its geodatabase connection properties set to use 'Traditional' versioning. I had it set to use 'Branch' versioning. I ended up deleting the Utility Network dataset and running 'Stage Utility Network' GP tool again. Then I ran 'Apply Asset Package' and loaded the data successfully.