Any solution to "Runtime error Traceback (most recent call last): File" <string> ""

1366
5
10-24-2012 02:12 AM
GualbertoHernández_Juárez
New Contributor
Friends,

I am using the following code ArcMap version 10.1, only I found the following error, I hope to guide me to give solution.

Runtime error  Traceback (most recent call last):   File "<string>", line 48, in <module>   File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 11034, in CopyRaster     raise e ExecuteError: ERROR 001143: Background server threw an exception.



>>> import arcpy
import glob, os


#*********** PRINCIPALES VARIABLES *************
prefijo = "sde.SDE."
Nommosaico = "mostest8"
variable = "pslv"


outLoc = "C:/IIE_Datos/Prediccion/Ejemplomosaico/test.mdb/"
inNetCDF = "C:/IIE_Datos/Prediccion/Ejemplomosaico/MMOUT_DOMAIN1.nc"

# Process: Create Mosaic Dataset
arcpy.CreateMosaicDataset_management(outLoc, Nommosaico, "PROJCS['Lambert_Conformal_Conic',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',-27.0],PARAMETER['Central_Meridian',-124.17],PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Standard_Parallel_2',0.0],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Kilometer',1000.0]];-20037.7 -30225.3 149134210447.956;1 1;1 1;0.000001;2;2;IsHighPrecision", "", "")

variable = "pslv"

nc_FP = arcpy.NetCDFFileProperties(inNetCDF)
nc_Dim = nc_FP.getDimensions()

test = outLoc + '/*'
r = glob.glob(test)
for i in r:
   os.remove(i)

for dimension in nc_Dim:

    top = nc_FP.getDimensionSize(dimension)

    for i in range(0, top):

        if dimension == "time":

            dimension_values = nc_FP.getDimensionValue(dimension, i)
            daat = "time '"+str(dimension_values)+ "'"
            print daat
            
            #nowFile = str(dimension_values)
            nowFile = str(i)
            testt = dimension_values.replace("/","").replace(":","").replace(".","").replace("'","").replace(' ','')
            print testt
            rast = "time" + nowFile
            #print rast
            
            # this will convert the FIRST time step in your netCDF file to a raster layer
            arcpy.MakeNetCDFRasterLayer_md(inNetCDF, variable, "lon", "lat", testt, "", daat, "BY_VALUE")
            arcpy.CopyRaster_management(testt, outLoc + rast, "", "", "", "NONE", "NONE", "")


            # Local variables:
            Build_Raster_Pyramids = "true"
            Calculate_Statistics = "true"

            # Process: Add Rasters To Mosaic Dataset
            arcpy.AddRastersToMosaicDataset_management(outLoc + Nommosaico, "Raster Dataset", outLoc + rast, "UPDATE_CELL_SIZES", "NO_BOUNDARY", "NO_OVERVIEWS", "", "0", "1500", "", "", "SUBFOLDERS", "ALLOW_DUPLICATES", Build_Raster_Pyramids, Calculate_Statistics, "NO_THUMBNAILS", "")


    
            # print dimension_values
            
