<?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: ERROR 999999 when running python as service in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453900#M35655</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yes i have&amp;nbsp; it is a match ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the scrip tool is working well under arcmap or arccatalog it is only fails when i publish it as a services .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this is the exact error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error executing tool.: Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "D:\arcgisserver\directories\arcgissystem\arcgisinput\fieldcalc1.GPServer\extracted\v101\my_toolboxes\calc1.py", line 22,in&amp;nbsp; arcpy.CalculateField_management(area_shp, g_ESRI_variable_2, g_ESRI_variable_3, "PYTHON", "") &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "c:\program files\arcgis\server\arcpy\arcpy\management.py", line 3129, in CalculateField raise e ExecuteError: ERROR 999999: Error executing function. General function failure Failed to execute (CalculateField). Failed to execute (fieldcalc1). Failed to execute (fieldcalc1).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Nov 2013 15:54:11 GMT</pubDate>
    <dc:creator>irishadar</dc:creator>
    <dc:date>2013-11-25T15:54:11Z</dc:date>
    <item>
      <title>ERROR 999999 when running python as service</title>
      <link>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453895#M35650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the code below runs ok from ArcCatalog,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but once i publish it it fail with error&amp;nbsp; :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Traceback (most recent call last): 
File "D:\arcgisserver\directories\arcgissystem\arcgisinput\UploadeS.GPServer\extracted\v101\my_toolboxes\UPLOADER.py", line 55,
in&amp;nbsp; arcpy.CalculateField_management(lyrSource, g_ESRI_variable_3, SURVEY_ID, "PYTHON", "") 
File "c:\program files\arcgis\server\arcpy\arcpy\management.py", line 3129,
 in CalculateField raise e ExecuteError: ERROR 999999: Error executing function.
 General function failure Failed to execute (CalculateField).
 Failed to execute (UploadeShapeFiles). Failed to execute (UploadeShapeFiles)."&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;it is allso works if i use only "appand"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any one notice what is worng?!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
# Import arcpy module
import arcpy

arcpy.env.overwriteOutput=True
arcpy.env.workspace="d:\\GIS_PROC\\TEMP.gdb"

# Load required toolboxes
#arcpy.ImportToolbox("Model Functions")

#getting user parms
#LyrNamesStr=arcpy.GetParameterAsText(0)
#SURVEY_ID=arcpy.GetParameterAsText(1)

# hard coded parms for testing
LyrNamesStr="area_528d0df4ec13b"
SURVEY_ID=99

LyrNames =LyrNamesStr.split(',')
print LyrNames

startUrl ='D:\\AllData\\';
EndUrl='.shp'
destenationUrlStart="C:\\Users\\administrator.IAA\\AppData\\Roaming\\ESRI\\Desktop10.1\\ArcCatalog\\archeo@msurvey.sde\\"


#UPL_LINE UPL_POLY UPL_POINT
# Local variables:
for lyr in LyrNames:
&amp;nbsp;&amp;nbsp;&amp;nbsp; lyrSource=startUrl+lyr+EndUrl
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print '1'
&amp;nbsp;&amp;nbsp;&amp;nbsp; desc=arcpy.Describe(lyrSource)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #print "Feature Type:&amp;nbsp; " + desc.shapeType

