paperos-labs / feedback

Just a bug and ideas board
0 stars 0 forks source link

Standing Forms are broken on live and staging #207

Closed danielandelin closed 2 years ago

danielandelin commented 2 years ago

Steps to Recreate.

  1. Go to any investment vehicle account or Cultivation 4, a series of Cultivation Ventures, LLC
  2. Open Allocation Request for Series LLC Subscription
  3. Submit the Task
  4. Click on the Standing Form Link

Steps to recreate on Staging from services@savvi.legal:

  1. Select the company 'Mode Inc.'
  2. Go to Workflows View
  3. Select 'Attorney Engagement Link' Workflow.
  4. Submit Task
  5. On the right side, copy the Standing Form Link 'Engage with Mode, Inc.'
  6. where access code should be in the copied url it is null.

image

coolaj86 commented 2 years ago

In the future can you copy the error code so we can find it more easily.

wmerfalen commented 2 years ago

5FmoweVY

wmerfalen commented 2 years ago

@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]: }
SHRoberts91 commented 2 years ago

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:

  1. the data migration when some of those commits were deployed to live, or from
  2. sql-copy-tools when staging isn't aligned with production

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

coolaj86 commented 2 years ago
    let oldAccessData = await AccessCode.getWithOutsideForm(
      code,
-      '[task.[template, transaction], room]',
+      'outside_form.[task.[template, transaction], room]',
    );
coolaj86 commented 2 years ago

The big question remains:

How can we test these sorts of things?

SHRoberts91 commented 2 years ago

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:

coolaj86 commented 2 years ago

@SHRoberts91 @danielandelin Fixed via https://github.com/savvi-legal/server/pull/471