-
Notifications
You must be signed in to change notification settings - Fork 15
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
ALS Logs print really really really long errors, making it difficult to debug #2017
Comments
Hey @lewisdaly, I can't seem to reproduce this. I have tried the following:
2021-05-31T10:20:37.613Z - error: {
"type": "application/json",
"id": "a73243d4-1e37-44da-870e-62891e704346",
"content": {
"error": {
"name": "FSPIOPError",
"cause": {
"message": "connect ECONNREFUSED 127.0.0.1:8444",
"name": "Error",
"stack": "Error: connect ECONNREFUSED 127.0.0.1:8444\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)",
"config": {
"url": "http://localhost:8444/oracle/participants/MSISDN/27713803912",
"method": "get",
"headers": {
"fspiop-source": "payerfsp",
"date": "Thu, 24 Jan 2019 10:22:12 GMT",
"authorization": "Bearer {{SIMPAYER_BEARER_TOKEN}}",
"user-agent": "PostmanRuntime/7.28.0",
"cache-control": "no-cache",
"postman-token": "0e29af5f-2a73-4a8e-9888-8964c253a0fd",
"accept-encoding": "gzip, deflate, br",
"connection": "keep-alive",
"traceid": "e8ec1a64-7825-40ea-aeb0-323e2dc99409",
"fspiop-destination": "switch",
"Accept": "application/vnd.interoperability.parties+json;version=1",
"Content-Type": "application/vnd.interoperability.parties+json;version=1.0"
},
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 0,
"responseType": "json",
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1
},
"code": "ECONNREFUSED"
},
"replyTo": "payerfsp",
"apiErrorCode": {
"code": "1001",
"message": "Destination communication error",
"name": "DESTINATION_COMMUNICATION_ERROR",
"type": {
"regex": "^10[0-9]{2}$",
"description": "Generic Communication Error",
"httpStatusCode": 503,
"name": "GENERIC_COMMUNICATION_ERROR"
},
"httpStatusCode": 503
},
"httpStatusCode": 503,
"extensions": [
{
"key": "cause",
"value": "[{\"key\":\"url\",\"value\":\"http://localhost:8444/oracle/participants/MSISDN/27713803912\"},{\"key\":\"sourceFsp\",\"value\":\"payerfsp\"},{\"key\":\"destinationFsp\",\"value\":\"switch\"},{\"key\":\"method\",\"value\":\"GET\"},{\"key\":\"request\",\"value\":\"{\\\"url\\\":\\\"http://localhost:8444/oracle/participants/MSISDN/27713803912\\\",\\\"method\\\":\\\"GET\\\",\\\"headers\\\":{\\\"accept\\\":\\\"application/vnd.interoperability.parties+json;version=1\\\",\\\"content-type\\\":\\\"application/vnd.interoperability.parties+json;version=1.0\\\",\\\"fspiop-source\\\":\\\"payerfsp\\\",\\\"date\\\":\\\"Thu, 24 Jan 2019 10:22:12 GMT\\\",\\\"authorization\\\":\\\"Bearer {{SIMPAYER_BEARER_TOKEN}}\\\",\\\"user-agent\\\":\\\"PostmanRuntime/7.28.0\\\",\\\"cache-control\\\":\\\"no-cache\\\",\\\"postman-token\\\":\\\"0e29af5f-2a73-4a8e-9888-8964c253a0fd\\\",\\\"accept-encoding\\\":\\\"gzip, deflate, br\\\",\\\"connection\\\":\\\"keep-alive\\\",\\\"traceid\\\":\\\"e8ec1a64-7825-40ea-aeb0-323e2dc99409\\\",\\\"fspiop-destination\\\":\\\"switch\\\"},\\\"responseType\\\":\\\"json\\\"}\"},{\"key\":\"errorMessage\",\"value\":\"connect ECONNREFUSED 127.0.0.1:8444\"}]"
}
],
"useMessageAsDescription": false,
"level": "\u001b[31merror\u001b[39m",
"timestamp": "2021-05-31T10:20:37.577Z",
"message": "Failed to send HTTP request to host",
"stack": "FSPIOPError: Failed to send HTTP request to host\n at Object.createFSPIOPError (/Users/mdebarros/Documents/work/projects/mojaloop/git/account-lookup-service/node_modules/@mojaloop/central-services-error-handling/src/factory.js:198:12)\n at Object.sendRequest (/Users/mdebarros/Documents/work/projects/mojaloop/git/account-lookup-service/node_modules/@mojaloop/central-services-shared/src/util/request.js:120:46)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)\nError: connect ECONNREFUSED 127.0.0.1:8444\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)"
}
},
"metadata": {
"event": {
"id": "db087103-495e-443f-80a0-9f59f0ea38e8",
"type": "log",
"action": "error",
"createdAt": "2021-05-31T10:20:37.613Z",
"state": {
"status": "failed",
"code": "1001",
"description": "Destination communication error"
}
},
"trace": {
"startTimestamp": "2021-05-31T10:20:37.465Z",
"service": "getPartiesByTypeAndID",
"traceId": "7d081c2f808b3a378d6a9032a0a11fdd",
"spanId": "557531853c6c61ea",
"parentSpanId": "58a8a1c1c60214c9",
"tags": {
"tracestate": "acmevendor=eyJzcGFuSWQiOiI1NTc1MzE4NTNjNmM2MWVhIn0=",
"transactionType": "party",
"transactionAction": "lookup",
"source": "payerfsp"
},
"tracestates": {
"acmevendor": {
"spanId": "557531853c6c61ea"
}
}
}
}
}
2021-05-31T10:18:50.873Z - error: {
"type": "application/json",
"id": "2bd3d14a-ecfd-4344-8e15-614d7f30a789",
"content": {
"error": {
"name": "FSPIOPError",
"apiErrorCode": {
"code": "3003",
"message": "Add Party information error",
"name": "ADD_PARTY_INFO_ERROR",
"type": {
"regex": "^30[0-9]{2}$",
"description": "Generic Client Error",
"httpStatusCode": 400,
"name": "GENERIC_CLIENT_ERROR"
},
"httpStatusCode": 400
},
"httpStatusCode": 400,
"useMessageAsDescription": false,
"level": "\u001b[31merror\u001b[39m",
"timestamp": "2021-05-31T10:18:50.841Z",
"message": "Oracle type: ALIAS not found",
"stack": "FSPIOPError: Oracle type: ALIAS not found\n at Object.createFSPIOPError (/Users/mdebarros/Documents/work/projects/mojaloop/git/account-lookup-service/node_modules/@mojaloop/central-services-error-handling/src/factory.js:198:12)\n at _getOracleEndpointByType (/Users/mdebarros/Documents/work/projects/mojaloop/git/account-lookup-service/src/models/oracle/facade.js:159:32)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)\n at async Object.exports.oracleRequest (/Users/mdebarros/Documents/work/projects/mojaloop/git/account-lookup-service/src/models/oracle/facade.js:65:13)\n at async Object.getPartiesByTypeAndID (/Users/mdebarros/Documents/work/projects/mojaloop/git/account-lookup-service/src/domain/parties/parties.js:70:24)"
}
},
"metadata": {
"event": {
"id": "dadbd803-0f7f-49af-ae3f-383ad012889c",
"type": "log",
"action": "error",
"createdAt": "2021-05-31T10:18:50.873Z",
"state": {
"status": "failed",
"code": "3003",
"description": "Add Party information error"
}
},
"trace": {
"startTimestamp": "2021-05-31T10:18:50.637Z",
"service": "getPartiesByTypeAndID",
"traceId": "91a77806e25fd75d635973a344ffcc11",
"spanId": "552a995ca5b76e62",
"parentSpanId": "abed7fc99fc0719b",
"tags": {
"tracestate": "acmevendor=eyJzcGFuSWQiOiI1NTJhOTk1Y2E1Yjc2ZTYyIn0=",
"transactionType": "party",
"transactionAction": "lookup",
"source": "payerfsp"
},
"tracestates": {
"acmevendor": {
"spanId": "552a995ca5b76e62"
}
}
}
}
} In both cases, I am unable to re-produce anything like your example above. Let me know when you are available to discuss this in more detail. |
Hmm looking at example #1 - my case has a |
Reproduced the issue in https://github.com/mojaloop/account-lookup-service/releases/tag/v11.1.2 release. The issue is no longer applicable to https://github.com/mojaloop/account-lookup-service/releases/tag/v11.5.0. I believe the reason is due to the upgrading of the |
Summary:
In the ALS, sometimes incredibly long errors are printed, making it very hard to debug issues (see below).
We should be printing error messages that only a few lines long, not the serializing the entire error object and printing it.
Severity:
(Low, Medium, High)
Priority:
(Critical, Medium, Low)
Expected Behavior
Steps to Reproduce
GET /participants
with anFSPIOP-Origin
header that isn't registered, which will cause a failure to lookup endpoints`Specifications
v11.1.2
Notes:
The text was updated successfully, but these errors were encountered: