AWS Thinkbox Discussion Forums

Bug in DraftEventPlugin.py

Hi Guys,

I will try to report things I change / fix in the code to make it work in our end so hopefully it gets to the official build.

So today our Draft jobs started failing while creating strips and movies for the Shotgun… There was a problem with argument string being too long and after checking the job it was in fact too long, as it contained -infile, -outfile parms from all recent jobs.

So the issue in DraftEventPlugin.py is inside OnJobFinished():

self.CreateDraftJob( draftTemplate, job, "Draft Template", outputIndex=i, draftArgs=scriptArgs, mode=mode )
That 3rd parameter is actually used to create temp file that stores all jobs parameters… but it’s always the same file so the parameters build up.

jobInfoFile = Path.Combine( deadlineTemp, "draft_event_{0}_{1}.job".format( jobTag.replace( ' ', '_' ), outputIndex ) )

So what I did is:
inside the OnJobFinished, instead of passing “Draft Template” string, i pass job.name instead… which fixed the issue. Maybe it would be better to use some random string or clear that temp file at some point.

Best,
Tomasz Wyszolmirski

Hey Tomasz,

So the name of the file shouldn’t matter for this since the files are always being opened in write mode. It looks like what the actual issue is is that the draftArgs is being defaulted to a list which in python causes it to store the results from previous calls. I have attached a new copy of DraftEventPlugin.py which you can drop into /event/DraftEventPlugin.

Hopefully this fixes all of your issues,
Grant Bartel
DraftEventPlugin.zip (5.47 KB)

This makes sense and I think it should work now.

Thanks for the updated plugin.

Best,

Privacy | Site terms | Cookie preferences