I have created 2 geometric trace models for a project, one to pick a spot on the network and run an isolation, and the other to choose from a list of buildings, then then run a trace to find features to isolate that building. Both models use a python script at the end to combine all outputs from multiple group layers into one out feature class for each participating feature class in the network. Also, both models reference the same MXD file in order to used some arcpy.mapping functions.

I published the network iso model on the server and it runs just fine with no errors both on ArcMap and the WebApp I made on ArcGIS online. When i publish the building iso model, it fails with a "invalid MXD Filename" error. The whole output can be seen below.

enter image description here

Both models uses the exact same script, yet it only fails on the building iso model and not the network iso model. I even tried saving a copy of the MXD as a different name, but still received the same error. the part of the script that is failing can be seen below.

enter image description here

The filepath does not have any special characters in it, and again, works just fine in the other model. Has anyone ran into this problem before? I have been looking around blogs and ESRI resource sites but haven't found anything to help. One odd thing i did notice is that the line the log reports the error occurring on is not the same line number as it is in the original script, but i'm not sure if that means anything.

@KHibma provided help. I found out the script is not copying the MXD file to the server, even though it say it is when publishing. Also, it does not seem to be setting the variables correctly on the server. in the picture below, the script on the left is the network iso, and the right is the building iso.

Why isn't the publishing tools correctly formatting the script from the building iso model?

All the parameters are set the same as in the network iso model.

enter image description here

closed as off-topic by PolyGeo Nov 2 '17 at 5:12

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Can you show the statement it says it is failing on (diff from original script)? – artwork21 Feb 5 '15 at 14:38
  • Do you mean for the network iso script? It is the exactly the same, with the exception of 2 more input parameters. – Lou Feb 5 '15 at 14:44
  • Can you confirm the MXD got copied to the server and is properly being referenced? You'll need to do some manual poking around. On the server, navigate to C:\arcgisserver\directories\arcgissystem\arcgisinput\BuildingShotOff.GPServer\extracted and drill into the folder with the script. At the top of the script, the g_ESRI_variable1 will point to the location of the MXD. Make sure 1) its there and 2) you can open it. – KHibma Feb 5 '15 at 14:47
  • @KHibma It is not. When i publish it, it says it is copying the MXD to the server, but i guess it is not. Can i just change the g_ESRI_variable1 name to the same line as the network iso script and copy the MXD file over as well? – Lou Feb 5 '15 at 14:57
  • and also, why isn't it copying the MXD onto the server? – Lou Feb 5 '15 at 15:09