<?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 CreateArcSDEConnectionFile returns warning but creates the file in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/createarcsdeconnectionfile-returns-warning-but/m-p/561043#M43919</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I already posted this question &lt;A href="http://gis.stackexchange.com/questions/187269/create-sde-file-returns-warning-but-creates-the-file/187532#187532" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;​ but got no satisfying answer so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem ist the following: I connect to an ArcSDE-geodatabase using &lt;STRONG&gt;CreateArcSDEConnectionFile&lt;/STRONG&gt;. When I execute this code I get a warning&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;WARNING 000565: Could not connect to server.&lt;/PRE&gt;&lt;P&gt;However the file was created, I can even drop it to ArcCatalog-folder, where SDE-files are located and open the connection in ArcCatalog. &lt;/P&gt;&lt;P&gt;However the connection-parameters seem valid as I already checked the same on my own machine - working. &lt;/P&gt;&lt;P&gt;This is the appropriate code so far:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;temp &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; r&lt;/SPAN&gt;&lt;SPAN class="str"&gt;'C:\Users\admin\AppData\Local\Temp'&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
host &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"myServer"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
sdeFileName &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"mySdeFile.sde"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
service &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"sde:oracle11g:myHost/myInstance:"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;+&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; user
arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;CreateArcSDEConnectionFile_management&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;temp&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; sdeFileName&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; myHost&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; service&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; username &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; user&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; password &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; password&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; version &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; version&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What makes me confuse is that when chaning to application-server-connection the function returns without any error or warning (also checked it with Direct-Connect, which works also).&lt;/P&gt;&lt;P&gt;So I assume that the mentioned warning not necessarily means an invalid connection. Thus I appended a check for the contained datasets:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if "000565" in arcpy.GetMessages() and arcpy.ListDatasets() == []:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise IOError("Invalid SDE-connection paramaters")&lt;/PRE&gt;&lt;P&gt;However this seems bit overkill to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this a bug? Am I stuck on making a check on the datasets?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 00:12:47 GMT</pubDate>
    <dc:creator>CarstenSchumann</dc:creator>
    <dc:date>2021-12-12T00:12:47Z</dc:date>
    <item>
      <title>CreateArcSDEConnectionFile returns warning but creates the file</title>
      <link>https://community.esri.com/t5/python-questions/createarcsdeconnectionfile-returns-warning-but/m-p/561043#M43919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I already posted this question &lt;A href="http://gis.stackexchange.com/questions/187269/create-sde-file-returns-warning-but-creates-the-file/187532#187532" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;​ but got no satisfying answer so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem ist the following: I connect to an ArcSDE-geodatabase using &lt;STRONG&gt;CreateArcSDEConnectionFile&lt;/STRONG&gt;. When I execute this code I get a warning&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;WARNING 000565: Could not connect to server.&lt;/PRE&gt;&lt;P&gt;However the file was created, I can even drop it to ArcCatalog-folder, where SDE-files are located and open the connection in ArcCatalog. &lt;/P&gt;&lt;P&gt;However the connection-parameters seem valid as I already checked the same on my own machine - working. &lt;/P&gt;&lt;P&gt;This is the appropriate code so far:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;temp &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; r&lt;/SPAN&gt;&lt;SPAN class="str"&gt;'C:\Users\admin\AppData\Local\Temp'&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
host &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"myServer"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
sdeFileName &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"mySdeFile.sde"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
service &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="str"&gt;"sde:oracle11g:myHost/myInstance:"&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;+&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; user
arcpy&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;CreateArcSDEConnectionFile_management&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;temp&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; sdeFileName&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; myHost&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; service&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; username &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; user&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; password &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; password&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; version &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; version&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What makes me confuse is that when chaning to application-server-connection the function returns without any error or warning (also checked it with Direct-Connect, which works also).&lt;/P&gt;&lt;P&gt;So I assume that the mentioned warning not necessarily means an invalid connection. Thus I appended a check for the contained datasets:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if "000565" in arcpy.GetMessages() and arcpy.ListDatasets() == []:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise IOError("Invalid SDE-connection paramaters")&lt;/PRE&gt;&lt;P&gt;However this seems bit overkill to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this a bug? Am I stuck on making a check on the datasets?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:12:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/createarcsdeconnectionfile-returns-warning-but/m-p/561043#M43919</guid>
      <dc:creator>CarstenSchumann</dc:creator>
      <dc:date>2021-12-12T00:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: CreateArcSDEConnectionFile returns warning but creates the file</title>
      <link>https://community.esri.com/t5/python-questions/createarcsdeconnectionfile-returns-warning-but/m-p/561044#M43920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using a Direct Connect, use the Create Database Connection tool.&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="_jivemacro_uid_14600418424466647 jive_macro_code jive_text_macro" data-renderedposition="34_8_1332_16" jivemacro_uid="_14600418424466647" modifiedtitle="true"&gt;&lt;P&gt;arcpy.CreateDatabaseConnection_management&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 15:11:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/createarcsdeconnectionfile-returns-warning-but/m-p/561044#M43920</guid>
      <dc:creator>AndrewKeith3</dc:creator>
      <dc:date>2016-04-07T15:11:14Z</dc:date>
    </item>
  </channel>
</rss>

