<?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 OS Error using sde file in python script in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/os-error-using-sde-file-in-python-script/m-p/1106355#M6725</link>
    <description>&lt;P&gt;There is a Python script intended to create a UPDM geodatabase, it receives several parameters, among them, database admin user, database dataowner user, and their passwords.&lt;/P&gt;&lt;P&gt;The script runs using the ArcGIS Pro 2.8 Python, it starts its process, creates the database, as well as connection files (.sde). In some point of the script, it has been created different structures: tables, relationships, domains, etc. but then it failswhile calling:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.da.ListDomains(self.database)&lt;/LI-CODE&gt;&lt;P&gt;The error is quite weird (at least for me):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

11:51.29.583441 ERROR C:\temp\Installation\Data\DataOwner.sde
11:51.29.589433 ERROR ['Traceback (most recent call last):\n', ' File ".\\Arcpy\\InstallDataModel.py", line 95, in main\n', ' File "C:\\temp\\Installation\\Arcpy\\Classes\\JSONGeoDataModelClass.py", line 598, in create_domains\n existing_domains = arcpy.da.ListDomains(self.database)\n', 'OSError: C:\\temp\\Installation\\Data\\DataOwner.sde\n']&lt;/LI-CODE&gt;&lt;P&gt;Furthermore, the ArcGIS Pro Crash Window appear 4 times (probably one time for each crash in the request of the gdal_MG4Lidar.dll).&lt;/P&gt;&lt;P&gt;In this point of the execution, this line has been called several times, the script has been using the sde connection file for several actions, inside the script there is no direct call to GDAL libraries (I assume it is an internal call from the ArcGIS Pro libraries/modules) and despite the message, I can verify the existence of the sde file and even use it in a new ArcGIS Pro instance.&lt;/P&gt;&lt;P&gt;What could be the reason behind this error? There is a way to surpass it?&lt;/P&gt;</description>
    <pubDate>Mon, 11 Oct 2021 10:19:44 GMT</pubDate>
    <dc:creator>Cristian_Galindo</dc:creator>
    <dc:date>2021-10-11T10:19:44Z</dc:date>
    <item>
      <title>OS Error using sde file in python script</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/os-error-using-sde-file-in-python-script/m-p/1106355#M6725</link>
      <description>&lt;P&gt;There is a Python script intended to create a UPDM geodatabase, it receives several parameters, among them, database admin user, database dataowner user, and their passwords.&lt;/P&gt;&lt;P&gt;The script runs using the ArcGIS Pro 2.8 Python, it starts its process, creates the database, as well as connection files (.sde). In some point of the script, it has been created different structures: tables, relationships, domains, etc. but then it failswhile calling:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.da.ListDomains(self.database)&lt;/LI-CODE&gt;&lt;P&gt;The error is quite weird (at least for me):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

ERROR 1: Can't load requested DLL: C:\ArcGISPro\bin\gdalplugins\gdal_MG4Lidar.dll
1114: A dynamic link library (DLL) initialization routine failed.

11:51.29.583441 ERROR C:\temp\Installation\Data\DataOwner.sde
11:51.29.589433 ERROR ['Traceback (most recent call last):\n', ' File ".\\Arcpy\\InstallDataModel.py", line 95, in main\n', ' File "C:\\temp\\Installation\\Arcpy\\Classes\\JSONGeoDataModelClass.py", line 598, in create_domains\n existing_domains = arcpy.da.ListDomains(self.database)\n', 'OSError: C:\\temp\\Installation\\Data\\DataOwner.sde\n']&lt;/LI-CODE&gt;&lt;P&gt;Furthermore, the ArcGIS Pro Crash Window appear 4 times (probably one time for each crash in the request of the gdal_MG4Lidar.dll).&lt;/P&gt;&lt;P&gt;In this point of the execution, this line has been called several times, the script has been using the sde connection file for several actions, inside the script there is no direct call to GDAL libraries (I assume it is an internal call from the ArcGIS Pro libraries/modules) and despite the message, I can verify the existence of the sde file and even use it in a new ArcGIS Pro instance.&lt;/P&gt;&lt;P&gt;What could be the reason behind this error? There is a way to surpass it?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 10:19:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/os-error-using-sde-file-in-python-script/m-p/1106355#M6725</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2021-10-11T10:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: OS Error using sde file in python script</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/os-error-using-sde-file-in-python-script/m-p/1106951#M6738</link>
      <description>&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;After making some changes in the code to introduce the python garbage collector, the erro is still present but now it is triggered by the call to:&lt;/P&gt;&lt;PRE&gt;arcpy.AddCodedValueToDomain_management&lt;/PRE&gt;&lt;P&gt;I noticed that the consumption of memory is a little bit less, but either way, the error is still present.&lt;/P&gt;&lt;P&gt;Is there a way to manage the memory used by the arcpy library?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 07:04:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/os-error-using-sde-file-in-python-script/m-p/1106951#M6738</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2021-10-13T07:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: OS Error using sde file in python script</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/os-error-using-sde-file-in-python-script/m-p/1106976#M6741</link>
      <description>&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;BR /&gt;After digging a little bit in the behavior of the memory in the computer while the script run, then I implemented the use of the garbage collector at the end of the functions, this does not remove the error.&lt;/P&gt;&lt;P&gt;I decided to split the execution in several parts, each part called independently. The script is still failing, but now, the error is :&lt;/P&gt;&lt;LI-CODE lang="c"&gt;CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
CPLGetTLSList(): TlsAlloc() failed!
&lt;/LI-CODE&gt;&lt;P&gt;According t this &lt;A href="http://%20https://github.com/OSGeo/gdal/blob/master/gdal/port/cpl_multiproc.cpp" target="_blank" rel="noopener"&gt;GDAL github page&lt;/A&gt; the error now is generated in that point, but the reason is still unknown.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 10:39:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/os-error-using-sde-file-in-python-script/m-p/1106976#M6741</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2021-10-13T10:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: OS Error using sde file in python script</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/os-error-using-sde-file-in-python-script/m-p/1109096#M6749</link>
      <description>&lt;P&gt;After digging in the behavior of the computer, and with the latest error messages I think, the issue is related to the thread management implemented underneath by arcpy library.&lt;/P&gt;&lt;P&gt;I split the script in several parts, and call every part from a new python process, in this way the number of threads does not exceed the allowed amount of threads. Example:&lt;/P&gt;&lt;PRE&gt;python.exe script_part1.py
python.exe script_part2.py
python.exe script_part3.py
python.exe script_part4.py&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Oct 2021 06:15:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/os-error-using-sde-file-in-python-script/m-p/1109096#M6749</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2021-10-20T06:15:14Z</dc:date>
    </item>
  </channel>
</rss>

