birdface

ERROR 999999 when running python as service

Discussion created by birdface on Nov 22, 2013
Latest reply on Nov 25, 2013 by birdface
hi all,

the code below runs ok from ArcCatalog,

but once i publish it it fail with error  :

Traceback (most recent call last): 
File "D:\arcgisserver\directories\arcgissystem\arcgisinput\UploadeS.GPServer\extracted\v101\my_toolboxes\UPLOADER.py", line 55,
in  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)."


it is allso works if i use only "appand"

any one notice what is worng?!!!

# 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:
    lyrSource=startUrl+lyr+EndUrl
    
    print '1'
    desc=arcpy.Describe(lyrSource)
    #print "Feature Type:  " + desc.shapeType

    if desc.shapeType == "Polygon":
        destLyr=destenationUrlStart+"\\MSURVEY.UPL_POLY"
        print 'polygon'
        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,#"
        #arcpy.RepairGeometry_management(lyrSource, "DELETE_NULL")
        arcpy.CalculateField_management(lyrSource, "SURV_ID", SURVEY_ID, "PYTHON", "")
        arcpy.Append_management(RepairedArea, destLyr,"NO_TEST",FieldAllocation, "")


    elif desc.shapeType=="Point":
        destLyr=destenationUrlStart+"MSURVEY.UPL_POINT"
        print 'Point'
        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"
        arcpy.CalculateField_management(lyrSource, "SURV_ID", SURVEY_ID, "PYTHON", "")
        arcpy.Append_management(lyrSource, destLyr, "NO_TEST",FieldAllocation, "")

    elif desc.shapeType=="Polyline":
        print 'Polyline'
        destLyr=destenationUrlStart+"MSURVEY.UPL_LINE"
        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,#"
        arcpy.CalculateField_management(lyrSource, "SURV_ID", SURVEY_ID, "PYTHON", "")
        arcpy.Append_management(lyrSource, destLyr, "NO_TEST",FieldAllocation, "")




print 'finish'

Outcomes