marty53

Arcpy on linux AGS 10.1 TabletoTable "warning empty output generated"

Discussion created by marty53 on Jan 2, 2013
Hi there, I have a script that is running fine on local machine (ArcGIS 10.1 SP1), but when I copy the script to my arcGIS server 10.1 SP1 for linux (ubuntu) where it was designed to run I'm getting an error.  I understand and have read about the paths getting reformmated to windows paths, but I have made an effort to write the script to work with this.   I'm getting an error message after running "TableToTable":  "WARNING 000117: Warning empty output generated."  Thus the last two arcpy gp tools are running on an empty table.  The general workflow is:

CSV to fGdb table >
makeXYeventlayer >
project event layer to feature class

Here is my script:

import sys
import os
import string
import arcpy

#root path variable
rootpath = os.path.dirname(os.path.abspath(__file__))
gdb_path = rootpath + "/NWISSites.gdb"

#set arcpy workspace
arcpy.env.workspace = gdb_path

#arcpy stuff
try:
 #copy CSV to fgdb table
 print "  Copying CSV to fgdb table..."
 if arcpy.Exists(gdb_path + "/sitelist"):
  arcpy.Delete_management(gdb_path + "/sitelist")  
 tableToTableResult = arcpy.TableToTable_conversion(rootpath + "/sitelist.csv", gdb_path, "sitelist")
 print tableToTableResult.getMessages()

 #create event layer from site file csv
 print "  Creating event layer..."
 if arcpy.Exists("nwis_sites"):
  arcpy.Delete_management("nwis_sites") 
 eventLayerResult = arcpy.MakeXYEventLayer_management(gdb_path + "/sitelist", "site_lng", "site_lat", "nwis_sites",rootpath + "/wgs1984.prj","")
 print eventLayerResult.getMessages()
 
 #delete existing feature class if it exists
 if arcpy.Exists(gdb_path + "/all_sites"):
  #backup existing
  print "  Backing up existing features..."
  arcpy.CopyFeatures_management(gdb_path + "/all_sites", gdb_path + "/all_sites_backup")
  arcpy.Delete_management(gdb_path + "/all_sites")
  
 #project event layer points to web mercator
 print "  Projecting feature class..."
 projectFeaturesResult = arcpy.Project_management("nwis_sites", gdb_path + "/all_sites", rootpath + "/webmerc.prj")
 print projectFeaturesResult.getMessages()
 
except Exception, e:
 # If an error occurred, print line number and error message
 tb = sys.exc_info()[2]
 print "Failed at step 1 \n" "Line %i" % tb.tb_lineno
 print e.message


Successful output running on Windows, ArcGIS Desktop 10.1 SP1:
   Copying CSV to fgdb table...
Executing: TableToTable C:\NYBackup\NWIS_mapper\test/sitelist.csv C:\NYBackup\NWIS_mapper\test/NWISSites.gdb sitelist # "site_no "site_no" true true false 255 Text 0 0 ,First,#,C:\NYBackup\NWIS_mapper\test/sitelist.csv,site_no,-1,-1;site_name "site_name" true true false 255 Text 0 0 ,First,#,C:\NYBackup\NWIS_mapper\test/sitelist.csv,site_name,-1,-1;site_cat "site_cat" true true false 255 Text 0 0 ,First,#,C:\NYBackup\NWIS_mapper\test/sitelist.csv,site_cat,-1,-1;site_agc "site_agc" true true false 255 Text 0 0 ,First,#,C:\NYBackup\NWIS_mapper\test/sitelist.csv,site_agc,-1,-1;site_status "site_status" true true false 255 Text 0 0 ,First,#,C:\NYBackup\NWIS_mapper\test/sitelist.csv,site_status,-1,-1;site_lng "site_lng" true true false 8 Double 0 0 ,First,#,C:\NYBackup\NWIS_mapper\test/sitelist.csv,site_lng,-1,-1;site_lat "site_lat" true true false 8 Double 0 0 ,First,#,C:\NYBackup\NWIS_mapper\test/sitelist.csv,site_lat,-1,-1" #
Start Time: Wed Jan 02 19:28:57 2013
Succeeded at Wed Jan 02 19:30:29 2013 (Elapsed Time: 1 minutes 32 seconds)
  Creating event layer...
Executing: MakeXYEventLayer C:\NYBackup\NWIS_mapper\test/NWISSites.gdb/sitelist site_lng site_lat nwis_sites "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision" #
Start Time: Wed Jan 02 19:03:58 2013
Succeeded at Wed Jan 02 19:04:09 2013 (Elapsed Time: 11.00 seconds)
  Projecting feature class...
Executing: Project nwis_sites C:\NYBackup\NWIS_mapper\test\NWISSites.gdb\all_sites PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_Sphere_Type',0.0],UNIT['Meter',1.0]] # GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]
Start Time: Wed Jan 02 19:04:12 2013
Succeeded at Wed Jan 02 19:06:37 2013 (Elapsed Time: 2 minutes 25 seconds)


Here is the failed output on the linux ArcGIS for Server 10.1 SP1, same exact folder and input CSV copied over to linux.  File permissions should be an issue since all files are owned by the "arcgis" user:
 Copying CSV to fgdb table...
Executing: TableToTable Z:\gisdata\data\NWIS\python\sitelist.csv Z:\gisdata\data\NWIS\python\NWISSites.gdb sitelist # "site_no "site_no" true true false 255 Text 0 0 ,First,#,Z:\gisdata\data\NWIS\python\sitelist.csv,site_no,-1,-1;site_name "site_name" true true false 255 Text 0 0 ,First,#,Z:\gisdata\data\NWIS\python\sitelist.csv,site_name,-1,-1;site_cat "site_cat" true true false 255 Text 0 0 ,First,#,Z:\gisdata\data\NWIS\python\sitelist.csv,site_cat,-1,-1;site_agc "site_agc" true true false 255 Text 0 0 ,First,#,Z:\gisdata\data\NWIS\python\sitelist.csv,site_agc,-1,-1;site_status "site_status" true true false 255 Text 0 0 ,First,#,Z:\gisdata\data\NWIS\python\sitelist.csv,site_status,-1,-1;site_lng "site_lng" true true false 8 Double 0 0 ,First,#,Z:\gisdata\data\NWIS\python\sitelist.csv,site_lng,-1,-1;site_lat "site_lat" true true false 8 Double 0 0 ,First,#,Z:\gisdata\data\NWIS\python\sitelist.csv,site_lat,-1,-1" #
Start Time: Wed Jan  2 19:06:27 2013
WARNING 000117: Warning empty output generated.
Succeeded at Wed Jan  2 19:08:00 2013 (Elapsed Time: 1 minutes 33 seconds)
  Creating event layer...
Executing: MakeXYEventLayer Z:\gisdata\data\NWIS\python/NWISSites.gdb/sitelist site_lng site_lat nwis_sites "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision" #
Start Time: Wed Jan  2 19:08:00 2013
Succeeded at Wed Jan  2 19:08:01 2013 (Elapsed Time: 1.00 seconds)
  Projecting feature class...
Executing: Project nwis_sites Z:\gisdata\data\NWIS\python\NWISSites.gdb\all_sites PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_Sphere_Type',0.0],UNIT['Meter',1.0]] # GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]
Start Time: Wed Jan  2 19:08:06 2013
Succeeded at Wed Jan  2 19:08:07 2013 (Elapsed Time: 1.00 seconds)


Thanks for any help

Outcomes