cURL fetching an export from API intermittently failing with 500 Internal Server Error
Hi All,
We are trying to GET the exports from API but it is intermittently failing. At times when it is successful the response header will have content type returned as "Content-Type: application/octet-stream" and when it fails response header contains "Content-Type: application/json;charset=UTF-8"
FYR see below when it fails with 500:
> GET /2/0/workspaces/{workspaceID}/models/{modelID}/files/{fileID}/ HTTP/1.1 > Host: api.anaplan.com > User-Agent: curl/7.79.1 > Accept: */* > authorization: AnaplanAuthToken ***masked*** > Content-Type: application/octet-stream > * Mark bundle as not supporting multiuse < HTTP/1.1 500 Internal Server Error < Date: Thu, 11 Aug 2022 09:17:47 GMT < Content-Type: application/json;charset=UTF-8 < Transfer-Encoding: chunked < Connection: keep-alive < Cache-Control: no-cache < Pragma: no-cache < Expires: 0 < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload < CF-Cache-Status: DYNAMIC < Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" < X-Content-Type-Options: nosniff < Server: cloudflare < CF-RAY: 738fe151dd65756a-LHR
FYR see below when it is success:
> GET /2/0/workspaces/{workspaceID}/models/{modelID}/files/{fileID}/ HTTP/1.1 > Host: api.anaplan.com > User-Agent: curl/7.79.1 > Accept: */* > authorization: AnaplanAuthToken ****masked*** > Content-Type: application/octet-stream > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Date: Thu, 11 Aug 2022 09:17:52 GMT < Content-Type: application/octet-stream < Content-Length: 203 < Connection: keep-alive < Cache-Control: no-cache < Pragma: no-cache < Expires: 0 < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload < CF-Cache-Status: DYNAMIC < Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" < X-Content-Type-Options: nosniff < Server: cloudflare < CF-RAY: 738fe16e0bd8779d-LHR
This started recently while there are no changes on the script, model ID, workspace ID and file export numbers remains same. Any help or pointers would be greatly appreciated.
Comments
-
Hi @M.Kierepka
First of all, thank you so much for the response.
Yes we do submit a export action (POST) in our script before requesting the files.
I just ran the script and I see below output where taskState is shown as "IN_PROGRESS", you mean to say we should wait for this taskState to be COMPLETED before we can request (GET) for the files?
{ "meta" : { "schema" : "https://api.anaplan.com/2/0/models/{modelID}/objects/task" }, "status" : { "code" : 200, "message" : "Success" }, "task" : { "taskId" : "297A9BB774FD4C4787E55EF672B6CA2B", "taskState" : "IN_PROGRESS", "creationTime" : 1660235336530 } }'
0
Categories
- All Categories
- 2.3K Anaplan Community
- Academy
- Anaplan Talent Builder
- Model Design Course
- The Anaplan Way
- Archive
- 2 Idea exchange
- 62 Enterprise Scale
- 1.1K Extensibility
- 21 Intelligence
- 1.6K Planning & Modeling
- 331 Security
- Community Connections
- Connections
- Experiences
- Groups
- Personas
- Employees
- CS Toolkit
- Customer Care Center
- Forums
- Academy & Training
- Community Feedback & Updates
- Japan
- Anaplan Community Japan
- Anaplan Community Japan Knowledge Base
- HyperCare Japan
- JP-Central
- Support-Japanese
- Partners
- Partner Leadership Council
- Partner Product Council
- 724 Platform
- Anapedia
- App Hub
- Centers Of Excellence
- Extensions
- Planual
- Platform Updates
- 724 User Experience
- Profile Builder
- Resources
- Anaplan Advocates
- Anaplan Live!
- Community
- Community Advancement
- Community Connections
- Partner Program
- The Official Master Anaplanner Program
- Videos
- Welcome to the Anaplan Community!
- Success Central
- Support
- Case Portal Link
- Common Support Questions
- HyperCare Redirect
- Known Issues and Workarounds
- Support test page
- SupportFAQ
- Survey
- 2 Training Day Takeaways