Highlighted
Contributor

Anaplan Connect - Put file gives Array Index Out of Bounds

Hi,

 

I am having some issues with running one of my Anaplan Connect scripts to import a file & run a process.

When trying to upload the file, I receive an error "Array Index Out of Bounds: 0".

 

When I run the process from the Anaplan website and import the same file there, it works perfectly.

When I run the script, using only the first 3 lines of the file as input file, the script also runs perfectly. My guess is that the issue is with the input file, but I cannot figure out what the problem would be.

clipboard_image_0.png

The input file is attached. Below you can also find a copy of the script:

 

@echo off
rem For Windows OS : This example explains the usage of basic Authentication with Anaplan Connect.
rem It also loads a source text file and runs an Anaplan import into a module.
rem For details of how to configure this script visit https://help.anaplan.com/anapedia/Content/Downloads/DL_Downloads.html

set AnaplanUser="userid:pw"
set WorkspaceId="workspaceID"
set ModelId="ModelID"
set ServiceUrl="https://api.anaplan.com"
set AuthUrl="https://auth.anaplan.com"
set FileName="ANA_Mat_Plant_Attr.csv"
set FilePath="...\ANA_Mat_Plant_Attr.csv"
set DumpName="dump/path/here"
set Chunksize=1

set Operation=-debug -service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% -chunksize %Chunksize% -file %FileName% -put %FilePath% -process "Import SKU / Plant" -execute -output %DumpName%

rem *** End of settings - Do not edit below this line ***

setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=.\AnaplanClient.bat %Credentials% %Operation%
@echo %Command%
cmd /c %Command%
pause

 

Thanks.

11 REPLIES 11
Highlighted
Occasional Contributor

Re: Anaplan Connect - Put file gives Array Index Out of Bounds

Do you want to run only an import action, or do you want to run a process that has the import action built in the process?
Highlighted
Occasional Contributor

Re: Anaplan Connect - Put file gives Array Index Out of Bounds

I'd move "-chunksize %Chunksize%" after "-put %FilePath%"
Highlighted
Contributor

Re: Anaplan Connect - Put file gives Array Index Out of Bounds

Moving the chunksize part after the put did unfortunately not solve the issue. In my other scripts I follow the same logic & there it works smoothly.

Highlighted
Contributor

Re: Anaplan Connect - Put file gives Array Index Out of Bounds

Run an process which has an import embedded indeed, that's why I need to upload the file.

Highlighted
Occasional Contributor

Re: Anaplan Connect - Put file gives Array Index Out of Bounds

Did you ever get this figured out?  I'm running into the same problem.  This script is almost exactly like another one that is working perfectly, so it's really baffling me.

Highlighted
Occasional Contributor

Re: Anaplan Connect - Put file gives Array Index Out of Bounds

Hello @kboothe 

 

How is your source file delimitted is it similar to the other script's source file? One other item I would check is the chunk size when you are uploading to anaplan connect, it might be worth increasing it.

Highlighted
Occasional Contributor

Re: Anaplan Connect - Put file gives Array Index Out of Bounds

Hello @Ankit 

 

Thanks so much for your suggestions.  I think I may be getting close.  Both source files are delimited with "|".  I have increased the chunksize to 50, but I'm still getting the Array index out of bounds error.  The problem does seem to be the source file though.  It was 23K lines, so I deleted 8K and the error disappeared.  I think I will try validating the data in the 8K . . . unless you have any other suggestions.

Highlighted
Occasional Contributor

Re: Anaplan Connect - Put file gives Array Index Out of Bounds

FYI to anyone else receiving the array index out of bounds error, I was finally able to resolve it by placing the chunksize after Modelid in the set operation (it was originally after the filename).

Highlighted
Certified Master Anaplanner

Re: Anaplan Connect - Put file gives Array Index Out of Bounds

I ran into this issue this week and raised a support ticket. The source of the error was the use of more than one delimiter in the file definition. This seems to be a known issue with Anaplan Connect V1.4.x.

 

To correct the issue update your file definition, Imports > Import Data Sources, and change delimiter selection so that you only use a single delimiter.