&amp;nbsp;&amp;nbsp;&amp;nbsp; if desc.shapeType == "Polygon":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destLyr=destenationUrlStart+"\\MSURVEY.UPL_POLY"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'polygon'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldAllocation="SNUMBER \"SNUMBER\" true true false 2 Short 0 4 ,First,#,"+lyrSource+",Snumber,-1,-1;ELEMENTS \"ELEMENTS\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",elements,-1,-1;REMARKS \"REMARKS\" true true false 100 Text 0 0 ,First,#,"+lyrSource+",remarks,-1,-1;SSIZE \"SSIZE\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",Ssize,-1,-1;RECOMENDAT \"RECOMENDAT\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",recomendat,-1,-1;GVUL_ATAR \"GVUL_ATAR\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",gvul_atar,-1,-1;PERIOD \"PERIOD\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",period,-1,-1;GPS_DATE \"GPS_DATE\" true true false 36 Date 0 0 ,First,#,"+lyrSource+",Gps_Date,-1,-1;DATAFILE \"DATAFILE\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",Datafile,-1,-1;METHOD_TYP \"METHOD_TYP\" true true false 4 Long 0 8 ,First,#,"+lyrSource+",METHOD_TYP,-1,-1;CRE_METHOD \"CRE_METHOD\" true true false 4 Long 0 8 ,First,#,"+lyrSource+",CRE_METHOD,-1,-1;SURV_ID \"SURV_ID\" true true false 4 Long 0 7 ,First,#,"+lyrSource+",SURV_ID,-1,-1;SHAPE.AREA \"SHAPE.AREA\" false false true 0 Double 0 0 ,First,#;SHAPE.LEN \"SHAPE.LEN\" false false true 0 Double 0 0 ,First,#"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.RepairGeometry_management(lyrSource, "DELETE_NULL")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(lyrSource, "SURV_ID", SURVEY_ID, "PYTHON", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(RepairedArea, destLyr,"NO_TEST",FieldAllocation, "")


&amp;nbsp;&amp;nbsp;&amp;nbsp; elif desc.shapeType=="Point":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destLyr=destenationUrlStart+"MSURVEY.UPL_POINT"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Point'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldAllocation="SNUMBER \"SNUMBER\" true true false 2 Short 0 4 ,First,#,"+lyrSource+",Snumber,-1,-1;ELEMENTS \"ELEMENTS\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",elements,-1,-1;REMARKS \"REMARKS\" true true false 100 Text 0 0 ,First,#,"+lyrSource+",remarks,-1,-1;SSIZE \"SSIZE\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",Ssize,-1,-1;RECOMENDAT \"RECOMENDAT\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",recomendat,-1,-1;GVUL_ATAR \"GVUL_ATAR\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",gvul_atar,-1,-1;PERIOD \"PERIOD\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",period,-1,-1;GPS_DATE \"GPS_DATE\" true true false 36 Date 0 0 ,First,#,"+lyrSource+",Gps_Date,-1,-1;DATAFILE \"DATAFILE\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",Datafile,-1,-1;METHOD_TYP \"METHOD_TYP\" true true false 4 Long 0 8 ,First,#,"+lyrSource+",METHOD_TYP,-1,-1;CRE_METHOD \"CRE_METHOD\" true true false 4 Long 0 8 ,First,#,"+lyrSource+",CRE_METHOD,-1,-1;SURV_ID \"SURV_ID\" true true false 4 Long 0 7 ,First,#,"+lyrSource+",SURV_ID,-1,-1"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(lyrSource, "SURV_ID", SURVEY_ID, "PYTHON", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(lyrSource, destLyr, "NO_TEST",FieldAllocation, "")

&amp;nbsp;&amp;nbsp;&amp;nbsp; elif desc.shapeType=="Polyline":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Polyline'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destLyr=destenationUrlStart+"MSURVEY.UPL_LINE"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldAllocation="SNUMBER \"SNUMBER\" true true false 2 Short 0 4 ,First,#,"+lyrSource+",Snumber,-1,-1;ELEMENTS \"ELEMENTS\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",elements,-1,-1;REMARKS \"REMARKS\" true true false 100 Text 0 0 ,First,#,"+lyrSource+",remarks,-1,-1;SSIZE \"SSIZE\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",Ssize,-1,-1;RECOMENDAT \"RECOMENDAT\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",recomendat,-1,-1;GVUL_ATAR \"GVUL_ATAR\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",gvul_atar,-1,-1;PERIOD \"PERIOD\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",period,-1,-1;GPS_DATE \"GPS_DATE\" true true false 36 Date 0 0 ,First,#,"+lyrSource+",Gps_Date,-1,-1;DATAFILE \"DATAFILE\" true true false 50 Text 0 0 ,First,#,"+lyrSource+",Datafile,-1,-1;METHOD_TYP \"METHOD_TYP\" true true false 4 Long 0 8 ,First,#,"+lyrSource+",METHOD_TYP,-1,-1;CRE_METHOD \"CRE_METHOD\" true true false 4 Long 0 8 ,First,#,"+lyrSource+",CRE_METHOD,-1,-1;SURV_ID \"SURV_ID\" true true false 4 Long 0 7 ,First,#,"+lyrSource+",SURV_ID,-1,-1;SHAPE.LEN \"SHAPE.LEN\" false false true 0 Double 0 0 ,First,#"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(lyrSource, "SURV_ID", SURVEY_ID, "PYTHON", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management(lyrSource, destLyr, "NO_TEST",FieldAllocation, "")




print 'finish'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 08:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453895#M35650</guid>
      <dc:creator>irishadar</dc:creator>
      <dc:date>2013-11-22T08:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 999999 when running python as service</title>
      <link>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453896#M35651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi again ,I've managed to focus on the problem , this is the new script it fails with general error 999999:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

# Script arguments
Expression = arcpy.GetParameterAsText(0)

# Local variables:
area_shp = r"D:\support\iris\area.shp"


# Process: Calculate Field
arcpy.CalculateField_management(area_shp, "SURV_ID", Expression, "PYTHON", "")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;has this happened to anyone ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;iris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:14:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453896#M35651</guid>
      <dc:creator>irishadar</dc:creator>
      <dc:date>2021-12-11T20:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 999999 when running python as service</title>
      <link>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453897#M35652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What is your expression? And why not use an update cursor?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 12:25:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453897#M35652</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-11-25T12:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 999999 when running python as service</title>
      <link>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453898#M35653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi , my expression is long.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and i have already tried to replace with cursor update but it fails in with the same error .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;startUrl ="D:\\AllData\\area.shp"

#arcpy.CalculateField_management(RepairedArea, "SURV_ID", "666", "PYTHON")

rows = arcpy.UpdateCursor(startUrl)
# Update the field used in buffer so the distance is based on the
# road type. Road type is either 1, 2, 3 or 4. Distance is in meters.
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("SURV_ID", 7878)
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)

