OpenFn / ConSoSci

ConSoSci jobs to integrate: BNS and NRGT Kobo Toolbox forms and other WCS/Partner Kobo form integrations.
https://openfn.github.io/ConSoSci/
4 stars 3 forks source link

Automation: TypeError [Error]: Cannot read property 'toLowerCase' of undefined #167

Closed aleksa-krolls closed 3 years ago

aleksa-krolls commented 3 years ago

Describe the bug

Seeing this run failure when WCS runs the A3 job to generate a SQL script: TypeError [Error]: Cannot read property 'toLowerCase' of undefined https://www.openfn.org/projects/trillion-trees/runs/0619f7ad-aeb9-7b8a-9976-432e14954e6c

To Reproduce

  1. Re-run job A1: https://www.openfn.org/projects/trillion-trees/runs/0619f7ac-1be6-7341-8e12-a8fafe75e019
    {
    formId: 'a587nJHzyBYATXi3Nb2yc7',
    tag: 'Site Registration TZ 7 Sept 21',
    url: 'https://kf.kobotoolbox.org/api/v2/assets/a587nJHzyBYATXi3Nb2yc7/?format=json',
    prefix1: 'TT',
    prefix2: '',
    tableId: 'SiteRegistration',
    lastModified: '2021-11-25T09:01:20.085167Z'
    }

expression.js

https://github.com/WCS-ConsTech/OpenFn-TrillionTrees/blob/main/automation/02c-syncToMssql.js

I know this is the job on the TT repo... confirming these automation jobs match what we have on the consosci repo?

state.json

wcs test mssql db

lakhassane commented 3 years ago

@aleksa-krolls there is no syncToMssql job in the OpenFn_TT repo. Do you know where this is located? (clicking on the expression take you to GH 404 page)

aleksa-krolls commented 3 years ago

@lakhassane Oh weird... it looks like the OpenFn Job has a file path, but the file wasn't created in the Repo. Added it now (copying over from consosci): https://github.com/WCS-ConsTech/OpenFn-TrillionTrees/blob/main/02c-syncToMssql__TT.js

And re-ran the job on platform... still an error: https://www.openfn.org/projects/trillion-trees/runs/0619f941-2dcd-7a06-89c1-27d7e163725e

cc @ritazagoni - fyi I also updated the job file paths in the openfn project

lakhassane commented 3 years ago

@aleksa-krolls Corrected this one for both syncToMssql in OpenFn_TT repo and Consosci repo. It was related to the fact that we removed the underscore in table naming.

See run here: https://www.openfn.org/projects/trillion-trees/runs/0619fb6d-d0d9-722e-a697-bcd4ffacbbd6