Python crashes after upgrade

1915
5
12-15-2016 06:08 AM
SebastianBosbach
New Contributor III

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

0 Kudos
5 Replies
DuncanHornby
MVP Notable Contributor

How are you running the script, foreground or background? Try running it in foreground.

SebastianBosbach
New Contributor III

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.

0 Kudos
DanPatterson_Retired
MVP Emeritus

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

0 Kudos
SebastianBosbach
New Contributor III

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

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

I have a few more suggestions to try

  • although very old, Digging deeper – Troubleshooting geoprocessing errors when using ArcSDE data | ArcGIS Blog   has some troubleshooting test, including connections etc.
  • there have been a few post in the past few weeks, mainly about upgrading because of 10.5, but worth testing to make sure you still have permissions SDE Upgrade to 10.5: error (-96)    never hurts to check permissions.  I also know that thru a few versions in the past, the software switched between needing the owner of the sde as part of the path, and not wanting it.  I had to change programs a couple times because of that.  But I'm still on 10.3 desktop, and SQL 2008 and SDE 10.2.2 or 10.3 and haven't had to modify my script for a while.
  • as typically is suggested, put in a few print or arcpy.AddMessage statements so you can make sure you variables are all still as expected. 
  • usually when I use

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.

  • have you run thru the process manually, using the ArcMap/Catalog python window, one line at a time (adding statements to print).  That might help you figure out where is it having the issue since you are not getting an error.

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).

0 Kudos