Closed kleyow closed 4 years ago
central-ledger | 2020-09-02T23:21:22.218Z - error: ::Cannot read property 'mimeType' of null--P0
central-ledger | 2020-09-02T23:21:22.218Z - error: {
central-ledger | "type": "application/json",
central-ledger | "id": "cb24a751-8345-4a91-b559-fb4e7f062e0c",
central-ledger | "content": {
central-ledger | "error": {
central-ledger | "name": "FSPIOPError",
central-ledger | "cause": "TypeError: Cannot read property 'mimeType' of null\n at parseDecodedDataToJson (/opt/central-ledger/node_modules/@mojaloop/central-services-shared/src/util/streaming/protocol/index.js:246:74)\n at decodePayload (/opt/central-ledger/node_modules/@mojaloop/central-services-shared/src/util/streaming/protocol/index.js:254:9)\n at prepare (/opt/central-ledger/src/handlers/transfers/handler.js:106:21)\n at /opt/central-ledger/node_modules/@mojaloop/central-services-stream/src/kafka/consumer.js:393:25\n at /opt/central-ledger/node_modules/async/dist/async.js:3201:13\n at Object.process (/opt/central-ledger/node_modules/async/dist/async.js:1427:21)\n at /opt/central-ledger/node_modules/async/dist/async.js:1285:23\n at Immediate._onImmediate (/opt/central-ledger/node_modules/async/dist/async.js:73:45)\n at processImmediate (internal/timers.js:456:21)",
central-ledger | "apiErrorCode": {
central-ledger | "code": "2001",
central-ledger | "message": "Internal server error",
central-ledger | "name": "INTERNAL_SERVER_ERROR",
central-ledger | "type": {
central-ledger | "regex": "^20[0-9]{2}$",
central-ledger | "description": "Generic Server Error",
central-ledger | "httpStatusCode": 500,
central-ledger | "name": "GENERIC_SERVER_ERROR"
central-ledger | },
central-ledger | "httpStatusCode": 500
central-ledger | },
central-ledger | "httpStatusCode": 500,
central-ledger | "useMessageAsDescription": false,
central-ledger | "message": "Cannot read property 'mimeType' of null",
central-ledger | "stack": "FSPIOPError: Cannot read property 'mimeType' of null\n at createFSPIOPError (/opt/central-ledger/node_modules/@mojaloop/central-services-error-handling/src/factory.js:198:12)\n at Object.reformatFSPIOPError (/opt/central-ledger/node_modules/@mojaloop/central-services-error-handling/src/factory.js:319:12)\n at prepare (/opt/central-ledger/src/handlers/transfers/handler.js:235:46)\n at /opt/central-ledger/node_modules/@mojaloop/central-services-stream/src/kafka/consumer.js:393:25\n at /opt/central-ledger/node_modules/async/dist/async.js:3201:13\n at Object.process (/opt/central-ledger/node_modules/async/dist/async.js:1427:21)\n at /opt/central-ledger/node_modules/async/dist/async.js:1285:23\n at Immediate._onImmediate (/opt/central-ledger/node_modules/async/dist/async.js:73:45)\n at processImmediate (internal/timers.js:456:21)\nTypeError: Cannot read property 'mimeType' of null\n at parseDecodedDataToJson (/opt/central-ledger/node_modules/@mojaloop/central-services-shared/src/util/streaming/protocol/index.js:246:74)\n at decodePayload (/opt/central-ledger/node_modules/@mojaloop/central-services-shared/src/util/streaming/protocol/index.js:254:9)\n at prepare (/opt/central-ledger/src/handlers/transfers/handler.js:106:21)\n at /opt/central-ledger/node_modules/@mojaloop/central-services-stream/src/kafka/consumer.js:393:25\n at /opt/central-ledger/node_modules/async/dist/async.js:3201:13\n at Object.process (/opt/central-ledger/node_modules/async/dist/async.js:1427:21)\n at /opt/central-ledger/node_modules/async/dist/async.js:1285:23\n at Immediate._onImmediate (/opt/central-ledger/node_modules/async/dist/async.js:73:45)\n at processImmediate (internal/timers.js:456:21)"
central-ledger | }
central-ledger | },
central-ledger | "metadata": {
central-ledger | "event": {
central-ledger | "id": "2509e5c0-37b9-4448-8448-4b5081685b32",
central-ledger | "type": "log",
central-ledger | "action": "error",
central-ledger | "createdAt": "2020-09-02T23:21:22.218Z",
central-ledger | "state": {
central-ledger | "status": "failed",
central-ledger | "code": "2001",
central-ledger | "description": "Internal server error"
central-ledger | }
central-ledger | },
central-ledger | "trace": {
central-ledger | "startTimestamp": "2020-09-02T23:21:22.216Z",
central-ledger | "service": "cl_transfer_prepare",
central-ledger | "traceId": "8d68a73de75eabb801559e4f6e16e2a6",
central-ledger | "spanId": "0b8e11091defb171",
central-ledger | "parentSpanId": "b52cb9aa5e148098",
central-ledger | "tags": {
central-ledger | "tracestate": "acmevendor=eyJzcGFuSWQiOiIwYjhlMTEwOTFkZWZiMTcxIiwidGltZUFwaVByZXBhcmUiOiIxNTk5MDg4ODgyMjEyIn0=",
central-ledger | "transactionType": "transfer",
central-ledger | "transactionAction": "prepare",
central-ledger | "transactionId": "d1f281d1-ae19-4f7a-bb99-73ba93534e01",
central-ledger | "source": "dfspa",
central-ledger | "destination": "dfspb",
central-ledger | "payerFsp": "dfspa",
central-ledger | "payeeFsp": "dfspb"
central-ledger | },
central-ledger | "tracestates": {
central-ledger | "acmevendor": {
central-ledger | "spanId": "0b8e11091defb171",
central-ledger | "timeApiPrepare": "1599088882212"
central-ledger | }
central-ledger | }
central-ledger | }
central-ledger | }
central-ledger | }
:thinking:
Oh boy this looks like its going to be rabbit hole... We never validated when we synced central-ledger pisp/master to 10.3.1 -> 10.5.2
This might need a full upgrade of all the pisp services or me isolating where in the switch this mimetype
is not getting populated and a github search of "mimetype" in mojaloop org gives me little to go on.
Hmm this is going to be a pain... It looks like something to do with the streaming libraries.
@kleyow is there a specific request this is happening for?
I believe it's when it's a /transfer
request sent to the ml-api-adapter.
I might try bumping ml-api-adapter pisp image first...tomorrow. Getting off for the night soon.
@kleyow @lewisdaly @eoln
{
"type":"TP_CB_URL_TRANSACTION_REQUEST_POST",
"value":"http://host.docker.internal:6000/thirdpartyRequests/transactions"
},
{
"type":"TP_CB_URL_TRANSACTION_REQUEST_PUT",
"value":"http://host.docker.internal:6000/thirdpartyRequests/transactions/{ID}"
}
If we populate full path here, then these details are not required in central-shared-services
FspEndpointTemplates enum
Initial thought was will maintain only host details in DB and path in central-shared-services enum
https://github.com/mojaloop/central-services-shared/blob/master/src/enums/endpoints.js#L106
and also changes require in thirdparty-api-adapter
, otherwise path will be appended twice.
https://github.com/mojaloop/thirdparty-api-adapter/blob/master/src/server/handlers/thirdpartyRequests/transactions.ts#L65
https://github.com/mojaloop/thirdparty-api-adapter/blob/master/src/domain/thirdpartyRequests/transactions.ts#L79
@kleyow @lewisdaly @eoln
{ "type":"TP_CB_URL_TRANSACTION_REQUEST_POST", "value":"http://host.docker.internal:6000/thirdpartyRequests/transactions" }, { "type":"TP_CB_URL_TRANSACTION_REQUEST_PUT", "value":"http://host.docker.internal:6000/thirdpartyRequests/transactions/{ID}" }
If we populate full path here, then these details are not required in
central-shared-services
FspEndpointTemplates enum Initial thought was will maintain only host details in DB and path in central-shared-services enum https://github.com/mojaloop/central-services-shared/blob/master/src/enums/endpoints.js#L106and also changes require in
thirdparty-api-adapter
, otherwise path will be appended twice. https://github.com/mojaloop/thirdparty-api-adapter/blob/master/src/server/handlers/thirdpartyRequests/transactions.ts#L65 https://github.com/mojaloop/thirdparty-api-adapter/blob/master/src/domain/thirdpartyRequests/transactions.ts#L79
Oh my gosh, rabbit holes everywhere...
Thanks for pointing this out @sridharvoruganti - yeah I think we just want to keep the hostname here, and rely on the FspEndpointTemplates
to enforce the structure.
Ok. Removed the paths from the values. Updated services to fix the broken tests. todo: update every other service so we don't drag behind master branches too much. @eoln @lewisdaly @sridharvoruganti
I know postman collection is pretty un-reviewable. Here are the endpoints when you ping the ledger. I'm not sure if should leave the url params as {{ID}} fo now or make them more specific.
PISP - Endpoints
DFSPA
DFSPB