Error: Index (zero based) must be greater than or equal to zero and less than the size of the argument list

What could possibly cause this error?

I’ve sanitized every column to be sure stray/hidden characters aren’t the culprit. I can’t find the logs to get more details.

I did a quick google search and this same error comes up

Thanks in advance!

Edit: This error may be tied to extra parameters. My guess is I may have an extra column. Going to verify.

Edit:
… extra columns don’t appear to be the problem.

Edit:
The problem appears to be related to a specific text column I’m trying to insert. When I profile the column, there are no errors or recommendations.

Are there any special characters that EasyMorph doesn’t like to see in fields?

A single record containing both “{” and “}” was the culprit. I assume Easymorph was interpreting this as a parameter for something it was doing under the hood which was causing the error. I applied a replace() transformation to remove the characters and that resolved the problem.

Hi Trevor,

yes, the curly braces in certain cases are expected to contain a parameter name. However, parameter insertion works differently in expression and in texts. In expressions, it produces an error. When a parameter is inserted in a text (e.g. SQL query or PowerShell script) the convention is that if the text between a pair of curly braces is not an existing parameter name then they are left as is and no error raised.

I couldn’t understand from the opening post what action did you use that curly braces produced an error. Can you please provide more details - maybe we need to tweak something in EasyMorph in order either to make it produce a more descriptive error, or just silently ignore curly braces if no parameters found.

Yeah… I removed it from the summary during an edit and forgot to add the full error back to the body.

Original error:
Error: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Source: action “Export to database”, table “easymorph_export_test”

Data was coming from the Import Web API action via an ODATA endpoint. Easymorph was throwing the error on the Export to DB action when inserting into an Oracle database. The problem was that the curly braces were actually part of a record this way “text…{2}…more text”.

Even though I was able to figure this out, I’m going to suggest this is a bug since the sanitize action (all options applied) didn’t address it.

Some troubleshooting detail…

I was unsure what was going on at first since the error appeared to be software related and the data would load fine from an Excel or CSV without sanitizing it. I assume the data is stored in memory differently when reading from a CSV/XLSX file and properly escaped or wrapped so the brackets are ignored.

When the CSV loaded without a problem, I figured there was an issue with one or more records when passing the data directly from the Import Web API action. I isolated the problem column(s) first simply by turning columns on and off and attempting to reload. Once the column(s) was found, I used the same approach to isolate ranges of rows. Once I had a range of rows with a bad record identified, I repeated the process for the bad range until I was left with the bad record.

Thank God it wasn’t millions of rows.

Thanks for the details, Trevor. It turned out to be a bug in EasyMorph that prevented exporting text values that contained “{2}”. We’ve fixed it. You can get the updated version from our website.

1 Like