Closed daissatou2 closed 2 years ago
@taylordowns2000 after my Slack DM is addressed, this is the next priority UNICEF issue to review. This error was thrown in prod environments, but during a prod test (so the data is test data). We need to confirm ASAP this is not an issue on our side, and whether there are any Progres/DTP error messages we need to share back with UNHCR.
Hey @daissatou2 , @aleksa-krolls , I'm digging in, and the concept of providing a log from when it's working as expected and another log when it's not working is fantastic, but the two actual runs provided are apples and orange. The "bad" one is doing an update on an existing case. The "good" one is creating a new case.
I'll see what I can learn about the update part of the job, but it would be super helpful if you could provide me with an example of a run that does an update but is working as expected. Does that make sense?
@daissatou2 , @aleksa-krolls , this PR seems to do the trick. My assessment of the issue is that everything worked as expected, and there's no change in behaviour from the Primero side, but that this particular adaptor version (v2.3.4
) does not write the Primero response to the console after an update.
That's simply the behaviour of the adaptor. If I had to guess, we wanted to "say less" in the logs to give folks the flexibility/security to log what they want in the callback, but IMO we should have, at least, printed a "that worked" line after the success response from Primero.
This is a fairly old adaptor version, so I think that any desired changes should be implemented on the new version and we should (carefully) upgrade the job. Let me know if you want to discuss today. None of this is strictly necessary as the logs now show the outcome you want, but upgrading to the latest Primero is probably a good idea at some point in the future anyway.
Describe the bug
The f1-1.sendReferralsToPrimero job in the production project seems to be stopping before the
updateCase
operation runs. In this run log, the last console.log statement is from line 237 of the job.Why aren't we seeing a response from the Primero API? Is the operation failing but the job isn't showing an error message?
Compare the production log to a log from the staging project from a couple of months ago. They both used the same adaptor version but the staging project log is complete.
To Reproduce
expression.js
Link to the job itself in Github: https://github.com/OpenFn/primero-progres/blob/master/jobs/PROD/f1-1.sendReferralsToPrimero.js
state.json
https://www.openfn.org/projects/primero-progres-v4-prod/messages/062a35a3-3e1f-7d5b-9abc-d90545a719db
Expected behavior
The job should execute the
updateCase
operation and output the response from the Primero API. It should also throw an error if there is an issue with executing that operation.To test/resolve