openaddresses / batch

OpenAddresses/Machine based AWS Batch based ETL Processing
https://batch.openaddresses.io/
MIT License
6 stars 5 forks source link

Batch job API sometimes results in an error #339

Open iandees opened 1 year ago

iandees commented 1 year ago

From the logs:

TypeError: Cannot read properties of undefined (reading 'job')
--
at Job.delta (file:///home/openaddresses/api/lib/types/job.js:166:52)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///home/openaddresses/api/routes/job.js:112:27
::ffff:127.0.0.1 - - [05/May/2023:15:16:31 +0000] "GET /api/job/40266/delta HTTP/1.0" 500 - "https://batch.openaddresses.io/job/40266" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"

The job/:job/delta endpoint calls Job.delta(), which calls Data.list() here, and then datas[0].job here fails because datas[0] is undefined. datas comes from Data.list() here. When I execute a query that should match what is being run, I get a result with a job column.