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

Random "Invalid dependency graph created, cycle detected" #10098

Closed
chriswdmr opened this issue Dec 11, 2019 · 13 comments · Fixed by #10280
Closed

Random "Invalid dependency graph created, cycle detected" #10098

chriswdmr opened this issue Dec 11, 2019 · 13 comments · Fixed by #10280

Comments

@chriswdmr
Copy link

Provide the steps to reproduce

I run LH programmatically from 6 different locations in parallel.
When I do that, all reports are correct and without any errors except for 1 or 2.
They show a "Invalid dependency graph created, cycle detected". This is very odd since all other tests/reports are passing.

URL which I tested: https://www.netlify.com

If needed, I can provide all 6 reports.

What is the current behavior?

Sometimes a random "Invalid dependency graph created, cycle detected" occurs.

What is the expected behavior?

No random "Invalid dependency graph created, cycle detected" errors

Environment Information

  • Lighthouse version: 5.6.0
  • Chrome version: 79.0.3945.0
  • Node.js version: 10
  • Puppeteer version: 2.0.0
@patrickhulce
Copy link
Collaborator

Thanks for filing @wolle404! Would you be able to provide the trace of one of these instances? The trace is .trace.json file produced by running from CLI with --save-assets or the file you open by clicking View Trace in DevTools.

@chriswdmr
Copy link
Author

Hey @patrickhulce, I've created a gist with the report and the trace.

https://gist.github.com/wolle404/100a71ce6cf95b6a0257dd1ab9b6da8a

@patrickhulce
Copy link
Collaborator

Thanks very much for the gist @wolle404!

@patrickhulce
Copy link
Collaborator

Hm @wolle404 this is from one of the runs that failed? I'm not able reproduce that error with this trace and devtools log :/

@chriswdmr
Copy link
Author

chriswdmr commented Dec 13, 2019

Hey @patrickhulce, yes that should be the correct trace.
The trace is extracted from the lighthouse function I call. I trigger lighthouse with/through puppeteer.
I got each trace from artifacts:

const { lhr, artifacts } = await createLighthouseReport(url)

Is this right? I can provide more data if needed.

I also created a repo with all reports and traces I get:
https://github.com/wolle404/lh-issue-10098

Edit:
In case this is relevant - here are all arguments for chrome:

[ '--disable-background-timer-throttling',
  '--disable-breakpad',
  '--disable-client-side-phishing-detection',
  '--disable-cloud-import',
  '--disable-default-apps',
  '--disable-dev-shm-usage',
  '--disable-extensions',
  '--disable-gesture-typing',
  '--disable-hang-monitor',
  '--disable-infobars',
  '--disable-notifications',
  '--disable-offer-store-unmasked-wallet-cards',
  '--disable-offer-upload-credit-cards',
  '--disable-popup-blocking',
  '--disable-print-preview',
  '--disable-prompt-on-repost',
  '--disable-setuid-sandbox',
  '--disable-speech-api',
  '--disable-sync',
  '--disable-tab-for-desktop-share',
  '--disable-translate',
  '--disable-voice-input',
  '--disable-wake-on-wifi',
  '--disk-cache-size=33554432',
  '--enable-async-dns',
  '--enable-simple-cache-backend',
  '--enable-tcp-fast-open',
  '--enable-webgl',
  '--hide-scrollbars',
  '--ignore-gpu-blacklist',
  '--media-cache-size=33554432',
  '--metrics-recording-only',
  '--mute-audio',
  '--no-default-browser-check',
  '--no-first-run',
  '--no-pings',
  '--no-sandbox',
  '--no-zygote',
  '--password-store=basic',
  '--prerender-from-omnibox=disabled',
  '--use-gl=swiftshader',
  '--use-mock-keychain',
  '--memory-pressure-off',
  '--single-process' ]

@rgembalik
Copy link

rgembalik commented Jan 30, 2020

I see similar results when running inside an AWS lambda. The Page I am testing is some random shop - https://www.chewy.com/. This produces an Invalid dependency graph at least in half of the executions. The execution itself takes much longer than with other sites.

Any idea of how could one prevent such errors from occurring? I do have reports and trace available (the trace is stringified JSON from artefacts). The trace is quite long, so I have no idea how to read it and extract any info from it on my own.
invalid-dep-graph-chewy.zip

@patrickhulce
Copy link
Collaborator

@rgembalik do you still get this behavior with 5.6.0? Many of the cyclic graph errors were fixed between 4.3.1 and 5.6.0.

If you do, would you be able to capture the devtoolslog.json in addition to the trace? I'd be happy to take a look at what's going on.

@chriswdmr
Copy link
Author

I'm using ^5.6.0 in my app.

@rgembalik can you give an example how to get the devtoolslog.json?

Thanks!

@patrickhulce
Copy link
Collaborator

@wolle404 you provided both already I just couldn't reproduce the error message with the artifacts you gave me. I'll try again with your repo.

@rgembalik 's report was produced with 4.3.1 which is why I asked to try with 5.6.0.

@patrickhulce
Copy link
Collaborator

Ah, found your bug with one of your other traces thanks @wolle404! 🎉 PR incoming

@rgembalik
Copy link

rgembalik commented Jan 31, 2020

@patrickhulce Unfortunately the issue persists after updating to 5.6.0. BTW, thanks for pointing that out! I feel stupid for not checking that out myself. There is still a seemingly random chance of report being broken. I am including the results package.

invalid-dep-graph-chewy-5.6.0.zip

Could you, please, tell me how can I get devtoolslog.json from within the artifacts key? I am operating on the remote environment, so I have no possibility to launch the LH reporting via CLI.

@patrickhulce
Copy link
Collaborator

Could you, please, tell me how can I get devtoolslog.json from within the artifacts key?

it should be the value in devtoolsLogs.defaultPass

@rgembalik
Copy link

@patrickhulce Hey, sorry for the delay and thank you for hinting the correct key. Here's report + trace + devtoolsLog from the faulty test:
invalid-dep-graph-chewy.zip
If I can do anything else to help to analyse this issue, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants