Anaplan Connect 1.4 Null pointer exceptions

I am getting NullPointerException errors from Anaplan Connect when I include -process -execute instructions. I started from the example.sh script. The process runs two Import actions that import from the same file, first into a List and then into a Module.

 

Here is my script:

#!/bin/sh
# This example uploads a file and runs an import

AnaplanUser="myUser"
WorkspaceId="myWorkspaceId"
ModelId="myModelId"
Operation="-service 'https://api.anaplan.com' -auth 'https://auth.anaplan.com' -file 'products.sql.csv' -chunksize 1 -put '/Users/me/anaplan/anaplan_load/input_files/products.sql.csv' -process 'Import Products' -execute -output '/Users/me/anaplan/anaplan_load/errors.txt'"

#____________________________ Do not edit below this line ______________________________

if [ "${AnaplanUser}" ]; then
  Credentials="-user ${AnaplanUser}"
fi

echo cd "`dirname "$0"`"
cd "`dirname "$0"`"
if [ ! -f AnaplanClient.sh ]; then
  echo "Please ensure this script is in the same directory as AnaplanClient.sh." >&2
  exit 1
elif [ ! -x AnaplanClient.sh ]; then
  echo "Please ensure you have executable permissions on AnaplanClient.sh." >&2
  exit 1
fi

Command="./AnaplanClient.sh ${Credentials} -workspace ${WorkspaceId} -model ${ModelId} ${Operation}"
/bin/echo "${Command}"
exec /bin/sh -c "${Command}"

 

If I exclude "-process 'Import Products' -execute", I get:

anaplan-connect-1.4$ ./example.sh
cd .
./AnaplanClient.sh -user myUser -workspace myWorkspace -model myModel -service 'https://api.anaplan.com' -auth 'https://auth.anaplan.com' -file 'products.sql.csv' -chunksize 1 -put '/Users/me/anaplan/anaplan_load/input_files/products.sql.csv' -output '/Users/me/anaplan/anaplan_load/errors.txt'
Absolute path to JAVA8 executable not provided. Will attempt to figure out path from JAVA_HOME or which command...
Found Java executable from JAVA_HOME...
Java 8 found!
Using ./anaplan-connect-1.4-jar-with-dependencies.jar
Warning: cannot find lib directory
Password:
2018-10-09 14:02:09 INFO  54552 |--   Initializing Service...
2018-10-09 14:02:09 INFO  54552 |--   Authenticating via Basic...
2018-10-09 14:02:12 INFO  54552 |--   ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑  
2018-10-09 14:02:12 INFO  54552 |--   Uploading file: /Users/me/anaplan/anaplan_load/input_files/products.sql.csv
2018-10-09 14:02:14 INFO  54552 |--   The file "/Users/me/anaplan/anaplan_load/input_files/products.sql.csv" has been uploaded as products.sql.csv.
2018-10-09 14:02:14 INFO  54552 |--   No dump file is available.

 

If I include "-process 'Import Products' -execute", the process doesn't complete gracefully; I have to **** it. I get:

