OpenFn / unicef-cambodia

UNICEF Cambodia - Primero Interoperability
https://openfn.github.io/unicef-cambodia/
1 stars 2 forks source link

f2-j2-upsertCasesToPrimero failing on platform #95

Closed daissatou2 closed 2 years ago

daissatou2 commented 2 years ago

Bug Report

Background, context, and business value

I am seeing this failed run in the platform: https://www.openfn.org/projects/primero-oscar-cambodia-io-staging/runs/0621f822-4ee6-7f25-9f08-69a283424e4c There message says "TypeError [Error]: Cannot destructure property 'services_section' of 'state.data[0]' as it is undefined." Please take a look.

Note: the logs also say "0 cases retrieved from request:". This is wrong because the parent-run which fetches cases did return cases.

state.json

Oscar (to generate data):

{ "configuration": "Oscar Staging (api only user)", "data": "Data will be generated from F2-J1 job" }

Primero: { "configuration": "Primero V2 Cambodia Demo API (openfn_cp_user)", "data": "Run F2-J1 to generate data" }

expression.js

In the V2 FOLDER: https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/V2/f2-j2-upsertCasesToPrimero.js

trigger

Flow trigger Parent job: https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/V2/f2-j1-getOscarCases.js

daissatou2 commented 2 years ago

@grayey please note that I was testing the changes for https://github.com/OpenFn/unicef-cambodia/issues/93 here. Maybe it'll be helpful for you to take a look at Mamadou's commits on that issue. Let me know if any questions!

daissatou2 commented 2 years ago

@grayey I just reran the same job and it's now giving me a passing run : https://www.openfn.org/projects/primero-oscar-cambodia-io-staging/runs/0621fa39-9b63-7220-999b-25291373e072

However nothing has been loaded to Primero. And if you follow the logs, it looks like the job never upserts that data.

grayey commented 2 years ago

Alright @daissatou2. I'll take a look and revert.

grayey commented 2 years ago

@daissatou2 this is now fixed.

daissatou2 commented 2 years ago

@grayey it looks like this is still passing but nothing is actually being sent to Primero. Take a look at this run: https://www.openfn.org/projects/primero-oscar-cambodia-io-staging/runs/06220a7c-19f8-767e-b3b8-56e14a62165d

For some reason, the job is stopping before actually sending the data to Primero. Please check it out. The job should be sending data to Primero. Let me know if a call would be helpful.

grayey commented 2 years ago

@daissatou2 I'll look again and will call you after stand-up tomorrow.

grayey commented 2 years ago

I reran the original parent job and here's the run for f2-j2 https://www.openfn.org/projects/primero-oscar-cambodia-io-staging/runs/06221293-3f18-7a71-84dc-693678d0fd9a

aleksa-krolls commented 2 years ago

@grayey Thank you... fyi, I'm moving this issue over to Review/QA column on Zenhub so that it's clear that this is ready for review and testing. @daissatou2 ping me when online this morning - let's check in on how testing is looking, thanks!

daissatou2 commented 2 years ago

meet with Emeka this morning...the status is not being updated in Primero and he is working on resolving .

aleksa-krolls commented 2 years ago

Hey @grayey - let @daissatou2 and me know if you want to discuss this today and how you're progressing. This is priority today.