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

UnhandledRejection error while loading the agent 1.235.0 #599

Closed
ilario-pierbattista opened this issue Jun 23, 2023 · 19 comments
Closed

UnhandledRejection error while loading the agent 1.235.0 #599

ilario-pierbattista opened this issue Jun 23, 2023 · 19 comments
Labels
bug Something isn't working needs triage

Comments

@ilario-pierbattista
Copy link

Description

Starting from yesterday evening (2023-06-22 17:00 UTC), I'm getting the following error while loading the agent in browsers with strict privacy settings:

UnhandledRejection
Non-Error promise rejection captured with value: undefined

It's similar to #392. In the browser console I see chunks loading failures, and then the error Uncaught (in promise).

The agent is injected dinamically in HTML by the PHP agent.

Steps to Reproduce

Use a browser with strict privacy settings. It will block the requests to https://js-agent.newrelic.com.

Expected Behavior

Even if the browser blocks the agent download I expect to get only warnings in console. Rejections should be handled.

Relevant Logs / Console output

Sample warnings:

New Relic: Downloading runtime APIs failed... 
New Relic: A problem occurred when starting up session manager. This page will not start or extend any session.
  ChunkLoadError: Loading chunk 860 failed.
  (error: https://js-agent.newrelic.com/860.e997904f-1.235.0.min.js)
New Relic: Downloading and initializing page_view_event failed...
  ChunkLoadError: Loading chunk 412 failed.
  (error: https://js-agent.newrelic.com/lazy-feature-loader.0ba331d7-1.235.0.min.js)
[...] and so on

Error:

Uncaught (in promise) undefined [A:6:32604](https://website/page)
    a https://website/page:6
    InterpretGeneratorResume self-hosted:1359
    AsyncFunctionThrow self-hosted:760
    (Asinc.: async)
    importAggregator https://website/page:6
    nrWrapper https://website/page:6
    (Asinc.: EventListener.handleEvent)
    nrWrapper https://website/page:6
    s https://website/page:6
    o https://website/page:6
    importAggregator https://website/page:6
    F https://website/page:6
    start https://website/page:6
    forEach self-hosted:203
    start https://website/page:6
    <anonima> https://website/page:6
    <anonima> https://website/page:6
    <anonima> https://website/page:6
    <anonima> https://website/page:6

Your Environment

  • php NR agent version: 10.5.0.317
  • the agent is configured to auto inject the js script

Additional context

Similar issues #392

@ilario-pierbattista ilario-pierbattista added bug Something isn't working needs triage labels Jun 23, 2023
@workato-integration
Copy link

@patrickhousley
Copy link
Contributor

Thanks for reporting this issue @ilario-pierbattista. We will investigate why the chunk loading errors are not being caught.

@AKovtunov
Copy link

I encountered the same issue, any solution?

@ilario-pierbattista
Copy link
Author

Hi @patrickhousley,

now it started to use the 1.236.0 version, and it started to fail with:

ChunkLoadError: Loading chunk 412 failed.
(error: https://js-agent.newrelic.com/lazy-feature-loader.2f55ce66-1.236.0.min.js)

It seems a regression of #392

@cwli24
Copy link
Contributor

cwli24 commented Jun 29, 2023

Warning logs or errors? I only see it as warnings which is working as intended. If it's a red error, which shouldn't be possible atm, then there's an issue. Silencing the warnings is not an option right now; as long as the agent is blocked, it will log those out.

@AKovtunov
Copy link

@cwli24 hi! Do you know when 1.236 will be available as a compiled JS snippet?

@ilario-pierbattista
Copy link
Author

@cwli24 nope, my bad, it was just a warning.
Some times it gives Unhandled Promise Rejection: Failed to fetch while posting to https://bam.nr-data.net.
Currently I'm not able to reproduce it, neither with a privacy strict browser.

@tavito
Copy link

tavito commented Jul 5, 2023

@cwli24 nope, my bad, it was just a warning. Some times it gives Unhandled Promise Rejection: Failed to fetch while posting to https://bam.nr-data.net. Currently I'm not able to reproduce it, neither with a privacy strict browser.

I'm getting the same error. It started on Jun 30...

@matejbasic
Copy link

Any progress with the Unhandled Promise Rejection: Failed to fetch error?
I was trying to reproduce it but without any success

@cwli24
Copy link
Contributor

cwli24 commented Jul 17, 2023

I think the issue might've been found in the fetch keep-alive call on unload when it fails. We have an open bug for that specifically.

@matejbasic
Copy link

thank you @cwli24

@patrickhousley
Copy link
Contributor

@matejbasic @ilario-pierbattista @tavito @matejbasic We recently released version 1.237.1 of the browser agent. Could you please let us know if this issue is still persisting? For APM injected apps, you may need to restart your APM instrumented applications.

@ilario-pierbattista
Copy link
Author

@patrickhousley it seems to be fixed, thanks

@tavito
Copy link

tavito commented Aug 4, 2023

@patrickhousley it seems to be fixed here too, thanks!

@vekien
Copy link

vekien commented Aug 10, 2023

Hello,

We are still getting version 1.236.0, we've cleared cache, redeployed (ecs+docker), rebuilt images, rebuilt php-agent, nothing is working and we're still getting 1.236.0

Has this not been published yet or something? It's causing us a huge amount of issues because it flags on Sentry, so we're hoping to get this fix ASAP.

@patrickhousley
Copy link
Contributor

@vekien Version 1.237.1 was published August 2nd. If you are using the PHP APM agent to inject the browser agent, you should only need to restart the application (which it seems you have done). Are you sure you are not using the copy/paste installation method? You may want to reach out to your New Relic support contact so the support team can further help.

@vekien
Copy link

vekien commented Aug 10, 2023

What is the copy/paste install method?

This is how we have our agent installed (it's Docker)

RUN wget https://download.newrelic.com/php_agent/archive/10.11.0.3/newrelic-php5-10.11.0.3-linux-musl.tar.gz \
    && tar -xf newrelic-php5-10.11.0.3-linux-musl.tar.gz \
    && cd newrelic-php5-10.11.0.3-linux-musl \
    && NR_INSTALL_USE_CP_NOT_LN=1 NR_INSTALL_SILENT=1 ./newrelic-install install
newrelic.browser_monitoring.auto_instrument = true

Screenshot 2023-08-10 at 18 28 37

And our application is still fetching 1.236.0, it's not cached either as we're getting thousands of Sentry's from over 100+ users and all our Devs are getting this same version. The Docker Tasks on ECS have been updated multiple times a day, so since the 2nd there has been well over 50+ new releases, so it has definitely restarted :D

Does the PHP-Agent not pull the latest? Do we have to wait for that to update?

@patrickhousley
Copy link
Contributor

@vekien You will want to reach out to the New Relic support team as this seems like a possible issue with the PHP APM agent. It should automatically get the newest version of the browser agent. We, the browser agent team, does not have any settings set right now to force this version. Sorry I could not help further.

@matejbasic
Copy link

matejbasic commented Aug 11, 2023

@patrickhousley no errors reported in a week, seems to be working fine now, thank you! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

7 participants