Select to view content in your preferred language

How to fix Broken Model

10302
12
04-15-2013 05:07 PM
BilalHossain
Deactivated User
Hi Fellow
I have developed a model (using model builder, ArcGIS 10) for spatial analysis of my project. The model was quite big and took me 3 days to develop. Every time I add a new tool/process in the model I save it to avoid loosing any work. I was about to finish the model and save it but it did not save, showed a message "failed to save the model", even did not permit to copy the model. Eventually I close it without saving & compromising that I will only lose very last process. But once I close it I saw a red cross mark on my model. I opened it in the edit mode but there is no work at all. I searched into the forum but could not find any solution to repair this. I had a look through the article to repair the broken model (http://resources.arcgis.com/en/help/main/10.1/index.html#//002w00000018000000). It says how to fix the broken tool but does not mention to fix broken model.

Any solution would be appreciated.


Thanks in advance

Bilal
0 Kudos
12 Replies
markdenil
Frequent Contributor
I don't think this one can be fixed, but in the future you may want to export to a python script.
'Saving' a model is not really like saving a file.
The scripts Model Bulider writes are ugly as sin, but at least you get a transcription of the model.
0 Kudos
MarkBoucher
Honored Contributor
If the model is exported to script, can it be imported back in to recreate the model?
0 Kudos
GraemeBrowning
Frequent Contributor
I saw the exact same "Failed to save the model" message a couple times a few days ago and then about 10 times today.  I was using ArcGIS for Desktop 10.1 SP1 with a model of 200-300 elements in a toolbox with 50+ tools organised into six toolsets.

It is an extremely frustrating situation because today ModelBuilder sometimes said that it had failed to save, but actually did, and exited cleanly.  At other times it seems to save, but then when I close ModelBuilder it asks me whether I want to save, and then choosing either yes or no results in the model being empty (except for one label!) when it is next opened.  I have had to resort to making copies of the model every time I make a modification or two.

Realistically, saving to a Python script as a backup is not a viable option for anything but the most trivial models.
0 Kudos
JohnGargiulo
Occasional Contributor

I can't believe ESRI has no solution to this problem.  It has happened to me multiple times and I have lost a large amount of work time due to this issue.

0 Kudos
MarkBoucher
Honored Contributor

I've had Arc Map crash in the middle of editing a model (very frustrating). I've never tried to recover a model that crashed. I hope you can find a solution!

I've seen the "can't save" message before. I don't recall it not saving and not giving me any other option. I use the "save as" command under the "Model" menu in Model Builder. This lets me save a copy of the model under another name. Then I close down, start up, delete the old model, and rename the newly saved model.

So much time and $ goes into these things, that it is real letdown to loose the work. On a big model, it would make sense to save a backup copy once in a while.

I'm not certain, (and only ESRI knows), but I think the occasional problem with saving has to do with the file locks. Somehow the temporary file locks (write permissions) get mixed up and the program thinks you are trying to save the file someone else has open. I've had this happen on models as well as MXDs. I find that with the ESRI products one has to assume there are inherent file instability and management issues that warrant caution and prudence to reduce file losses: backup at milestones, save often, pray, etc.

0 Kudos
GrahamW
Frequent Contributor

This is so frustrating!!!

I'm now in my 3rd strike of this issue over this one project.. I've now lost about a days work and about as much trying to recover the model..

I've noticed some strange behaviours that indicate that the ship is about to sink. my Save as/ Add Data dialogue has no more content in folder connections etc. This gives you a last chance to expand the window to both monitors and print screen the entire model to paint to capture the logic/changes.

I've also learnt to version my work regularly.. ie when I'm about to embark on major changes to my model I copy and version.

I've now seen this behaviour in personal databases and .tbx files... and the repair geodatabase method in arcpy won't repair models..

0 Kudos
GraemeBrowning
Frequent Contributor

It may be little comfort, but my recommendation, so as not to find yourself at the mercy of ModelBuilder, is to minimize the role of ModelBuilder and progressively replace your models with Python script tools written using ArcPy.

0 Kudos
GrahamW
Frequent Contributor

Completely Agree!

I made the decision to Use Model Builder fro this project so that I could explain the logic to the "users". The model Is now getting pretty big as the what if decisions keep getting made.. It now has 7 Network Analyst service areas. and uses in_memory workspace for most intermediate data.. If this rebuild fails I'm going to export it and code the rest via arcpy.

0 Kudos
GraemeBrowning
Frequent Contributor

I made the decision to use ModelBuilder for a large project for precisely the same reason i.e. to graphically document the process.  That application now uses a mixture of ModelBuilder and ArcPy/Python and my intention is to retain the overall workflow as an over-arching model (to keep the process visual and easy to explain) and to have everything under each "building block" be ArcPy/Python code.  If you are planning to export a large model to Python script you may find that it results in difficult to read code (that is difficult to debug) due to the way it names its variables, and if there is iteration then code that won't work.  My approach is to use Copy As Python Snippet to re-build models as ArcPy/Python script tools instead.

0 Kudos