time '28/08/2012 12:00:00'
28082012120000
time '28/08/2012 12:00:03'
28082012120003
time '28/08/2012 12:00:06'
28082012120006
time '28/08/2012 12:00:09'
28082012120009
time '28/08/2012 12:00:12'
28082012120012
time '28/08/2012 12:00:15'
28082012120015
time '28/08/2012 12:00:18'
28082012120018
time '28/08/2012 12:00:21'
28082012120021
time '28/08/2012 12:00:24'
28082012120024
time '28/08/2012 12:00:27'
28082012120027
time '28/08/2012 12:00:30'
28082012120030
time '28/08/2012 12:00:33'
28082012120033
time '28/08/2012 12:00:36'
28082012120036
time '28/08/2012 12:00:39'
28082012120039
time '28/08/2012 12:00:42'
28082012120042
time '28/08/2012 12:00:45'
28082012120045
time '28/08/2012 12:00:48'
28082012120048
time '28/08/2012 12:00:51'
28082012120051
time '28/08/2012 12:00:54'
28082012120054
time '28/08/2012 12:00:57'
28082012120057
time '28/08/2012 12:01:00'
28082012120100
time '28/08/2012 12:01:03'
28082012120103
time '28/08/2012 12:01:06'
28082012120106
time '28/08/2012 12:01:09'
28082012120109
time '28/08/2012 12:01:12'
28082012120112
time '28/08/2012 12:01:15'
28082012120115
time '28/08/2012 12:01:18'
28082012120118
time '28/08/2012 12:01:21'
28082012120121
time '28/08/2012 12:01:24'
28082012120124
time '28/08/2012 12:01:27'
28082012120127
time '28/08/2012 12:01:30'
28082012120130
time '28/08/2012 12:01:33'
28082012120133
time '28/08/2012 12:01:36'
28082012120136
Runtime error  Traceback (most recent call last):   File "<string>", line 48, in <module>   File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 11034, in CopyRaster     raise e ExecuteError: ERROR 001143: Background server threw an exception.  
Tags (2)
0 Kudos
5 Replies
SeanRedar
New Contributor III
I am getting the same problem with this script.  Smells buggy.

Win 7 64-bit v10.1

import arcpy
from arcpy import env
env.compression = "JPEG 75"
env.workspace = "D:\\Tiles"

indir = "D:\\Tiles"
outdir = "D:\\TilesOut"

rasterlist = arcpy.ListRasters("*", "ALL")
for raster in rasterlist:
    inras = indir + "\\" + raster
    print "In image " + inras
    outras = outdir + "\\" + raster
    arcpy.CopyRaster_management(inras,outras,"#","#","256","NONE","NONE","8_BIT_UNSIGNED","NONE","NONE")
    print "Out image " + outras
    break
0 Kudos
Govinda_DeekshituluArchakam
New Contributor
Hi, i am also getting the same problem in python script for below geoprocessing (AddCodedValueToDomain) tool. I am using Win7 64bit arcgis10.1, any help would highly appreciated. Thankyou.

>>> import arcpy
>>> arcpy.AddCodedValueToDomain_management(r'Database Connections\AppendTestBed.sde',"dm_Scale","110","1:2500")
Runtime error
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 1210, in AddCodedValueToDomain
    raise e
AttributeError: Object: Tool or environment <AddCodedValueToDomain_management> not found
0 Kudos
curtvprice
MVP Esteemed Contributor

28082012120133
time '28/08/2012 12:01:36'
28082012120136
Runtime error  Traceback (most recent call last):   File "<string>", line 48, in <module>   File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 11034, in CopyRaster     raise e ExecuteError: ERROR 001143: Background server threw an exception. 



