that means you have some corrupted data in processinstanceinfo table. Best would be to cleanup the data base and if that is not possible to find all entries in processinstanceinfo table where processid is equal to the processid with script task. That is to make sure you have valid data in your db.
A quick way to check it differently is to change the process id of the script task process and deploy it again. That should make sure you have no previous process instances inside db that got corrupted.
Another thing is - why corrupted data exists in you db? Might be related to the errors when executing the script itself, so please review the script to make sure it executes successfully.
btw, what data base do you use?
HTH