anaplan-connect-1.4$ ./example.sh
cd .
./AnaplanClient.sh -user myUser -workspace myWorkspace -model myModel -service 'https://api.anaplan.com' -auth 'https://auth.anaplan.com' -file 'products.sql.csv' -chunksize 1 -put '/Users/me/anaplan/anaplan_load/input_files/products.sql.csv' -process 'Import Products' -execute -output '/Users/me/anaplan/anaplan_load/errors.txt'
Absolute path to JAVA8 executable not provided. Will attempt to figure out path from JAVA_HOME or which command...
Found Java executable from JAVA_HOME...
Java 8 found!
Using ./anaplan-connect-1.4-jar-with-dependencies.jar
Warning: cannot find lib directory
Password:
2018-10-09 13:55:07 INFO  54455 |--   Initializing Service...
2018-10-09 13:55:07 INFO  54455 |--   Authenticating via Basic...
2018-10-09 13:55:10 INFO  54455 |--   ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑  
2018-10-09 13:55:10 INFO  54455 |--   Uploading file: /Users/me/anaplan/anaplan_load/input_files/products.sql.csv
2018-10-09 13:55:12 INFO  54455 |--   The file "/Users/me/anaplan/anaplan_load/input_files/products.sql.csv" has been uploaded as products.sql.csv.
2018-10-09 13:55:13 INFO  54455 |--   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
2018-10-09 13:55:13 INFO  54455 |--   Running Process: Import Products (id=118000000021)
2018-10-09 13:55:15 INFO  54455 |--   Run status: Complete. (100.0%)
2018-10-09 13:55:15 INFO  54455 |--   -----------------------------------------
2018-10-09 13:55:15 INFO  54455 |--   <<< The operation was successful >>>  😃
2018-10-09 13:55:15 INFO  54455 |--   - - - - - - - - - - - - - - - - - - - - -  
2018-10-09 13:55:15 ERROR 54455 |--   Null pointer
Client terminated, cancelling...2018-10-09 13:55:17 INFO   |--   Run status: Complete. (100.0%)
2018-10-09 13:55:17 INFO   |--   -----------------------------------------
2018-10-09 13:55:17 INFO   |--   <<< The operation was successful >>>  😃
2018-10-09 13:55:17 INFO   |--   - - - - - - - - - - - - - - - - - - - - -  
2018-10-09 13:55:17 ERROR  |--   Null pointer

Killed: 9

 

If I further include "-debug", I get:

anaplan-connect-1.4$ ./example.sh
cd .
./AnaplanClient.sh -user myUser -workspace myWorkspace -model myModel -debug -service 'https://api.anaplan.com' -auth 'https://auth.anaplan.com' -file 'products.sql.csv' -chunksize 1 -put '/Users/me/anaplan/anaplan_load/input_files/products.sql.csv' -process 'Import Products' -execute -output '/Users/me/anaplan/anaplan_load/errors.txt'
Absolute path to JAVA8 executable not provided. Will attempt to figure out path from JAVA_HOME or which command...
Found Java executable from JAVA_HOME...
Java 8 found!
Using ./anaplan-connect-1.4-jar-with-dependencies.jar
Warning: cannot find lib directory
2018-10-09 13:09:49 DEBUG [c.a.client.Program  :1609 ] 54087 |--   ======================================================================
2018-10-09 13:09:49 DEBUG [c.a.client.Program  :1610 ] 54087 |--   Anaplan Connect 1.4.0
2018-10-09 13:09:49 DEBUG [c.a.client.Program  :1611 ] 54087 |--   Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)/ (25.181-b13)/
2018-10-09 13:09:49 DEBUG [c.a.client.Program  :1613 ] 54087 |--   (Mac OS Xx86_64)/10.13.6
2018-10-09 13:09:49 DEBUG [c.a.client.Program  :1614 ] 54087 |--   ======================================================================
Password:
2018-10-09 13:09:58 INFO  [c.a.client.Service  :92   ] 54087 |--   Initializing Service...
2018-10-09 13:09:58 INFO  [a.BasicAuthenticator:26   ] 54087 |--   Authenticating via Basic...
2018-10-09 13:10:01 INFO  [c.a.c.l.LogUtils    :48   ] 54087 |--   ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑  
2018-10-09 13:10:01 INFO  [c.a.c.ServerFile    :258  ] 54087 |--   Uploading file: /Users/me/anaplan/anaplan_load/input_files/products.sql.csv
2018-10-09 13:10:03 DEBUG [c.a.c.ServerFile    :305  ] 54087 |--   Uploaded chunk: 0 (size=1MB)
2018-10-09 13:10:04 INFO  [c.a.client.Program  :469  ] 54087 |--   The file "/Users/me/anaplan/anaplan_load/input_files/products.sql.csv" has been uploaded as products.sql.csv.
2018-10-09 13:10:04 INFO  [c.a.c.l.LogUtils    :44   ] 54087 |--   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
2018-10-09 13:10:04 INFO  [c.a.c.TaskFactory   :118  ] 54087 |--   Running Process: Import Products (id=118000000021)
2018-10-09 13:10:07 INFO  [c.a.client.Task     :207  ] 54087 |--   Run status: Complete. (100.0%)
2018-10-09 13:10:07 INFO  [c.a.c.l.LogUtils    :56   ] 54087 |--   -----------------------------------------
2018-10-09 13:10:07 INFO  [c.a.client.Task     :230  ] 54087 |--   <<< The operation was successful >>>  😃
2018-10-09 13:10:07 INFO  [c.a.c.l.LogUtils    :60   ] 54087 |--   - - - - - - - - - - - - - - - - - - - - -  
2018-10-09 13:10:07 DEBUG [c.a.client.Program  :592  ] 54087 |--   java.lang.NullPointerException
    at com.anaplan.client.TaskResultDetail.appendTo(TaskResultDetail.java:66)
    at com.anaplan.client.TaskResult.appendTo(TaskResult.java:170)
    at com.anaplan.client.TaskResult.appendTo(TaskResult.java:175)
    at com.anaplan.client.TaskResult.toString(TaskResult.java:187)
    at com.anaplan.client.Task.trackRunningTask(Task.java:235)
    at com.anaplan.client.Task.runTask(Task.java:121)
    at com.anaplan.client.Program.main(Program.java:287)
 
