Incorrect chunk counts using API
We are getting incorrect chunk counts using API
https://api.anaplan.com/2/0/workspaces/{workspaceID}/models/{modelID}/files
We are trying to export ~1GB file from Anaplan production model, which is ~100 chunks. But from last week, we are getting random chunk counts for all export processes across all models (incomplete chunk counts 50, 60 randomly). We made a change after this issue to add sleep time in python code after posting task, we are able to get full chunk counts after 3 minutes sleep time.
Sometimes, we are getting correct chunk count of 100 but getting 404 error (chunk not available) after processing couple of chunks e.g. after processing 36th chunk we get below error:
https://api.anaplan.com/2/0/workspaces/{workspaceID}/models/{modelID}/files/{fileID}/chunks/37
Answers
-
I've had more luck with this endpoint. I assume its the same for version 2.
It will return JSON so you'll need to parse this but notice I'm using the metadata of the file; whereas, you're using the process.0 -
Thanks @JaredDolich
sorry, we are using https://api.anaplan.com/2/0/workspaces/{wGuid}/models/{mGuid}/files/{fileID}/chunks
to get chunk count. It is taking minutes to get final chunk count.
0 -
Interesting. Wonder why it takes so long? Well, you might be able to calculate it yourself. If you know the file size then divide by chunk size. Two other options you might consider:
- Set the chunks yourself
- Try using AnaplanConnect to see if its any faster.
Beyond that, you should contact your business partner. They have direct access to the development/technical team. They'll get you an answer right quick.
0 -
Are you polling for task status (https://help.anaplan.com/e743102b-7707-42ed-bfb5-e417509525f0-Get-the-status-of-the-process-task) until the process has completed? It sounds like it takes some time to extract the the data from the model into the file
0 -
Thanks @ben_speight
Yes, we have added check "taskState": "COMPLETE" before getting chunk count and downloading chunks and it worked for us.
It was working fine with out this check since last year, but for some reason exporting partial data from 9/8.
0