Select to view content in your preferred language

Python script crashes ArcMap 10.4.1 unpredictably

1158
3
09-26-2019 04:27 PM
GeorgeRiner
Occasional Contributor

We have a python tool/script (not an add-in) that usually runs fine, but at unpredictable times, it causes ArcMap to crash with the box that asks if you want to send the crash report to ESRI. I've been instructing people to say 'yes' to this box.  And then they restart ArcMap, re-run the tool with the same inputs and it runs fine.

So, how do I find out what is in those crash reports sent to ESRI? We've probably sent in almost 100 of them in the last several months - seems like a useless exercise to me as it provides no information about what went wrong.

Secondly, assuming something is going sideways in the python script - I can't debug this if I can't trap the crash.  The tool crashes the entire ArcMap process and any python process running with it. Anybody got any ideas on how to debug this?

0 Kudos
3 Replies
DanPatterson_Retired
MVP Emeritus

Your best bet would be to contact Tech Support after you send a crash report.  They will be able to link you to the reports and try to work through the problem.  It would be prudent to backup your data/environment at the time of the crash in case it is needed for testing.

KoryKramer
Esri Community Moderator

Dan's right, that if you need immediate assistance with an issue like this, technical support is the best avenue.  Here is more about how the error reporting process works: ArcGIS Desktop Error Reporter Learns Its Manners 

In a nutshell, you would get a response if there is a high confidence fix that exists in a patch or current software release.  Unfortunately, that probably means that there isn't a sure, known, tested, verified, etc. fix for the crashes you're seeing. 

If you click Learn more about error reports:

it provides an explanation about what to expect: Error reporting for ArcGIS Desktop software—Help | ArcGIS Desktop 

Since you note you're on 10.4.1, is there any way to upgrade to 10.7.1 and try there?

0 Kudos
BryanMuch
New Contributor

Kory:

Thanks for the tips.

We are in the process of moving to 10.7.x in the next few weeks, I'll see what happens with the tool then.

Unfortunately, Dan's suggestion to backup the data so that ESRI can test is understandable, but very difficult to do. The particular behavior of the problem suggests that it's a condition getting unknowingly setup at the user (client) session. The actual data being read resides on an actively used MS-SQL 2016 server with multiple users and making backup copies before each run of this particular tool (we use it a lot) is pretty difficult.  Secondly, it's essentially HIPAA-level confidential data and I'd have to go through the tedious process of anonymizing the data in order to send to ESRI. And that process itself could change the nature of any data-related problem causes.

The tool runs in the ArcMap context and is only reading data. We use it to read data from 'plain' (non-spatial) SQL database and compare it to the corresponding features in a spatial enterprise geodatabase. It then generates a report in Excel, highlighting the values that need to be checked or where spatial features are missing altogether. (and conversely where spatial features do exist but should not)

One of my concerns is that it's using the python module 'pymssql' to access the non-spatial database, and I'm getting the impression recently that I should probably be using 'pyodbc' instead.  pyodbc seems to be getting more attention recently and may be a more solid python interface to a SQL server.

Another noticeable feature of this problem is that it only started appearing on the user workstations that were upgraded from Windows 7 to Windows 10. (while remaining with ArcMap 10.4.1) But that doesn't tell me what or where to start looking for a problem.

I'll be testing ArcMap 10.7.x soon. And I am considering inserting intensive logging output in the python code so that I may be able to at least narrow down where the problem is occurring.

:George

0 Kudos