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

[Argus] fix: Parse Axios error before logging & exporting to the Elasticsearch #4944

Merged
merged 3 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions distributor-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Include response headers in `http` logs
- Disable open-api express response validation if NODE_ENV is set to 'production' or 'prod'. This should improve response times when serving assets.
- Include `nodeEnv` in `/api/v1/status` response, to help detect mis-configured nodes.
- **FIX** Axios Error Logging: Logging the error, when asset download from storage-node time outs, has been fixed to include the _only_ error message, response, status code and bunch of other fields. Previously, logging error object (which includes axios client instance), failed with `Converting circular structure to JSON` error and causing the distributor-node to crash.

### 1.3.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ export class NetworkingService {
})

objectDownloadQueue.on('error', (err) => {
this.logger.error('Download attempt from storage node failed after availability was confirmed:', { err })
this.logger.error('Download attempt from storage node failed after availability was confirmed:', {
err: parseAxiosError(err),
Copy link
Member

@mnaamani mnaamani Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If err is not an instance of AxiosError will parsing fail?

Perhaps parse only if axios.isAxiosError(err) == true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed here 8ebd130

})
})

objectDownloadQueue.on('end', () => {
Expand Down
Loading