Hi everyone,
we upgraded our ArcGIS Server from 10.2 to 10.4 and since then, python crashes when I'm using featureClassToFeatureClass method.
My Script worked with no problem on 10.2 but after upgrading to 10.4 python crashes.
I don't get an error massage, the python exe just stops working.
In the windows report I can see that the GdbCore.dll is causing the problem.
My script writes features from a SQL database to a gdb. But when it reaches the FeatureClassToFeatureClass_conversion method python completely crashes. Below you can find a code example.
# Import modules
import sys
import os
import datetime
import shutil
import arcpy# Local variables:
country = sys.argv[1]
exportPath = sys.argv[2]
dateString = datetime.datetime.now().date().strftime("%Y%m%d")
TEST_BASE_dbo_STOPPS = sys.argv[3] + "/TEST_BASE.dbo.View_STOPPS_EXPORT"EXPORTED_DATA_gdb = exportPath + country + "_TOUREDITOR_" + dateString + ".gdb"
whereClause = "COUNTRY = '" + country + "'"
# delete old DataBase
if os.path.isdir(EXPORTED_DATA_gdb):
shutil.rmtree(EXPORTED_DATA_gdb)# create new DataBase
arcpy.CreateFileGDB_management(exportPath, country + "_TOUREDITOR_" + dateString + ".gdb")# Process: Feature Class to Feature Class
print "Starting STOPPS Export..."
arcpy.FeatureClassToFeatureClass_conversion(TEST_BASE_dbo_STOPPS, EXPORTED_DATA_gdb, "STOPPS_" + dateString, whereClause)
Does anyone know how to fix this error?
kind regards
Sebastian
How are you running the script, foreground or background? Try running it in foreground.
Hi, it crashes even if I run it in foreground and with admin privileges.
PS: I forgot to mention that other scripts wich are not using "FeatureClassToFeatureClass_conversion" are running fine.
standalone python script? which IDE?
and that bug has been seen before with 10.4
with no resolution nor mention in the changes... so contact tech support or keep upgrading to the newest and latest
https://community.esri.com/message/620612?commentID=620612#comment-620612
and hope the problem goes away
Thanks for your response, but as you can expect this was not the answer I was hoping for.
What other way would you suggest to automatically copy features from a sql view to a gdb?
Thanks,
Sebastian
I have a few more suggestions to try
arcpy.CreateFileGDB_management (outputPath, updateFGDBRoot)
I don't include the .gdb in the out file name. It should already know it will need a .gdb extension.
Personally, I would start with the last suggestion first if I was trying to debug things. Hard to know what to fix if you don't have an error message (or find you are maybe returning zero records or some other non-error error).