Feature Class suddenly became corrupt when Join Field tool failed

11-19-2018 12:44 PM
New Contributor III

In ArcGIS Desktop 10.2, I used arcpy code in the Python interpreter to run the arcpy.JoinField_management tool, to join 2 fields from another table.  For no apparent reason, the tool failed with the error "General Function Failure." 

But this is the really weird part: Exactly as that happened, I was watching the attribute table of the target feature class which I had open, and I saw all the records vanish!  Suddenly ArcMap was no longer able to draw that layer.  I still see the feature class in the catalog, but I can't add it to a new map, view its properties, or do anything with it now.  When I try to add it to a new map, I get "error opening feature class." This is mind boggling.  I tried closing and restarting ArcMap, but that didn't help.  Anyone know why this would happen or how to get my data back?  I may just have to look for a backup version of the data...

0 Kudos
5 Replies
MVP Esteemed Contributor

I may just have to look for a backup version of the data...

Probably your best bet...

That should just about do it....
0 Kudos
MVP Legendary Contributor

10.2 isn't even on support any longer.  I suspect you will have to see if that particular issue was ever reported

Esri Support Home 

If there was a workaround or what version it was 'fixed' would be noted.

I suspect that you will need a backup in the interim

0 Kudos
Occasional Contributor II

I have this exact same problem. Running 10.5.1. It has only started occurring since we moved our servers to Azure.  Once the join is done, the dataset that is corrupted has a modified date of 01/01/1970 00:00:00

0 Kudos
Esri Contributor

Matthew- Check to see if you can find a backup of the feature class, make a copy, and test the join again to determine if you can reproduce the behavior. Please log a tech support case with the data for review.

Halil Siddique‌ - Is your feature class in an enterprise geodatabase (Azure SQL Database)? Is the behavior reproducible with the same feature class in a file geodatabase? Please log a tech support case for the behavior to be reviewed.

0 Kudos
Occasional Contributor

Glad I found this thread. Our organization seems to have encountered the same issue as the OP and others have posted; we've discovered that the Join Field tool in arcpy corrupts the input feature class.

Just as some background, we had a script on a server that would run nightly via task scheduler. It would take a polygon feature class and join it to records from a standalone table to populate a feature class on our SDE and a map service (note we are running 10.4.1 and have SQL as RDBMS). The script had been in place for at least a couple of years running smoothly, however, sometime in early November of this year it was failing during the join step.

After reviewing the error log we set up, a colleague and I attempted to troubleshoot. We spent a good amount of time trying to figure out why it was failing but were coming up dry. It was driving us crazy because nothing had changed on the code end; it just stopped working. After looking at the intermediate output data (we had a scratch GDB set up to see what was going on), we encountered an error on the staging join feature class.



We couldn't open it up in ArcMap/Pro, view properties, nor could arcpy delete it ... it became corrupt. Personally, I had a suspicion that it may have been due to security updates that were installed on the server where the script resides. But I honestly don't really have a way to prove that besides timestamps when this script started failing and when updates were installed.

We needed to find a workaround. Basically we modified the code to use Add Join and the in_memory workspace in place of Join Field. While it did indeed at some lines of code to our script, overall, it's been good in the sense that we went from a task that took an hour and 15 minutes to run, to a task that only takes roughly 10 minutes to complete. So at least something positive came out of the issues we were having. Overall, it was just highly annoying when you expect a tool to work, and it does for an extended period of time, but fails suddenly without any rhyme or reason.

0 Kudos