Your output location is a personal geodatabase. Have you consider writing to a file geodatabase, which doesn't have a 2GB size limit? My guess is you're hitting the limit. (didn't see this is months ago, but probably good to add this to the thread anyway!).
0 Kudos
MatejTacer
New Contributor III
Hi,
I was getting the same error: 00143: Background server threw an exception while overlaying linear route events (Overlay Route Events). The problem was caused by the null values in some "from" and "to" fields.
Fixing the data solved the problem in my case.
0 Kudos
SukhdorjGanbaatar
New Contributor
Hello,

I am not sure if your input raster names are correct. The variable testt has some 28082012120000 value, it sould be a path to raster file. And second thing is you are trying to CopyRaster to all printed times to mdb database.

Friends,

I am using the following code ArcMap version 10.1, only I found the following error, I hope to guide me to give solution.

Runtime error  Traceback (most recent call last):   File "<string>", line 48, in <module>   File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 11034, in CopyRaster     raise e ExecuteError: ERROR 001143: Background server threw an exception.



>>> import arcpy
import glob, os


#*********** PRINCIPALES VARIABLES *************
prefijo = "sde.SDE."
Nommosaico = "mostest8"
variable = "pslv"


outLoc = "C:/IIE_Datos/Prediccion/Ejemplomosaico/test.mdb/"
inNetCDF = "C:/IIE_Datos/Prediccion/Ejemplomosaico/MMOUT_DOMAIN1.nc"

# Process: Create Mosaic Dataset
arcpy.CreateMosaicDataset_management(outLoc, Nommosaico, "PROJCS['Lambert_Conformal_Conic',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',-27.0],PARAMETER['Central_Meridian',-124.17],PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Standard_Parallel_2',0.0],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Kilometer',1000.0]];-20037.7 -30225.3 149134210447.956;1 1;1 1;0.000001;2;2;IsHighPrecision", "", "")

variable = "pslv"

nc_FP = arcpy.NetCDFFileProperties(inNetCDF)
nc_Dim = nc_FP.getDimensions()

test = outLoc + '/*'
r = glob.glob(test)
for i in r:
   os.remove(i)

for dimension in nc_Dim:

    top = nc_FP.getDimensionSize(dimension)

    for i in range(0, top):

        if dimension == "time":

            dimension_values = nc_FP.getDimensionValue(dimension, i)
            daat = "time '"+str(dimension_values)+ "'"
            print daat
            
            #nowFile = str(dimension_values)
            nowFile = str(i)
            testt = dimension_values.replace("/","").replace(":","").replace(".","").replace("'","").replace(' ','')
            print testt
            rast = "time" + nowFile
            #print rast
            
            # this will convert the FIRST time step in your netCDF file to a raster layer
            arcpy.MakeNetCDFRasterLayer_md(inNetCDF, variable, "lon", "lat", testt, "", daat, "BY_VALUE")
            arcpy.CopyRaster_management(testt, outLoc + rast, "", "", "", "NONE", "NONE", "")


            # Local variables:
            Build_Raster_Pyramids = "true"
            Calculate_Statistics = "true"

            # Process: Add Rasters To Mosaic Dataset
            arcpy.AddRastersToMosaicDataset_management(outLoc + Nommosaico, "Raster Dataset", outLoc + rast, "UPDATE_CELL_SIZES", "NO_BOUNDARY", "NO_OVERVIEWS", "", "0", "1500", "", "", "SUBFOLDERS", "ALLOW_DUPLICATES", Build_Raster_Pyramids, Calculate_Statistics, "NO_THUMBNAILS", "")


    
            # print dimension_values
            
time '28/08/2012 12:00:00'
28082012120000
time '28/08/2012 12:00:03'
28082012120003
time '28/08/2012 12:00:06'
28082012120006
time '28/08/2012 12:00:09'
28082012120009
time '28/08/2012 12:00:12'
28082012120012
time '28/08/2012 12:00:15'
28082012120015
time '28/08/2012 12:00:18'
28082012120018
time '28/08/2012 12:00:21'
28082012120021
time '28/08/2012 12:00:24'
28082012120024
time '28/08/2012 12:00:27'
28082012120027
time '28/08/2012 12:00:30'
28082012120030
time '28/08/2012 12:00:33'
28082012120033
time '28/08/2012 12:00:36'
28082012120036
time '28/08/2012 12:00:39'
28082012120039
time '28/08/2012 12:00:42'
28082012120042
time '28/08/2012 12:00:45'
28082012120045
time '28/08/2012 12:00:48'
28082012120048
time '28/08/2012 12:00:51'
28082012120051
time '28/08/2012 12:00:54'
28082012120054
time '28/08/2012 12:00:57'
28082012120057
time '28/08/2012 12:01:00'
28082012120100
time '28/08/2012 12:01:03'
28082012120103
time '28/08/2012 12:01:06'
28082012120106
time '28/08/2012 12:01:09'
28082012120109
time '28/08/2012 12:01:12'
28082012120112
time '28/08/2012 12:01:15'
28082012120115
time '28/08/2012 12:01:18'
28082012120118
time '28/08/2012 12:01:21'
28082012120121
time '28/08/2012 12:01:24'
28082012120124
time '28/08/2012 12:01:27'
28082012120127
time '28/08/2012 12:01:30'
28082012120130
time '28/08/2012 12:01:33'
28082012120133
time '28/08/2012 12:01:36'
28082012120136
Runtime error  Traceback (most recent call last):   File "<string>", line 48, in <module>   File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 11034, in CopyRaster     raise e ExecuteError: ERROR 001143: Background server threw an exception.  
0 Kudos