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.