<?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 arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267424#M67073</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've encountered an issue in ArcGIS Pro 3, when using arcpy.da.Describe on layers (.lyr/.lyrx) that contain a group layers, it causes a hard crash in ArcGIS Pro 3.&lt;/P&gt;&lt;P&gt;If running the same script outside of Pro the script will just terminate.&amp;nbsp;I can't catch the error with try/except either.&lt;/P&gt;&lt;P&gt;No issues with layer files containing a single layer.&lt;/P&gt;&lt;P&gt;The issue doesn't occur using arcpy.Describe, but that's not as useful as a dictionary. I've modified my code to handle things differently for layers and maps, but thought it worth reporting this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

lyr = r"c:\temp\group_layer.lyrx"

desc = arcpy.Describe( lyr )
desc.dataElement.name
&amp;gt;&amp;gt;&amp;gt; group_layer.lyrx

# Hard crash here...
desc = arcpy.da.Describe( lyr )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Mar 2023 11:50:01 GMT</pubDate>
    <dc:creator>AndyEgleton</dc:creator>
    <dc:date>2023-03-14T11:50:01Z</dc:date>
    <item>
      <title>arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267424#M67073</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've encountered an issue in ArcGIS Pro 3, when using arcpy.da.Describe on layers (.lyr/.lyrx) that contain a group layers, it causes a hard crash in ArcGIS Pro 3.&lt;/P&gt;&lt;P&gt;If running the same script outside of Pro the script will just terminate.&amp;nbsp;I can't catch the error with try/except either.&lt;/P&gt;&lt;P&gt;No issues with layer files containing a single layer.&lt;/P&gt;&lt;P&gt;The issue doesn't occur using arcpy.Describe, but that's not as useful as a dictionary. I've modified my code to handle things differently for layers and maps, but thought it worth reporting this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

lyr = r"c:\temp\group_layer.lyrx"

desc = arcpy.Describe( lyr )
desc.dataElement.name
&amp;gt;&amp;gt;&amp;gt; group_layer.lyrx

# Hard crash here...
desc = arcpy.da.Describe( lyr )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 11:50:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267424#M67073</guid>
      <dc:creator>AndyEgleton</dc:creator>
      <dc:date>2023-03-14T11:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267475#M67075</link>
      <description>&lt;P&gt;Does this crash too?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcpy.da import Describe

dir(Describe)
['__call__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', 
 '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__',
 '__init_subclass__', '__le__', '__lt__', '__module__', '__name__', '__ne__',
 '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__',
 '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
 '__text_signature__']&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 Mar 2023 11:47:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267475#M67075</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-03-14T11:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267477#M67076</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;That works as expected, sorry forgot to type the last bit of code in my example, its when trying to describe a group layer I get a hard crash:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.da.Describe( group_lyr )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 11:52:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267477#M67076</guid>
      <dc:creator>AndyEgleton</dc:creator>
      <dc:date>2023-03-14T11:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267478#M67077</link>
      <description>&lt;P&gt;I don't have any lyrx files to test, but if it does the same thing on another one, (or no one else weights in), you should forward this as a bug&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 11:58:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267478#M67077</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-03-14T11:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267538#M67078</link>
      <description>&lt;P&gt;I gave it a try on a layer group and it stalled at the da.Describe() and failed silently as well.&amp;nbsp; I'd report it as a bug.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

try:
    lyr = r"C:\Users\klingj\Documents\ArcGIS\Projects\Testing\Group Schools.lyrx"

    desc = arcpy.da.Describe(lyr, 'layer')
    for k, v in desc.items():
        print(f"{k}: {v}")
except Exception as ex:
    print(ex)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The lyrx file is just a file with a dictionary in it though. Open it up in notepad or vs code.&amp;nbsp; You could load it in using json and parse out the information:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import json
import arcpy

try:

    glyr = r"C:\Users\u\Documents\ArcGIS\Projects\Testing\Group Schools.lyrx"

    with open(glyr) as jFile:
        lyrD = [l.replace('\n', '').strip() for l in jFile.readlines()]  # &amp;lt;- strip the \n to format as valid json
        strlyr = ''.join(lyrD)  # &amp;lt;- form a single string

        gLyrJson = json.loads(strlyr)  # &amp;lt;- load as json

    for lyr in gLyrJson['layerDefinitions']:
        print(lyr['name'])
        print(lyr['featureTable']['dataConnection'])

        # Try describe here!
        # you'll have to create the path so this might be in the dictionary, I had to parse out the DATABASE=. for this example
        path = fr"C:\Users\u\Documents\ArcGIS\Projects\Testing{lyr['featureTable']['dataConnection']['workspaceConnectionString'].replace(r'DATABASE=.', '')}\{lyr['featureTable']['dataConnection']['dataset']}"

        desc = arcpy.da.Describe(path)

        for k, v in desc.items():
            print(f"{k}: {v}")

except Exception as ex:
    print(ex)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 14:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1267538#M67078</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-03-14T14:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1268591#M67127</link>
      <description>&lt;P&gt;I see you are using&amp;nbsp;&lt;STRONG&gt;arcpy.da.Describe&lt;/STRONG&gt; which having read the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/describing-data.htm" target="_self"&gt;Help file&lt;/A&gt; I've discovered that you use this if you want results in a dictionary format.&amp;nbsp; I've never ever used that approach and I wonder if you don't need your description as a dictionary object then maybe you can use &lt;STRONG&gt;arcpy.Describe()&lt;/STRONG&gt; instead?&amp;nbsp; This is the approach I use and have never had any issues with.&amp;nbsp; If it is a bug as hinted by other responders, then if you need to resolve this quickly, I would suggest you explore the use of&amp;nbsp;&lt;STRONG&gt;arcpy.Describe().&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 16:55:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1268591#M67127</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2023-03-16T16:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1268627#M67129</link>
      <description>&lt;P&gt;I've used arcpy.Describe for LayerFiles now, its just extra lines of code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;desc = arcpy.da.Describe( item )
some_detail = desc.get( "shapeType", None )&lt;/LI-CODE&gt;&lt;P&gt;vs&lt;/P&gt;&lt;LI-CODE lang="python"&gt;desc = arcpy.Describe( item )
some_detail = None
with contextlib.suppress( AttributeError )
    some_detail = desc.shapeType&lt;/LI-CODE&gt;&lt;P&gt;I'll raise a bug.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 17:45:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1268627#M67129</guid>
      <dc:creator>AndyEgleton</dc:creator>
      <dc:date>2023-03-16T17:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1271962#M67235</link>
      <description>&lt;P&gt;Did you have a chance to log this? We can make sure it gets looked at once it is.&lt;/P&gt;&lt;P&gt;Thanks! Shaun&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 15:45:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1271962#M67235</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2023-03-27T15:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1272327#M67248</link>
      <description>&lt;P&gt;Hi Shaun,&lt;/P&gt;&lt;P&gt;There is an open case: &lt;SPAN&gt;03301233&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 07:09:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1272327#M67248</guid>
      <dc:creator>AndyEgleton</dc:creator>
      <dc:date>2023-03-28T07:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.Describe on Group Layer causes hard crash on ArcGIS Pro 3</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1275318#M67344</link>
      <description>&lt;P&gt;Thanks Andy. I can't see it till it can wend its way into a bug report, but will keep an eye for it.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 15:35:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-describe-on-group-layer-causes-hard-crash/m-p/1275318#M67344</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2023-04-04T15:35:55Z</dc:date>
    </item>
  </channel>
</rss>