# Delete cursor and row objects to remove locks on the data
del row
del rows

print 'finish'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:14:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453898#M35653</guid>
      <dc:creator>irishadar</dc:creator>
      <dc:date>2021-12-11T20:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 999999 when running python as service</title>
      <link>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453899#M35654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Check to make sure the field has that exact name and it is the right type.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 15:37:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453899#M35654</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-11-25T15:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR 999999 when running python as service</title>
      <link>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453900#M35655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yes i have&amp;nbsp; it is a match ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the scrip tool is working well under arcmap or arccatalog it is only fails when i publish it as a services .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this is the exact error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error executing tool.: Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "D:\arcgisserver\directories\arcgissystem\arcgisinput\fieldcalc1.GPServer\extracted\v101\my_toolboxes\calc1.py", line 22,in&amp;nbsp; arcpy.CalculateField_management(area_shp, g_ESRI_variable_2, g_ESRI_variable_3, "PYTHON", "") &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "c:\program files\arcgis\server\arcpy\arcpy\management.py", line 3129, in CalculateField raise e ExecuteError: ERROR 999999: Error executing function. General function failure Failed to execute (CalculateField). Failed to execute (fieldcalc1). Failed to execute (fieldcalc1).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 15:54:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-999999-when-running-python-as-service/m-p/453900#M35655</guid>
      <dc:creator>irishadar</dc:creator>
      <dc:date>2013-11-25T15:54:11Z</dc:date>
    </item>
  </channel>
</rss>

