<?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 Unable to copy feature classes on ArcGIS Server 10.2.2 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122991#M9539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been trying without success to transfer a functional script on my local drive to a shared server that my organization has read and write access to. The server is running ArcGIS Server 10.2.2, and my code is written in Python 2.7.10. I've noticed that the code hangs at a certain point, no errors or exceptions are thrown, the program just runs and chews up RAM until the process is cancelled. I let it run overnight and what should take under 20 seconds to complete still was not complete.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script's purpose is to update an existing feature class in an existing file geodatabase while creating several backups and zip files for export and storage elsewhere. The code gets hung up on the line where it is attempting to copy an XY layer into a feature class on a local drive it shares with the script. Code sample below (failure at bold face font):&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; locations_Layer = db + "\\" + "locations_Layer"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; arcpy.MakeXYEventLayer_management(inFolder + "\\locations.txt", "X_COORDINATE", "Y_COORDINATE", locations_Layer, "PROJCS['NAD_1983_CSRS_New_Brunswick_Stereographic',GEOGCS['GCS_North_American_1983_CSRS',DATUM['D_North_American_1983_CSRS',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Double_Stereographic'],PARAMETER['False_Easting',2500000.0],PARAMETER['False_Northing',7500000.0],PARAMETER['Central_Meridian',-66.5],PARAMETER['Scale_Factor',0.999912],PARAMETER['Latitude_Of_Origin',46.5],UNIT['Meter',1.0]];-28216700 -23260100 10000;#;#;0.001;#;#;IsHighPrecision")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; print "Make xy event layer completed"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; arcpy.FeatureClassToFeatureClass_conversion (locations_Layer, db, 'civic_addresses')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; print "XY to FC conversion completed"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This process works flawlessly on my machine when writing to local and shared drives, but when run from the server infrastructure the script fails to function at this point in the code. I can upload the whole script if necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any guidance would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2018 17:22:01 GMT</pubDate>
    <dc:creator>AdamTaylor5</dc:creator>
    <dc:date>2018-11-13T17:22:01Z</dc:date>
    <item>
      <title>Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122991#M9539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been trying without success to transfer a functional script on my local drive to a shared server that my organization has read and write access to. The server is running ArcGIS Server 10.2.2, and my code is written in Python 2.7.10. I've noticed that the code hangs at a certain point, no errors or exceptions are thrown, the program just runs and chews up RAM until the process is cancelled. I let it run overnight and what should take under 20 seconds to complete still was not complete.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script's purpose is to update an existing feature class in an existing file geodatabase while creating several backups and zip files for export and storage elsewhere. The code gets hung up on the line where it is attempting to copy an XY layer into a feature class on a local drive it shares with the script. Code sample below (failure at bold face font):&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; locations_Layer = db + "\\" + "locations_Layer"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; arcpy.MakeXYEventLayer_management(inFolder + "\\locations.txt", "X_COORDINATE", "Y_COORDINATE", locations_Layer, "PROJCS['NAD_1983_CSRS_New_Brunswick_Stereographic',GEOGCS['GCS_North_American_1983_CSRS',DATUM['D_North_American_1983_CSRS',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Double_Stereographic'],PARAMETER['False_Easting',2500000.0],PARAMETER['False_Northing',7500000.0],PARAMETER['Central_Meridian',-66.5],PARAMETER['Scale_Factor',0.999912],PARAMETER['Latitude_Of_Origin',46.5],UNIT['Meter',1.0]];-28216700 -23260100 10000;#;#;0.001;#;#;IsHighPrecision")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; print "Make xy event layer completed"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; arcpy.FeatureClassToFeatureClass_conversion (locations_Layer, db, 'civic_addresses')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; print "XY to FC conversion completed"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This process works flawlessly on my machine when writing to local and shared drives, but when run from the server infrastructure the script fails to function at this point in the code. I can upload the whole script if necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any guidance would be appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 17:22:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122991#M9539</guid>
      <dc:creator>AdamTaylor5</dc:creator>
      <dc:date>2018-11-13T17:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122992#M9540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is the &lt;STRONG&gt;db&lt;/STRONG&gt; variable referencing the File Geodatabase?&amp;nbsp; Is it using a UNC path (i.e. \\fileshare\gis).&amp;nbsp; If so, can the ArcGIS Server machine access the File Geodatabase through the UNC path?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:02:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122992#M9540</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2018-11-13T18:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122993#M9541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jake,&lt;/P&gt;&lt;P&gt;Thanks for the suggestion. I think I see where you're coming from, and here are snippets from my code related to what you mentioned:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;env.workspace = os.path.dirname(os.path.abspath(__file__))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;workspace = os.path.dirname(os.path.abspath(__file__)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;inFolder = workspace&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;arcpy.CreateFolder_management(workspace,'fgdb')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;outLocation = workspace + "\\" + "fgdb"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;outGDB = "geonb_gcadb-bdavg.gdb"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;if arcpy.Exists(outLocation + "\\" + outGDB) == True:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GDB = outLocation + "\\" + outGDB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outLocation = str(GDB)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;elif arcpy.Exists(outLocation + "\\" + outGDB) == False:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GDB = arcpy.CreateFileGDB_management(outLocation, outGDB)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GDB = outLocation + "\\" + outGDB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outLocation = str(GDB)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;db = outLocation&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;As for whether that uses the UNC path I'm honestly not sure. Elsewhere in the script I refer to 'off drive' locations using notation like the below, and it reads and copies those locations just fine. The following code precedes my problem code and executes properly:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;zipOrig = '\\\\geoappcifs-test\\cifs-geoapp-test\\geonbdata\\CADB_update\\PLANETLOCN.zip'&lt;BR /&gt;shutil.copy2(zipOrig,workspace)&lt;BR /&gt;zip_folder = workspace + "\\" + "PLANETLOCN.zip"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; background: #FEFEFE;"&gt;Hope that helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:17:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122993#M9541</guid>
      <dc:creator>AdamTaylor5</dc:creator>
      <dc:date>2018-11-13T18:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122994#M9542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have error trapping incorporated into your python script?&amp;nbsp; If so, maybe comment out the error trapping on the server and see if you get some message indicating an issue when the script crashes on the server?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:18:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122994#M9542</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2018-11-13T18:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122995#M9543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm relatively new at the language after having used it for a year, so I'm honestly not sure what you mean by error trapping. I could incorporate a try...except block on the problem area if that's what you are intending. Though I'm new at exception handling and the related syntax.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:27:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122995#M9543</guid>
      <dc:creator>AdamTaylor5</dc:creator>
      <dc:date>2018-11-13T18:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122996#M9544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what the &lt;STRONG&gt;__file__&lt;/STRONG&gt; variable is set to for your first two lines.&amp;nbsp; Try replacing those with the following to see if the script executes successfully:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\\\\geoappcifs-test\\cifs-geoapp-test\\geonbdata\\CADB_update'&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\\\\geoappcifs-test\\cifs-geoapp-test\\geonbdata\\CADB_update'&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, it's hard to find, but here is a &lt;A _jive_internal="true" href="https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet" target="_blank"&gt;post&lt;/A&gt; that describes how to post code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:04:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122996#M9544</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T07:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122997#M9545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good suggestion Jake, but hardcoding the file paths didn't solve the problem. I converted both entries to&amp;nbsp; "\\\\server\\folder" and the result was unchanged. As for that syntax I used, it is supposed to be a variable that represents the directory where the script (the "_file_") sits on disk, allowing the script to be moved around on disk and still function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 19:56:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122997#M9545</guid>
      <dc:creator>AdamTaylor5</dc:creator>
      <dc:date>2018-11-13T19:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122998#M9546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the error reported when the script fails?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 20:07:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122998#M9546</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2018-11-13T20:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122999#M9547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There isn't one: when run in the server environment it doesn't throw up errors, it just runs infinitely, chewing up RAM and doing nothing. I need to look into what Michael suggested and use error trapping, if I can figure out how that works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 20:10:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/122999#M9547</guid>
      <dc:creator>AdamTaylor5</dc:creator>
      <dc:date>2018-11-13T20:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/123000#M9548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may also want to try the CopyFeatures function just to see if this makes a difference at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.CopyFeatures_management(locations_Layer, db + '\\civic_addresses')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 20:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/123000#M9548</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2018-11-13T20:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to copy feature classes on ArcGIS Server 10.2.2</title>
      <link>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/123001#M9549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ironically enough, that was the function I used at first when designing the script. I switched to the feature class to feature class option as an attempt to fix it. They both cause the same hanging problem. I can try it again tomorrow just to see if it somehow makes a difference with the hardcoded environment variables. I'll let you know when I get back to work tomorrow. Thanks for the help so far though, it's much appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 20:18:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unable-to-copy-feature-classes-on-arcgis-server-10/m-p/123001#M9549</guid>
      <dc:creator>AdamTaylor5</dc:creator>
      <dc:date>2018-11-13T20:18:49Z</dc:date>
    </item>
  </channel>
</rss>

