It seems like their is a script step to create a new record and the table definition needs a value that is not available to the server session.
Make sure all the script steps are server compatible.
Make sure that you re not setting regular fields with global variables or global fields as they do not retain their values for PSOS or server side scripts.
I run the script debugger and the error happens not into the server script but when it hits the perform script on server step. I try to pass a parameter and this parameter is a Base64 text. And like I said, this script has run many times in the day with no changes modifications. I'm really confuse.
Under some circumstances, server scripts yield different results compared to a run in the client. The cause may be that a data is not available in the server context.
Server-side execution of a script cannot be tracked in the debugger. A workaround is to create a table were the script logs the values it receives and computes (1 record for each run). This allows for a post- run analysis and may give you a hint of what goes wrong.
Post a screenshot of the script and the script that is run by PSOS indicate exactly where you are getting the error
Is your Script Parameter > 1,000,000 characters? This is the limit for PSOS parameters and PSOS Script Results.
If your parameter is bigger, break the B64 text into smaller chunks (≤ 1000000 chars) and send it in segments to the Server. Once the server has all the segments, concatenate them on the server and process the data as needed.
Similarly, if you have to return a large Script Result, send it back to the client in segments of < 1,000,000 chars.
I ran a simple test and sending/returning a 1000000 char param/result worked fine but a 1000010 result/param caused Error 513.
A big thanks everyone.
Alternatively, create a record in a session table,
Place the script name and parameter in the record.
Call a central handler script with PSoS and pass the id of the record.
On the server your handler script can find the session record and read a parameter of any size.
It can also write a result --- and a debugging log!!! --- back into the record on return.
This avoids the parameter limit and centralises lots of house keeping code.