<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic GeoProcessing service Issue accessing mxd using UNC Path in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-issue-accessing-mxd-using/m-p/237814#M8112</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! I'm having an issue with a GP service that runs a Python script. The script works fine in ArcGIS toolbox, but it fails when I run it as a GP Service.&amp;nbsp;Is failing when tries to list the dataframes of the mxd in this line &lt;STRONG&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;STRONG&gt;part of the script that fails:&lt;/STRONG&gt; &lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="background-color: #ffe4ff;"&gt;TemplateMXD&lt;/SPAN&gt; = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;r"\\kl-fs-003\GIS_Storage\Ancillary\Templates\Map_Document_Templates\Task_Based\Land_Registry_SketchUp_DrawingTemplate.mxd"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument(TemplateMXD)&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;df = arcpy.mapping.ListDataFrames(mxd)[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]


&lt;STRONG&gt;The exception is:&lt;/STRONG&gt; 

&lt;UL style="font-size: 14.4px;"&gt;&lt;LI style="padding: 0px 0px 3px;"&gt;&lt;EM&gt;esriJobMessageTypeError&lt;/EM&gt;: Traceback (most recent call last): File "D:\arcgissystem\arcgisinput\UK_I\ExportPropertySketchToShapefilePDF.GPServer\extracted\v101\afernandez\Land_Registry_SkectchUp_2016.py", line 170, in df = arcpy.mapping.ListDataFrames(mxd)[0] File "c:\program files\arcgis\server\arcpy\arcpy\utils.py", line 181, in fn_ return fn(*args, **kw) File "c:\program files\arcgis\server\arcpy\arcpy\mapping.py", line 1479, in ListDataFrames result = mixins.MapDocumentMixin(map_document).listDataFrames(wildcard) File "c:\program files\arcgis\server\arcpy\arcpy\arcobjects\mixins.py", line 728, in listDataFrames return list(reversed(list(self.dataFrames))) &lt;/LI&gt;&lt;LI style="padding: 0px 0px 3px;"&gt;File "c:\program files\arcgis\server\arcpy\arcpy\arcobjects\mixins.py", &lt;/LI&gt;&lt;LI style="padding: 0px 0px 3px;"&gt;line 695, in dataFrames return map(convertArcObjectToPythonObject, self.pageLayout.dataFrames) &lt;/LI&gt;&lt;LI style="padding: 0px 0px 3px;"&gt;&lt;STRONG&gt;AttributeError: 'NoneType' object has no attribute 'dataFrames'&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/PRE&gt;&lt;P&gt;For some reason seems that the GP service is not able to open the mxd correctly. TemplateMXD is a UNC path and this path is Accessible to ArcGIS Server (in ArcGIS Server Manage, I've added &amp;nbsp;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;\\kl-fs-003\GIS_Storage\ &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;as a Registered Folder) (see attached). &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mxd is fine, and the layer that contains the mxd is correct, there is no problems or broken links in there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas of what could be wrong ?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 11:58:35 GMT</pubDate>
    <dc:creator>StephenBamford</dc:creator>
    <dc:date>2021-12-11T11:58:35Z</dc:date>
    <item>
      <title>GeoProcessing service Issue accessing mxd using UNC Path</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-issue-accessing-mxd-using/m-p/237814#M8112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! I'm having an issue with a GP service that runs a Python script. The script works fine in ArcGIS toolbox, but it fails when I run it as a GP Service.&amp;nbsp;Is failing when tries to list the dataframes of the mxd in this line &lt;STRONG&gt;df = arcpy.mapping.ListDataFrames(mxd)[0]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;STRONG&gt;part of the script that fails:&lt;/STRONG&gt; &lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="background-color: #ffe4ff;"&gt;TemplateMXD&lt;/SPAN&gt; = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;r"\\kl-fs-003\GIS_Storage\Ancillary\Templates\Map_Document_Templates\Task_Based\Land_Registry_SketchUp_DrawingTemplate.mxd"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument(TemplateMXD)&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;df = arcpy.mapping.ListDataFrames(mxd)[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]


&lt;STRONG&gt;The exception is:&lt;/STRONG&gt; 

&lt;UL style="font-size: 14.4px;"&gt;&lt;LI style="padding: 0px 0px 3px;"&gt;&lt;EM&gt;esriJobMessageTypeError&lt;/EM&gt;: Traceback (most recent call last): File "D:\arcgissystem\arcgisinput\UK_I\ExportPropertySketchToShapefilePDF.GPServer\extracted\v101\afernandez\Land_Registry_SkectchUp_2016.py", line 170, in df = arcpy.mapping.ListDataFrames(mxd)[0] File "c:\program files\arcgis\server\arcpy\arcpy\utils.py", line 181, in fn_ return fn(*args, **kw) File "c:\program files\arcgis\server\arcpy\arcpy\mapping.py", line 1479, in ListDataFrames result = mixins.MapDocumentMixin(map_document).listDataFrames(wildcard) File "c:\program files\arcgis\server\arcpy\arcpy\arcobjects\mixins.py", line 728, in listDataFrames return list(reversed(list(self.dataFrames))) &lt;/LI&gt;&lt;LI style="padding: 0px 0px 3px;"&gt;File "c:\program files\arcgis\server\arcpy\arcpy\arcobjects\mixins.py", &lt;/LI&gt;&lt;LI style="padding: 0px 0px 3px;"&gt;line 695, in dataFrames return map(convertArcObjectToPythonObject, self.pageLayout.dataFrames) &lt;/LI&gt;&lt;LI style="padding: 0px 0px 3px;"&gt;&lt;STRONG&gt;AttributeError: 'NoneType' object has no attribute 'dataFrames'&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/PRE&gt;&lt;P&gt;For some reason seems that the GP service is not able to open the mxd correctly. TemplateMXD is a UNC path and this path is Accessible to ArcGIS Server (in ArcGIS Server Manage, I've added &amp;nbsp;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;\\kl-fs-003\GIS_Storage\ &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;as a Registered Folder) (see attached). &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mxd is fine, and the layer that contains the mxd is correct, there is no problems or broken links in there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas of what could be wrong ?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:58:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-issue-accessing-mxd-using/m-p/237814#M8112</guid>
      <dc:creator>StephenBamford</dc:creator>
      <dc:date>2021-12-11T11:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: GeoProcessing service Issue accessing mxd using UNC Path</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-issue-accessing-mxd-using/m-p/237815#M8113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error line at the end states AttributeError: 'NoneType' object has no attribute 'dataFrames'. &amp;nbsp;Also when that part of the script is running the listDataFrames function looks like it requires a wildcard. &amp;nbsp;I would try to add a wildcard when listing the dataframes in the script e.g.&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;df &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListDataFrames&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2016 11:52:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-issue-accessing-mxd-using/m-p/237815#M8113</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2016-12-13T11:52:32Z</dc:date>
    </item>
  </channel>
</rss>

