Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Central-Ledger] initial "OPEN" settlementWindow is failing on clean install #3152

Closed
mdebarros opened this issue Mar 2, 2023 · 1 comment
Assignees
Labels
bug Something isn't working or it has wrong behavior on a Mojaloop Core service core-dev-squad oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it

Comments

@mdebarros
Copy link
Member

mdebarros commented Mar 2, 2023

Summary:

Golden Path tests are failing on a new "fresh" deployment (including external backend dependencies).

This is due to Migration/Seeds (InitContainer) failing due to the following error when inserting the initial SettlementWindow on the Seed script seeds/settlementWindow2Open.js:

Working directory changed to /opt/app/config
Uploading seeds for initial settlementWindow has failed with the following error: AssertionError [ERR_ASSERTION]: The values in where clause must not be object or array.
Ran 23 seed files

This also results in the following error on the Fulfil Handler when allocating the "OPEN" settlementWindow:

TypeError: Cannot read properties of undefined (reading 'settlementWindowId')
    at /opt/app/src/models/transfer/facade.js:355:64
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {stack: 'TypeError: Cannot read properties of undefine…ions (node:internal/process/task_queues:96:5)', message: 'Cannot read properties of undefined (reading 'settlementWindowId')'}

Severity:
Critical

Priority:
High

Expected Behavior

  • Migration/Seeds should execute without error
  • GP Test-Collections should pass

Steps to Reproduce

  1. Deploy a new MySQL DB for Central-Ledger
  2. Run npm run migrate script

Specifications

  • Component (if known): Central-Ledger
  • Version: v17.0.0
  • Platform: n/a
  • Subsystem: n/a
  • Type of testing:
  • Bug found/raised by: @mdebarros

Notes:

  • Severity when opened: Critical
  • Priority when opened: High
@mdebarros mdebarros added bug Something isn't working or it has wrong behavior on a Mojaloop Core service core-dev-squad oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it labels Mar 2, 2023
@mdebarros
Copy link
Member Author

mdebarros commented Mar 2, 2023

PR for fix: mojaloop/central-ledger#946

This issue was introduced in Knex v2.4.0+ with the following change:

  • MySQL: Add assertion for basic where clause not to be object or array - knex/issues/#1227

mdebarros added a commit to mojaloop/central-ledger that referenced this issue Mar 2, 2023
…n install (#946)

fix(mojaloop/#3152): initial open settlementWindow is failing on clean install - mojaloop/project#3152
- updated seeds/settlementWindow2Open.js to
    - handle an array being returned from the knex.insert operation
    - to throw unexpected errors to force the migration scripts to hard fail, so we don't have a soft failure in future that requires deep "investigation" to find something that should be easily noticed
- fixed unit tests, improved descriptions and code-coverage

This issue was introduced in [Knex v2.4.0](https://github.com/knex/knex/releases/tag/2.4.0) with the following change:
- MySQL: Add assertion for basic where clause not to be object or array - [knex/issues/#1227](knex/knex#1227) - knex/knex#1227

chore: updated dependencies and fixed unit tests
- updated dependencies
- ~fixed api changes on Glob dependency~ (reverted due to a license issue with v9.x)
- Glob dependency added to upgrade exception list due to v9.x introducing a dependency Package "path-scurry@1.6.1" licensed under "BlueOak-1.0.0" which is not permitted by the Mojaloop License Policy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or it has wrong behavior on a Mojaloop Core service core-dev-squad oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it
Projects
None yet
Development

No branches or pull requests

2 participants