2018-10-09 13:10:07 ERROR [c.a.client.Program  :595  ] 54087 |--   Null pointer
Client terminated, cancelling...2018-10-09 13:10:09 INFO  [c.a.client.Task     :207  ]  |--   Run status: Complete. (100.0%)
2018-10-09 13:10:09 INFO  [c.a.c.l.LogUtils    :56   ]  |--   -----------------------------------------
2018-10-09 13:10:09 INFO  [c.a.client.Task     :230  ]  |--   <<< The operation was successful >>>  😃
2018-10-09 13:10:09 INFO  [c.a.c.l.LogUtils    :60   ]  |--   - - - - - - - - - - - - - - - - - - - - -  
2018-10-09 13:10:09 DEBUG [c.a.client.Task     :138  ]  |--   java.lang.NullPointerException
    at com.anaplan.client.TaskResultDetail.appendTo(TaskResultDetail.java:66)
    at com.anaplan.client.TaskResult.appendTo(TaskResult.java:170)
    at com.anaplan.client.TaskResult.appendTo(TaskResult.java:175)
    at com.anaplan.client.TaskResult.toString(TaskResult.java:187)
    at com.anaplan.client.Task.trackRunningTask(Task.java:235)
    at com.anaplan.client.Task.cancelRunningTask(Task.java:136)
    at com.anaplan.client.Task.lambda$static$0(Task.java:52)
    at java.lang.Thread.run(Thread.java:748)
 
2018-10-09 13:10:09 ERROR [c.a.client.Task     :139  ]  |--   Null pointer
Killed: 9

 

The data do load successfully and both of the imports inside the process run successfully. So, I see my test line item in the list and its associated data in the module.

 

Also, nothing is written to the errors.txt file in any of the scenarios.

Tagged:

Answers

  • More info. I tried replacing the -process command with each of its component -import commands, and determined that the NullPointException is generated from importing into a List. Running any import into a list causes the NullPointerExceptions. Running imports into modules so far does not.

  • More testing results. If the import has any errors in it, Anaplan Connect throws a NullPointerException and aborts.

  • I have the same issue on list imports.

    Additionally, half of the times, and only without the -debug option, the java process hangs and do not ends. When this happen, I have to **** the java process to ends it.

     

    Note: I am on Windows

     

    Simple Null pointer exception with debug: 

    E:\Applications-ppd\ANAPLAN_Connect>"C:\Program Files\Java\jdk1.8.0_141\bin\java.exe"  -classpath "E:\Applications-ppd\ANAPLAN_Connect\anaplan-connect-1.4\anaplan-connect-1.4-jar-w
    ith-dependencies.jar;E:\Applications-ppd\ANAPLAN_Connect\anaplan-connect-1.4\lib\sqljdbc42.jar" com.anaplan.client.Program -debug -service https://api.anaplan.com -auth https://aut
    h.anaplan.com -user %userpwd% -workspace %workspaceid% -model %modelid% -import "IMP-08 Liste Pôles / Projets" -execute
    2018-12-13 13:15:25 &#27;[33mDEBUG&#27;[0;39m &#27;[33m[c.a.client.Program :&#27;[36m1609 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- ==================================================================
    ====
    2018-12-13 13:15:25 &#27;[33mDEBUG&#27;[0;39m &#27;[33m[c.a.client.Program :&#27;[36m1610 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- Anaplan Connect 1.4.0
    2018-12-13 13:15:25 &#27;[33mDEBUG&#27;[0;39m &#27;[33m[c.a.client.Program :&#27;[36m1611 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)/ (25.141-b1
    5)/
    2018-12-13 13:15:25 &#27;[33mDEBUG&#27;[0;39m &#27;[33m[c.a.client.Program :&#27;[36m1613 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- (Windows Server 2008 R2amd64)/6.1
    2018-12-13 13:15:25 &#27;[33mDEBUG&#27;[0;39m &#27;[33m[c.a.client.Program :&#27;[36m1614 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- ==================================================================
    ====
    2018-12-13 13:15:25 &#27;[32mINFO &#27;[0;39m &#27;[33m[c.a.client.Service :&#27;[36m92 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- Initializing Service...
    2018-12-13 13:15:25 &#27;[32mINFO &#27;[0;39m &#27;[33m[a.BasicAuthenticator:&#27;[36m26 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- Authenticating via Basic...
    2018-12-13 13:15:28 &#27;[32mINFO &#27;[0;39m &#27;[33m[c.a.c.l.LogUtils :&#27;[36m44 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    2018-12-13 13:15:28 &#27;[32mINFO &#27;[0;39m &#27;[33m[c.a.c.TaskFactory :&#27;[36m118 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- Running Import: IMP-08 Liste Pôles / Projets (id=112000000083)
    2018-12-13 13:15:30 &#27;[32mINFO &#27;[0;39m &#27;[33m[c.a.client.Task :&#27;[36m207 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- Run status: Complete. (100.0%)
    2018-12-13 13:15:30 &#27;[32mINFO &#27;[0;39m &#27;[33m[c.a.c.l.LogUtils :&#27;[36m56 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- -----------------------------------------
    2018-12-13 13:15:30 &#27;[32mINFO &#27;[0;39m &#27;[33m[c.a.client.Task :&#27;[36m230 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- <<< The operation was successful >>> =)
    2018-12-13 13:15:30 &#27;[32mINFO &#27;[0;39m &#27;[33m[c.a.c.l.LogUtils :&#27;[36m60 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- - - - - - - - - - - - - - - - - - - - - -
    2018-12-13 13:15:30 &#27;[33mDEBUG&#27;[0;39m &#27;[33m[c.a.client.Program :&#27;[36m592 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- java.lang.NullPointerException
    at com.anaplan.client.TaskResultDetail.appendTo(TaskResultDetail.java:66)
    at com.anaplan.client.TaskResult.appendTo(TaskResult.java:170)
    at com.anaplan.client.TaskResult.toString(TaskResult.java:187)
    at com.anaplan.client.Task.trackRunningTask(Task.java:235)
    at com.anaplan.client.Task.runTask(Task.java:121)
    at com.anaplan.client.Program.main(Program.java:287)

    2018-12-13 13:15:30 &#27;[1;31mERROR&#27;[0;39m &#27;[33m[c.a.client.Program :&#27;[36m595 &#27;[0;39m]&#27;[0;39m &#27;[35m3752&#27;[0;39m |-- Null pointer

    Process hangs without debug (I did not reproduce than when the debug option is present). 

    E:\Applications-ppd\ANAPLAN_Connect>"C:\Program Files\Java\jdk1.8.0_141\bin\java.exe"  -classpath "E:\Applications-ppd\ANAPLAN_Connect\anaplan-connect-1.4\anaplan-connect-1.4-jar-w
    ith-dependencies.jar;E:\Applications-ppd\ANAPLAN_Connect\anaplan-connect-1.4\lib\sqljdbc42.jar" com.anaplan.client.Program -service https://api.anaplan.com -auth https://auth.anapl
    an.com -user %userpwd% -workspace %workspaceid% -model %modelid% -import "IMP-08 Liste Pôles / Projets" -execute
    2018-12-13 13:15:34 &#27;[32mINFO &#27;[0;39m &#27;[35m6860&#27;[0;39m |-- Initializing Service...
    2018-12-13 13:15:34 &#27;[32mINFO &#27;[0;39m &#27;[35m6860&#27;[0;39m |-- Authenticating via Basic...
    2018-12-13 13:15:38 &#27;[32mINFO &#27;[0;39m &#27;[35m6860&#27;[0;39m |-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    2018-12-13 13:15:38 &#27;[32mINFO &#27;[0;39m &#27;[35m6860&#27;[0;39m |-- Running Import: IMP-08 Liste Pôles / Projets (id=112000000083)
    2018-12-13 13:15:40 &#27;[32mINFO &#27;[0;39m &#27;[35m6860&#27;[0;39m |-- Run status: Complete. (100.0%)
    2018-12-13 13:15:40 &#27;[32mINFO &#27;[0;39m &#27;[35m6860&#27;[0;39m |-- -----------------------------------------
    2018-12-13 13:15:40 &#27;[32mINFO &#27;[0;39m &#27;[35m6860&#27;[0;39m |-- <<< The operation was successful >>> =)
    2018-12-13 13:15:40 &#27;[32mINFO &#27;[0;39m &#27;[35m6860&#27;[0;39m |-- - - - - - - - - - - - - - - - - - - - - -
    2018-12-13 13:15:40 &#27;[1;31mERROR&#27;[0;39m &#27;[35m6860&#27;[0;39m |-- Null pointer
    Client terminated, cancelling...2018-12-13 13:15:42 &#27;[32mINFO &#27;[0;39m &#27;[35m&#27;[0;39m |-- Run status: Complete. (100.0%)
    2018-12-13 13:15:42 &#27;[32mINFO &#27;[0;39m &#27;[35m&#27;[0;39m |-- -----------------------------------------
    2018-12-13 13:15:42 &#27;[32mINFO &#27;[0;39m &#27;[35m&#27;[0;39m |-- <<< The operation was successful >>> =)
    2018-12-13 13:15:42 &#27;[32mINFO &#27;[0;39m &#27;[35m&#27;[0;39m |-- - - - - - - - - - - - - - - - - - - - - -
    2018-12-13 13:15:42 &#27;[1;31mERROR&#27;[0;39m &#27;[35m&#27;[0;39m |-- Null pointer
  • I have also experienced this issue when testing Anaplan Connect 1.4 for my implementation on a Windows server.  I am running a compound action that loads extracted data from our warehouse to an Anaplan data source, then the Anaplan data source to a module and a list.  The issue comes when loading to the list, in which the process creates a list of unique members from the source file with potentially multiple instances of the same member key (entity and unit).  The 1.4 version chokes on the (acceptable) errors -- in my case "Another row has already been processed with this key,"  does not create the log file, and just hangs.

     

    I reported this to Anaplan Support yesterday and received a response that this behavior is a bug in 1.4 and they are working on it.  The exact blurb from them is:

     

    I can confirm that you are experiencing a known issue with Anaplan Connect version 1.4 that affects the ability to continue beyond the error. Our Anaplan Connect team has been working on this issue and hope to have a fix implemented in the next version. I do not have a time line of when this new version can be expected, unfortunately. 

    The current workaround is to use Anaplan Connect 1.3 until the new version of Anaplan Connect 1.4 has been released.

     

    So, I guess maybe put off any more effort on implementing this version until they have a fix to gracefully handle error logs for list integrations...

     

    Stacey Gibbens

    Simon Property Group

    [email protected]

  • Yes. This bug is a reason (possibly THE reason) that they pushed out the end-of-life for AC 1.3 certificates.