Missing Xref in Xref problem

[code][16:44:46] : >Job Submission Started…
[16:44:46] : >BatchName: []
[16:44:46] : >Saving Scene To Backup File Before Merging XRefs…
[16:44:46] : --FAILED To Merge MISSING Scene XRef File 1 [C:\Users\oleg\Documents\3dsMax\scenes\ctest.max]
[16:44:46] : >Checking For Missing External Files…
[16:44:46] : +State Sets Dialog Closed.
[16:44:46] : +Closed Material Editor…
[16:44:46] : +Cleared Material Editor…
[16:44:46] : >Purifying the Render Elements Names…
[16:44:46] : >Submitting 3dsmax Render Job to Local Repository…
[16:44:46] : >Saving Scene For Submission to [C:\Users\oleg\AppData\Local\Thinkbox\Deadline7\temp\26_10_2015_16_44_46\xrtest.max]
[16:44:46] : >Initiating Regular Job Submission…
[16:44:46] : >Submitting All Frames In One Job…
[16:44:46] : >Region Mode: none | Assembler Mode: DRAFT
[16:44:46] : Command Line Arguments: [-outputfiles
C:\Users\oleg\AppData\Local\Thinkbox\Deadline7\temp\26_10_2015_16_44_46\submitOutput.txt
C:\Users\oleg\AppData\Local\Thinkbox\Deadline7\temp\26_10_2015_16_44_46\submitExitCode.txt
C:\Users\oleg\AppData\Local\Thinkbox\Deadline7\temp\26_10_2015_16_44_46\max_submit_info.job
C:\Users\oleg\AppData\Local\Thinkbox\Deadline7\temp\26_10_2015_16_44_46\max_job_info.job
C:\Users\oleg\AppData\Local\Thinkbox\Deadline7\temp\26_10_2015_16_44_46\xrtest.max
\nas003\Resources\SCRIPTS\UNC_Converter.ms
]

[16:44:48] : >Restoring Original Scene From Backup File…
[16:44:48] : +Restored the Material Editor Samples…
[16:44:48] : ==JOB [ xrtest ] SUBMISSION MESSAGE START======================================================================================
[16:44:48] : +JOB SUBMITTED SUCCESSFULLY.
[/code]

Did not find any line about disabling or something like that. It also says that there is a non-fatal error and looks like that’s the one.
And it is not rendering , giving this error :

Error: RenderTask: Unexpected exception (Exception caught in 3ds max: -- Runtime error: File not found: "C:\Users\oleg\Documents\3dsMax\scenes\ctest.max"

I renamed that file on purpose so it will be missing.
I also checked auxiliary .max file and record is there , but it is disabled.
Will try the line you are suggesting, thanks.

Update : Tried to add that line - does not help , still record is disabled and missing , and deadline throws errors.

Dude, this is a SCENE XRef, the code I modified was for OBJECT XRefs!

The Scene XRefs code looks like this:

if SMTDSettings.MergeSceneXRefsOnSubmission do ( for i = theSceneXRefsCount to 1 by -1 do ( local theXRefFile = (xrefs.getXRefFile i) local theFileName = theXRefFile.filename if doesFileExist theFileName then ( if not theXRefFile.disabled then ( local result = merge theXRefFile if result == true then ( try(SMTD_MainRollout.Ui_report ("+Merged Scene XRef File "+ i as string + " ["+ theFileName +"]") )catch() ) else ( try(SMTD_MainRollout.Ui_report ("--FAILED To Merge Scene XRef File "+ i as string + " ["+ theFileName +"]") )catch() SMTDSettings.nonFatalErrorsCount+=1 ) ) else ( local result = delete theXRefFile if result == true then ( try(SMTD_MainRollout.Ui_report ("+Deleted Disabled Scene XRef File "+ i as string + " ["+ theFileName +"]") )catch() ) else ( try(SMTD_MainRollout.Ui_report ("--FAILED to Delete Disabled Scene XRef File "+ i as string + " ["+ theFileName +"]") )catch() SMTDSettings.nonFatalErrorsCount+=1 ) ) ) else ( try(SMTD_MainRollout.Ui_report ("--FAILED To Merge MISSING Scene XRef File "+ i as string + " ["+ theFileName +"]") )catch() SMTDSettings.nonFatalErrorsCount+=1 ) ) )

So this probably explains what you are seeing.
The code says “If the file does not exist, just report a non-fatal error and hope that Max/Deadline will handle it”. We only remove it if it DOES exist, but was set to disabled.

So you might want to try to delete the Scene XRef entry when the file is missing by modifying the bottom part of the code:

							...
							else
							(
								local result = delete theXRefFile
								if result == true then
								(
									try(SMTD_MainRollout.Ui_report ("+Deleted Missing Scene XRef File "+ i as string + " ["+ theFileName +"]")	)catch()
								)
								else
								(
									try(SMTD_MainRollout.Ui_report ("--FAILED to Delete Missing Scene XRef File "+ i as string + " ["+ theFileName +"]")	)catch()
									SMTDSettings.nonFatalErrorsCount+=1
								)
							)
						)

See if this solves the problem. If it does, we will modify our code to do the same…

Hah yeah , i haven’t notice this also…
So actually i can add the same

theRecord.enabled = false --> NEW LINE - removing failed, disable it again!

line to the section

else ( try(SMTD_MainRollout.Ui_report ("--FAILED To Merge MISSING Scene XRef File "+ i as string + " ["+ theFileName +"]") )catch() SMTDSettings.nonFatalErrorsCount+=1 )
In the last line where it reports error ?
Because i see that the variable name is different , in object it is “record” , but in xrefscene it is theXRefFile.

No,you cannot. See the second code block I posted, it does what you need!

[size=150]OLD CODE:[/size]

else ( try(SMTD_MainRollout.Ui_report ("--FAILED To Merge MISSING Scene XRef File "+ i as string + " ["+ theFileName +"]") )catch() SMTDSettings.nonFatalErrorsCount+=1 ) ) )

[size=150]NEW CODE:[/size]

--> NEW CODE STARTS HERE, REPLACING THE OLD ELSE STATEMENT else ( local result = delete theXRefFile if result == true then ( try(SMTD_MainRollout.Ui_report ("+Deleted Missing Scene XRef File "+ i as string + " ["+ theFileName +"]") )catch() ) else ( try(SMTD_MainRollout.Ui_report ("--FAILED to Delete Missing Scene XRef File "+ i as string + " ["+ theFileName +"]") )catch() SMTDSettings.nonFatalErrorsCount+=1 ) ) )

Replaced that and got error code : 1005 , failed to load functions.ms , i’ve added one more and it disappeared “(”
Also looks like it is working ! Thanks a lot for that and i hope i will not come back with this one again ! :smiley:

We recently updated to deadline 7.2 and looks like it is missing this fix with missing / turned off xrefs in xrefs problem.
I compared two pieces of code - the backed up one and the actual one, here it is part of this comparison : dl.dropboxusercontent.com/s/bm1 … 093228.png
So i wanted to ask - looks like it is safe just to copy that part and replace it in actual submission script ?
Tried to contact Bobo in private but for some reason he is not responding , but this is kinda urgent for us, keep getting errors…
Thanks !

LOL, you sent a PM, and I just did not see it. Posting here works so much better anyway…
We are preparing a 7.2.2 release, I will try to get the fixes in ASAP.
Sorry about the mess. We should always use the public forums and not the PM feature, because I totally forgot to merge that code block into the final script.

Replacing the code with the updated code should be OK, give it a try.

No probs !
Ok will update that, thanks.