Closed danielandelin closed 2 years ago
In the future can you copy the error code so we can find it more easily.
5FmoweVY
@coolaj86 relevant stack trace:
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: [Error] Unexpected internal error #MNwjAvf6:
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: unknown relation "task" in an eager expression
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: [ValidationError: unknown relation "task" in an eager expression
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: createValidationErro|363 |/node_modules/objection/lib/model/Model.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: findRelationsToFetch|224 |/node_modules/objection/lib/queryBuilder/operations/eager/WhereInEagerOperation.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: onBuild |42 |/node_modules/objection/lib/queryBuilder/operations/eager/WhereInEagerOperation.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: callOperationMethod |379 |/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: null |478 |/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: forEachOperation |316 |/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: executeOnBuild |476 |/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: callOnBuildHooks |1575|/node_modules/objection/lib/queryBuilder/QueryBuilder.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: doExecute |1452|/node_modules/objection/lib/queryBuilder/QueryBuilder.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: execute |667 |/node_modules/objection/lib/queryBuilder/QueryBuilder.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: processTicksAndRejec|96 |node:internal/process/task_queues
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: AccessCode.getWithOu|120 |/src/lib/access-code.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: persistentRedirect |45 |/src/api/routes/outside-form.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: handleResult |113 |/node_modules/@root/async-router/lib/index.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: asyncWrapper2 |80 |/node_modules/@root/async-router/lib/index.js
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: ] {
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: type: 'RelationExpression',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: data: {},
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: statusCode: 400,
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: toJSON: [Function (anonymous)],
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: _id: '#MNwjAvf6',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: _method: 'GET',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: _url: '/api/redirect/form/tPsO9OinSPU4FjG9Z0kjmw00',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: _standardized: undefined,
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: file_stack: [
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'createValidationErro|363 |/node_modules/objection/lib/model/Model.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'findRelationsToFetch|224 |/node_modules/objection/lib/queryBuilder/operations/eager/WhereInEagerOperation.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'onBuild |42 |/node_modules/objection/lib/queryBuilder/operations/eager/WhereInEagerOperation.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'callOperationMethod |379 |/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'null |478 |/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'forEachOperation |316 |/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'executeOnBuild |476 |/node_modules/objection/lib/queryBuilder/QueryBuilderOperationSupport.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'callOnBuildHooks |1575|/node_modules/objection/lib/queryBuilder/QueryBuilder.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'doExecute |1452|/node_modules/objection/lib/queryBuilder/QueryBuilder.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'execute |667 |/node_modules/objection/lib/queryBuilder/QueryBuilder.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'processTicksAndRejec|96 |node:internal/process/task_queues',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'AccessCode.getWithOu|120 |/src/lib/access-code.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'persistentRedirect |45 |/src/api/routes/outside-form.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'handleResult |113 |/node_modules/@root/async-router/lib/index.js',
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: 'asyncWrapper2 |80 |/node_modules/@root/async-router/lib/index.js'
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: ]
Mar 22 22:37:27 staging-1.savvi.legal node[11929]: }
So the bug on staging is different than the bug on this issue. This issue is having a problem where certain outside forms are being created without an access code.
Might be from either:
Those both happened around the same time and the issues started occurring shortly after, as well it was working properly even an hour before those happened.
Looks like the production deployed is now logging this:
2022-03-22T23:06:30.155Z npmThe migration directory is corrupt, the following files are missing: 20220314233223_link-room-access-code.js
let oldAccessData = await AccessCode.getWithOutsideForm(
code,
- '[task.[template, transaction], room]',
+ 'outside_form.[task.[template, transaction], room]',
);
The big question remains:
How can we test these sorts of things?
It looks like app-1 might not be connecting outside forms correctly but app-2 is? That's just after some brief live testing. The main issue being when an outside_form is created it sometimes doesn't have an access_code attached to it.
Thoughts for testing:
/api/project_template/145/create
(145 is Attorney Engagement Link)PUT api/account/transaction/24525/set_resource
json: {
"Attorney": [
22389
]
}
GET /account/transaction/:transaction_id
and from there check if any connected outside forms don't have an access code. property we would check in the payload: payload.tasks[].outside_forms[].access_code
.GET /account/transaction/:transaction_id
right after you finalize, the outside_forms
haven't been connected yet, so I wait a few seconds and then hit that GET and then the outside_forms will be there. This is not happening on staging.@SHRoberts91 @danielandelin Fixed via https://github.com/savvi-legal/server/pull/471
Steps to Recreate.
Steps to recreate on Staging from services@savvi.legal: