<?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 Re: SDE Connections Get Duplicated When Publishing Geoprocessing Services in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406187#M15752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad I'm not the only one who's seen this before. Thanks for the response, even if there's no resolution at the moment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Apr 2018 13:33:31 GMT</pubDate>
    <dc:creator>MKF62</dc:creator>
    <dc:date>2018-04-02T13:33:31Z</dc:date>
    <item>
      <title>SDE Connections Get Duplicated When Publishing Geoprocessing Services</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406185#M15750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm taking one last stab at an answer for this - has anybody had this happen before? When I publish a geoprocessing service that involves an SDE connection file, it copies that SDE connection file to the server (this is expected behavior) but then duplicates that connection down in arcgisserver/directories/arcgissystem/arcgisinput/../../extracted/v101 folder. I cannot figure out why it's doing this and I have tested everything I can possibly think of to see if it'll stop duplicating the connection file but it won't. It does this with any database connection and it does it no matter where the SDE file is stored on the publishing machine. The service works and it's the exact same database connection, so I'm not sure how much it matters, I just find it really weird and would like to understand it! The only thing I can think of at this point is that it's because I'm publishing a GP server from Desktop 10.6 to AGS 10.4.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This simple script published as a GP process yields this in the above-mentioned directory:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

db_con &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Users\xxx\AppData\Roaming\ESRI\Desktop10.6\ArcCatalog\HbMonitoringTest_nbcidb_HabitatTestWriter.sde"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;db_con&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;db_con&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"your db connection worked"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"your db connection sucks"&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG __jive_id="400067" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/400067_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;The script that resides on the server once the GP service is published references the duplicate (HbMonitoringTest_nbcidb_HabitatTestWriter&lt;STRONG&gt;1&lt;/STRONG&gt;.sde) and not the original.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll notice that there are two different dates/times listed for each of the SDE files; I created a database connection to the one without the 1 appended to the end yesterday, so when it copies this file to the server, the metadata (date/time) come with it and are not updated to reflect today's date since it's simply a copy. Once it's on the server, I guess it must duplicate it, hence why the file with a "1" appended to the end has the current date/time. I have outright deleted the GP service, made sure all the files are gone in the directory, and then republished from scratch to assure myself that there aren't two different files simply because one wasn't overwritten. That's not the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm tempted to roll back to Desktop 10.4.1 just to see if this issue goes away because I am out of ideas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406185#M15750</guid>
      <dc:creator>MKF62</dc:creator>
      <dc:date>2021-12-11T18:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: SDE Connections Get Duplicated When Publishing Geoprocessing Services</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406186#M15751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see the same thing publishing from Desktop 10.6 to Server 10.6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This looks like a bug to me. If instead of publishing you stage the service (copying data), the service analyzer throws an error like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEVERITY&amp;nbsp;STATUS&amp;nbsp;CODE&amp;nbsp;DESCRIPTION&amp;nbsp;NAME&amp;nbsp;TYPE&lt;BR /&gt;High&amp;nbsp;Unresolved&amp;nbsp;00068&amp;nbsp;Script Script contains broken project data source: C:\Users\xxx\AppData\Local\ESRI\Desktop10.6\Staging\server on mymachine.esri.com (admin)\0\v101\connectionfile1.sde&amp;nbsp;Script&amp;nbsp;Tool&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have a connectionfile1.sde. I just have a connectionfile.sde&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2018 15:51:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406186#M15751</guid>
      <dc:creator>RandallWilliams</dc:creator>
      <dc:date>2018-03-30T15:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: SDE Connections Get Duplicated When Publishing Geoprocessing Services</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406187#M15752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad I'm not the only one who's seen this before. Thanks for the response, even if there's no resolution at the moment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2018 13:33:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406187#M15752</guid>
      <dc:creator>MKF62</dc:creator>
      <dc:date>2018-04-02T13:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: SDE Connections Get Duplicated When Publishing Geoprocessing Services</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406188#M15753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an issue open with Esri Support. From where I'm sitting, the issue is actually a little more severe. If I attempt to stage a GP service, using the option to copy data into the service definition, Desktop looks for that invalid .sde connection file and fails to stage the .SD. I'll follow up with the bug # once they've logged it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2018 13:38:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406188#M15753</guid>
      <dc:creator>RandallWilliams</dc:creator>
      <dc:date>2018-04-02T13:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: SDE Connections Get Duplicated When Publishing Geoprocessing Services</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406189#M15754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was having a similar problem and also getting the broken project data source error message.&amp;nbsp; I finally got around it by adding the SDE connection file as an input parameter and then joining it to my feature class name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;## Input for the connection file C:\Temp\Prod_Land.sde&lt;/SPAN&gt;
conn &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&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="comment token"&gt;## Using the join method to ensure for correct path delimiters&lt;/SPAN&gt;
tree_lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;conn&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"trees_prod.dbo.Trees"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:28:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sde-connections-get-duplicated-when-publishing/m-p/406189#M15754</guid>
      <dc:creator>MartinWong1</dc:creator>
      <dc:date>2021-12-11T18:28:35Z</dc:date>
    </item>
  </channel>
</rss>

