GoodDAPP icon indicating copy to clipboard operation
GoodDAPP copied to clipboard

AxiosError: syncTxFromExplorer failed: Network Error

Open sentry-io[bot] opened this issue 1 year ago • 16 comments

I've merged 4 network error issues to this one (you can see them by clicking the merged issues tab in sentry)

Can we safely ignore and not report Network error and network request error?

Sentry Issue: GOODDAPP-5VXW

AxiosError: syncTxFromExplorer failed: Network Error
  at request.onerror (../node_modules/axios/lib/adapters/xhr.js:149:14)
  at sentryWrapped (../node_modules/@sentry/browser/esm/helpers.js:86:17)

sentry-io[bot] avatar Dec 24 '23 08:12 sentry-io[bot]

@johnsmith-gooddollar we are prioritizing this for sprint 6 - can you confirm you are accountable and will own this ticket?

decentralauren avatar Jan 09 '24 14:01 decentralauren

@L03TJ3

johnsmith-gooddollar avatar Jan 10 '24 12:01 johnsmith-gooddollar

Should we log or not? @johnsmith-gooddollar @sirpy analyzed a bunch of the reported issues

syncFromExplorer:

  • not finished in 5 seconds is the warn (could increase, but basically someone just has slow internet?)
  • a bunch of rpc's are rejected because of 'too many requests' ceramic failed:
  • IPFS request failed? (not sure about this one)
  • read streams failed (has 5 second syncTimeout, related to slow connection?) RealmDb:
  • query failed after retries (cannot find connection to realmdb? user seems not even logged in)

Something with codepusH?: codepush-event

and the question.. should we completely hide network errors from logging: https://github.com/GoodDollar/GoodDAPP/pull/4192 or are there places where some of the above information is relevant?

L03TJ3 avatar Jan 23 '24 23:01 L03TJ3

@L03TJ3 warnings are irrelevant we are only talking about errors which are logged to sentry. Usually i'd say network errors are related to user connection problems but it might be also be an issue with a specific url/domain, temporarily down, or maybe a typo.

@johnsmith-gooddollar @L03TJ3 if we can log the url that failed it might make more sense, and also perhaps make sure we log the url only once per session/refresh

sirpy avatar Jan 24 '24 07:01 sirpy

@sirpy if any errors are caused by due to faulty rpc errors and are not picked up by any other the faulty rpc's will be shown in the stack trace on sentry still. no need to log them all imo

The ones regularly complaining about threshold are: nodies onfinality

at least the ones I noticed

L03TJ3 avatar Jan 25 '24 12:01 L03TJ3

@L03TJ3 if for example we put a wrong rpc address with a typo, the logger will ignore any errors with this rpc. what make you say that this errors will be logged elsewhere?

sirpy avatar Jan 25 '24 12:01 sirpy

@sirpy What I basically meant was that if there is an error from the app caused by a faulty rpc, then the stacktrace would show all the rpc's that were attempted, and we could catch/resolve if there a rpc failing cause of a human error or something.

besides that, what I now see is that any error/warning has been silenced and wrapped with !isConnectionError, so whatever meant is not usefull anyway

reference which warnings I would expect to see in a stack strace: https://github.com/GoodDollar/GoodDAPP/blob/4e98a611109011a1281dd924c8f26b2148ca673b/src/lib/wallet/MultipleHttpProvider.js#L69

L03TJ3 avatar Jan 25 '24 14:01 L03TJ3

@L03TJ3 warnings are irrelevant we are only talking about errors which are logged to sentry. Usually i'd say network errors are related to user connection problems but it might be also be an issue with a specific url/domain, temporarily down, or maybe a typo.

@johnsmith-gooddollar @L03TJ3 if we can log the url that failed it might make more sense, and also perhaps make sure we log the url only once per session/refresh

@johnsmith-gooddollar can we do that? log url that failed once?

sirpy avatar Jan 26 '24 08:01 sirpy

@johnsmith-gooddollar

sirpy avatar Jan 30 '24 09:01 sirpy

@sirpy @L03TJ3 After some additional research I've found it's not easy to do And even impossible in some cases because we cannot always get failing url from the exception :

a) we could get failed URL from axios error b) we could understand which http provider failed

In the other cases (e.g. failed fetch() to XMLHTTPRequest() from some liberary like realmdb) we cannot obtain url has failed with the network error.

So what I've done

  • I added separate loggers to axios instances we use and to the MultipleHTTPProvider: https://github.com/GoodDollar/GoodDAPP/commit/b3db63296222c9c6f1a7e8662c39a9081180206e https://github.com/GoodDollar/GoodDAPP/commit/224e35c5f48c228b128f96e5cce76bd92aac703f
  • I suppressed logging network errors globally over the whole app https://github.com/GoodDollar/GoodDAPP/commit/8af89dd492574e0d364f3dafef8497e68af13368

johnsmith-gooddollar avatar Jan 30 '24 12:01 johnsmith-gooddollar

@johnsmith-gooddollar i've added comments on the commits. please use PR next time

sirpy avatar Jan 31 '24 12:01 sirpy

@sirpy

this should be per url not host

Fixed

log.error? but now it will not single time eerrors about urls

  • log.error now filters errors received and do not log any network/connection errors
  • log.exception is unchanged copy of log.error which logs everything. it used in the places we log urls once per session

restore pcallback it is overwriting another function called callback

Fixed

johnsmith-gooddollar avatar Feb 01 '24 11:02 johnsmith-gooddollar

@johnsmith-gooddollar i've added comments on the commits. please use PR next time

https://github.com/GoodDollar/GoodDAPP/pull/4211

johnsmith-gooddollar avatar Feb 01 '24 11:02 johnsmith-gooddollar

@vldkhh verify on prod

L03TJ3 avatar Feb 12 '24 04:02 L03TJ3

@L03TJ3 need to recheck - https://gooddollar.sentry.io/issues/2845295278/?project=1829798&referrer=github_integration

vldkhh avatar Feb 23 '24 12:02 vldkhh

@vldkhh I think this can be rechecked as well

L03TJ3 avatar Mar 01 '24 08:03 L03TJ3

verified on prod image.png

vldkhh avatar Apr 11 '24 15:04 vldkhh