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

POST Quotes fails when transactionId != transactionRequestId #2719

Closed
mdebarros opened this issue Mar 14, 2022 · 1 comment
Closed

POST Quotes fails when transactionId != transactionRequestId #2719

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

Comments

@mdebarros
Copy link
Member

Summary:

POST Quotes will fail when transactionId != transactionRequestId due to the following error:

2022-03-11T13:56:33.170Z - info: 2022-03-11T13:56:33.170Z, (1647006993142:moja2-quoting-service-6d96d7f749-42mr5:24:l0mg5uuj:10491) [quotesmodel]: Error in handleQuoteRequest for quoteId 10e95081-f6dd-48f8-9f08-3a7103a80718: FSPIOPError: insert into `quote` (`amount`, `amountTypeId`, `balanceOfPaymentsId`, `currencyId`, `expirationDate`, `note`, `quoteId`, `transactionInitiatorId`, `transactionInitiatorTypeId`, `transactionReferenceId`, `transactionRequestId`, `transactionScenarioId`, `transactionSubScenarioId`) values ('100.0000', 1, NULL, 'USD', NULL, DEFAULT, '10e95081-f6dd-48f8-9f08-3a7103a80718', 1, 1, 'f72fd595-2045-402b-b54d-c38f9f345f91', 'c2470148-1be2-4c0b-aece-aa8dcb92a6cc', 1, DEFAULT) - ER_NO_REFERENCED_ROW_2: Cannot add or update a child row: a foreign key constraint fails (`central_ledger`.`quote`, CONSTRAINT `quote_transactionrequestid_foreign` FOREIGN KEY (`transactionRequestId`) REFERENCES `transactionReference` (`transactionReferenceId`))
    at createFSPIOPError (/opt/quoting-service/node_modules/@mojaloop/central-services-error-handling/src/factory.js:198:12)
    at Object.reformatFSPIOPError (/opt/quoting-service/node_modules/@mojaloop/central-services-error-handling/src/factory.js:333:12)
    at CachedDatabase.createQuote (/opt/quoting-service/src/data/database.js:699:34)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
Error: ER_NO_REFERENCED_ROW_2: Cannot add or update a child row: a foreign key constraint fails (`central_ledger`.`quote`, CONSTRAINT `quote_transactionrequestid_foreign` FOREIGN KEY (`transactionRequestId`) REFERENCES `transactionReference` (`transactionReferenceId`))

This is caused by the following foreign key constraint:

CONSTRAINT `quote_transactionrequestid_foreign` FOREIGN KEY (`transactionRequestId`) REFERENCES `transactionReference` (`transactionReferenceId`),

Severity:
Medium

Priority:
Medium

Expected Behavior

POST Quotes should be successful when transactionId != transactionRequestId.

Steps to Reproduce

  1. Create a POST Quotes request with transactionId != transactionRequestId.

Specifications

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

Notes:

  • Severity when opened: medium
  • Priority when opened: medium
@mdebarros mdebarros added bug Something isn't working or it has wrong behavior on a Mojaloop Core service oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it labels Mar 14, 2022
@mdebarros mdebarros self-assigned this Mar 14, 2022
@mdebarros mdebarros changed the title POST Quotes will fail when transactionId != transactionRequestId POST Quotes fails when transactionId != transactionRequestId Mar 14, 2022
mdebarros added a commit to mdebarros/central-ledger that referenced this issue Mar 14, 2022
…ual transactionRequestId

fix(mojaloop/#2719): post quotes fails when transactionId does not equal transactionRequestId - mojaloop/project#2719
- added new migration script 500401_quote-2719.js to remove the transactionRequestId foreign key constraint that conflicts with transactionReferenceId foreign key constraint
- updated dependencies
- fixes for audit-resolve
@elnyry-sam-k elnyry-sam-k added this to the Sprint 17.4 milestone Mar 14, 2022
mdebarros added a commit to mojaloop/testing-toolkit-test-cases that referenced this issue Mar 14, 2022
…ual transactionrequestId

fix(mojaloop/#2719): post quotes fails when transactionId does not equal transactionRequestId - mojaloop/project#2719
- Added random UUID generated transactionRequestId to the Post Quotes requests in the P2P Happy Path test-case collection
mdebarros added a commit to mojaloop/central-ledger that referenced this issue Mar 14, 2022
…ual transactionRequestId (#887)

fix(mojaloop/#2719): post quotes fails when transactionId does not equal transactionRequestId - mojaloop/project#2719
- added new migration script 500401_quote-2719.js to remove the transactionRequestId foreign key constraint that conflicts with transactionReferenceId foreign key constraint
- updated dependencies
- fixes for audit-resolve
- sneaked in a fix for 910102_hotfix954.js as the revert script incorrectly dropped the entire table instead of just undoing the migration change
mdebarros added a commit to mojaloop/testing-toolkit-test-cases that referenced this issue Mar 14, 2022
…ual transactionrequestId (#68)

fix(mojaloop/#2719): post quotes fails when transactionId does not equal transactionRequestId - mojaloop/project#2719
- Added random UUID generated transactionRequestId to the Post Quotes requests in the P2P Happy Path test-case collection
mdebarros added a commit to mojaloop/helm that referenced this issue Mar 14, 2022
…ual transactionrequestId

- upgraded central-ledger from v13.16.0 to v13.16.1 to fix mojaloop/project#2719
- updated v13.1.0 release notes
@mdebarros mdebarros reopened this Mar 14, 2022
@mdebarros
Copy link
Member Author

Issue tested with v13.1.0 release with updated TTK v13.1.0 Test Collection.

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 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