Script component Fail: System.IndexOutOfRangeException: Index was outside the bounds of the array

1

In SSIS package “script component” is failing due to the following exception. This exception is occurring sometimes only. This script component contain Try/Catch, still it’s failing. What could be the reasons for this exception?

Error Message


5246793 User:OnError Package1 2015-01-16 03:40:45.000 2015-01-16 03:40:45.000 00:00:00 System.IndexOutOfRangeException: Index was outside the bounds of the array.

   at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)

   at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

   at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)

5246800 OnError Package1 2015-01-16 03:40:45.000 2015-01-16 03:40:45.000 00:00:00 SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Script Component" (657) failed with error code 0x80131508 while processing input

input "Input 0" (666). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.
sql-server-2008
ssis
business-intelligence
script-component
msbi
asked on Stack Overflow Jan 23, 2015 by Dav1 • edited Jan 23, 2015 by CSchulz

6 Answers

2

The copying was the issue for me. In my case, I had over 50 output columns, so recreating the script component wasn't a good option. I ended up opening the DTSX file in VSCODE (has great find highlighting on the right scrollbar). The GUID / assembly name for each component is blocked into 18 occurrences for each one. So with the duplicate, I had 36 occurances of the same GUID. They are separated enough to identify each component and just created a new guid and replaced the 18 for one of them and the errors are resolved. Hope this helps someone.

answered on Stack Overflow Jun 5, 2019 by Jeffrey Bane
1

The error is related to the input columns for the script task, which you'll find on the second tab of the Script Transformation Editor. Perhaps it is expecting a column which no longer exists or you're using a column in the script which has not been selected.

If you still can't identify the problem, try refreshing the metadata of the component, or deleting it and recreating it.

answered on Stack Overflow Jan 23, 2015 by James Rosser
1

Had the same problem in som ETL data flows: multiple instances of the same scripting task sometimes working, sometimes not, showing the same "index out of bounds" error on the pipeline buffer. Solved by removing instances that were copied over from existing ones and generating a new task from scratch, just copying over the script itself. Maybe something goes haywire when copying these, crossing over buffers? Hope it helps...

answered on Stack Overflow Jul 30, 2018 by Oliver
1

@Oliver's answer is the closest to the truth here. This step may indeed fix the issue and I've experienced it too. Typical for our beloved Stack Overflow, Zero rated on the right answer.

You may also get this intermittently from SSIS when Script Components attempt to access the Dts.Variables collection, but that variable is not selected in the Script's 'ReadOnlyVariables' or 'ReadWriteVariables' parameter. Check the index used is correct and in the right form e.g.

User::VariableName

answered on Stack Overflow Mar 1, 2019 by Phil Morris
0

@Oliver's answer is the right one, just DELETE and recreate the SCRIPT component, it seems like copy/paste of existing Script Components, can lead to this error.

answered on Stack Overflow Jan 23, 2020 by Ismael
0

I was having this error using a third party component. In order to solve it, I had to decrease the value of the DefaultBufferMaxRows property that I had set to 10,000,000, then I went to 10,000 and solved it.

enter image description here

answered on Stack Overflow Feb 19, 2021 by kbral

User contributions licensed under CC BY-SA 3.0