I already posted this question here but got no satisfying answer so far.
My problem ist the following: I connect to an ArcSDE-geodatabase using CreateArcSDEConnectionFile. When I execute this code I get a warning
WARNING 000565: Could not connect to server.
However the file was created, I can even drop it to ArcCatalog-folder, where SDE-files are located and open the connection in ArcCatalog.
However the connection-parameters seem valid as I already checked the same on my own machine - working.
This is the appropriate code so far:
<SPAN class="pln">temp </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> r</SPAN><SPAN class="str">'C:\Users\admin\AppData\Local\Temp'</SPAN><SPAN class="pln">
host </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> </SPAN><SPAN class="str">"myServer"</SPAN><SPAN class="pln">
sdeFileName </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> </SPAN><SPAN class="str">"mySdeFile.sde"</SPAN><SPAN class="pln">
service </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> </SPAN><SPAN class="str">"sde:oracle11g:myHost/myInstance:"</SPAN><SPAN class="pln"> </SPAN><SPAN class="pun">+</SPAN><SPAN class="pln"> user
arcpy</SPAN><SPAN class="pun">.</SPAN><SPAN class="typ">CreateArcSDEConnectionFile_management</SPAN><SPAN class="pun">(</SPAN><SPAN class="pln">temp</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> sdeFileName</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> myHost</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> service</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> username </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> user</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> password </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> password</SPAN><SPAN class="pun">,</SPAN><SPAN class="pln"> version </SPAN><SPAN class="pun">=</SPAN><SPAN class="pln"> version</SPAN><SPAN class="pun">)</SPAN>
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).
So I assume that the mentioned warning not necessarily means an invalid connection. Thus I appended a check for the contained datasets:
if "000565" in arcpy.GetMessages() and arcpy.ListDatasets() == []:
raise IOError("Invalid SDE-connection paramaters")However this seems bit overkill to me.
Is this a bug? Am I stuck on making a check on the datasets?