Skip to content

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

Merged
mnaamani merged 3 commits intoJoystream:masterfrom
zeeshanakram3:argus_log_parsed_axios_error
Oct 24, 2023
Merged

[Argus] fix: Parse Axios error before logging & exporting to the Elasticsearch#4944
mnaamani merged 3 commits intoJoystream:masterfrom
zeeshanakram3:argus_log_parsed_axios_error

Conversation

@zeeshanakram3
Copy link
Copy Markdown
Contributor

Problem

Thanks to @kdembler for investigation

it seems that full axios client is logged with error and we are trying to serialize it including buffers for sending to elastic
which fails because of circular reference

Copy link
Copy Markdown
Collaborator

@kdembler kdembler left a comment

Choose a reason for hiding this comment

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

LGTM 🫡

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

@mnaamani mnaamani self-requested a review October 24, 2023 08:40
@mnaamani mnaamani merged commit 2939a86 into Joystream:master Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants