Closed zepumph closed 1 year ago
That version works great for me on windows, but @jonathanolson and @samreid have failures when trying to call page.close()
, which we do a lot. The error is something like "Target closed"
@samreid found this, which is the same error, but when opening a page, which we aren't finding to be a problem: https://github.com/puppeteer/puppeteer/issues/7916
Anyways, it looks easiest and best for now to just bring perennial up to version 10, and keep chipper the same.
This is good enough for now. We are upgrade again once we NEED to.
In general we are not excited about this issue, and this solution. Here are a couple reasons:
page.close()
@zepumph discovered that running cleanup
before resolve
in generate-phet-io-api enabled compatibility with puppeteer 13, so we would like to proceed with that.
We saw this error on CT:
Error: Could not find browser revision 818858. Run "PUPPETEER_PRODUCT=firefox npm install" or "PUPPETEER_PRODUCT=firefox yarn install" to download a supported Firefox browser binary.
So @zepumph and I agreed to update aqua's version of puppeteer as well.
The issue was reported by the CT quick server and by @mattpen from the build-server side. For CT, SR and I have "fixed" the problem by stopping the service, running prune/update commands in chipper, perennial ,and perennial-alias, and restarting the server.
I ran the prune/update commands on phet-server2. @jbphet - to verify if this fixes the problem we'll need to resubmit the latest swahili translation of balancing-act.
@jbphet reran the translation and it worked successfully.
Back to you for any further steps @zepumph
@pixelzoom reported:
Since yesterday’s puppeteer upgrade, many sims are failing the CT “build” test with: AssertionError [ERR_ASSERTION]: Full API expected but not created from puppeteer step, likely caused by https://github.com/phetsims/chipper/issues/1022. This used to happen once in awhile, but is now occurring more often, and for more sims.
@samreid, I'm worried about our fix in the PhET-iO API generation, because it looks like @jonathanolson made https://github.com/phetsims/chipper/commit/c30502c26d3a6f30c9fe7dbcdfad9ae2ecf9edfc, and I'm seeing the resurgence of
"Error: Navigation failed because browser has disconnected!"
@jonathanolson, can we pair on this sometime soon?
Is that problem only happening on CT? We have been able to deploy phet-io RCs without a problem.
If it is the same issue as it presents as from https://github.com/phetsims/chipper/issues/1032 and https://github.com/phetsims/perennial/issues/229, it is a race condition based on something like threads and CPU availability. I have not yet hit it locally while building phet-io sims or generating APIs, but in those issues we did.
I logged into CT and ran a two builds and generate-phet-io-api
calls. Both builds succeeded, and 5/6 grunt generate-phet-io-api
calls succeeded. The failed one reported:
[reids@bayes center-and-variability]$ grunt generate-phet-io-api --temporary
Running "generate-phet-io-api" task
Error in fulfilling chunk Promise: TimeoutError: Navigation timeout of 30000 ms exceeded
at /data/share/phet/continuous-testing/chipper/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:108:111
Fatal error: Perennial task failed:
AssertionError [ERR_ASSERTION]: api expected
at module.exports (/data/share/phet/continuous-testing/chipper/js/phet-io/formatPhetioAPI.js:41:3)
at /data/share/phet/continuous-testing/chipper/js/grunt/Gruntfile.js:567:37
at Array.forEach (<anonymous>)
at /data/share/phet/continuous-testing/chipper/js/grunt/Gruntfile.js:564:12
at async wrap (/data/share/phet/continuous-testing/chipper/js/grunt/Gruntfile.js:56:7)
Full Error details:
AssertionError [ERR_ASSERTION]: api expected
@KatieWoe asked about this problem today, it's affecting sims frequently in CT. The reports in CT generally look like this, where the first error message is "Full API expected but not created from puppeteer step".
hookes-law : build
Build failed with status code 1:
Running "report-media" task
Running "clean" task
Running "build" task
>> TypeScript compilation complete: 8114ms
12:25:15 PM, 417 ms: ../hookes-law/js/common/HookesLawColors.js
12:25:15 PM, 49 ms: ../hookes-law/js/common/HookesLawConstants.js
...
12:25:18 PM, 26 ms: ../hookes-law/js/systems/view/SystemsViewProperties.js
12:25:18 PM, 37 ms: ../hookes-law/js/systems/view/SystemsVisibilityPanel.js
Building runnable repository (hookes-law, brands: phet, phet-io)
Building brand: phet
>> Webpack build complete: 7497ms
>> Production minification complete: 37950ms (1753728 bytes)
>> Debug minification complete: 0ms (19321861 bytes)
Building brand: phet-io
>> Webpack build complete: 5819ms
>> Production minification complete: 33686ms (1787148 bytes)
>> Debug minification complete: 34475ms (2101456 bytes)
>> No client guides found at ../phet-io-client-guides/hookes-law/, no guides being built.
>> TypeScript compilation complete: 1194ms
Fatal error: Perennial task failed:
AssertionError [ERR_ASSERTION]: Full API expected but not created from puppeteer step, likely caused by https://github.com/phetsims/chipper/issues/1022.
at module.exports (/data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/js/grunt/copySupplementalPhetioFiles.js:323:5)
at async module.exports (/data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/js/grunt/buildRunnable.js:355:5)
at async /data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/js/grunt/Gruntfile.js:283:11
at async wrap (/data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/js/grunt/Gruntfile.js:56:7)
Full Error details:
AssertionError [ERR_ASSERTION]: Full API expected but not created from puppeteer step, likely caused by https://github.com/phetsims/chipper/issues/1022.
Error in fulfilling chunk Promise: Error: Navigation failed because browser has disconnected!
at /data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:51:147
at /data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:62
at Array.map (<anonymous>)
at Object.emit (/data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/node_modules/puppeteer/lib/cjs/vendor/mitt/src/index.js:51:43)
at CDPSession.emit (/data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/node_modules/puppeteer/lib/cjs/puppeteer/common/EventEmitter.js:72:22)
at CDPSession._onClosed (/data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:271:14)
at Connection._onMessage (/data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:105:25)
at WebSocket.<anonymous> (/data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/node_modules/puppeteer/lib/cjs/puppeteer/node/NodeWebSocketTransport.js:13:32)
at WebSocket.onMessage (/data/share/phet/continuous-testing/ct-snapshots/1649697426084/chipper/node_modules/ws/lib/event-target.js:199:18)
at WebSocket.emit (events.js:315:20)
Snapshot from 4/11/2022, 11:17:06 AM
It sounds like @zepumph intends to collaborate with @jonathanolson on this issue, self-unassigning for now.
In https://github.com/phetsims/chipper/commit/83f31efea564645d9282d10b4e9e36e14165767d @jonathanolson and I made good progress in error handling for API generation. In general that has gotten rid of the error we were seeing all over the place, https://github.com/phetsims/perennial/issues/268#issuecomment-1095431686.
I am still seeing some error potentially in the same spot during the build (API generation), like this:
ratio-and-proportion : build
Build failed with status code 3:
Running "report-media" task
Running "clean" task
Running "build" task
>> TypeScript compilation complete: 10093ms
Building runnable repository (ratio-and-proportion, brands: phet, phet-io)
Building brand: phet
>> Webpack build complete: 8724ms
>> Production minification complete: 48566ms (2141060 bytes)
>> Debug minification complete: 1ms (20580623 bytes)
Building brand: phet-io
>> Webpack build complete: 6681ms
>> Production minification complete: 42176ms (2174317 bytes)
>> Debug minification complete: 42491ms (2489796 bytes)
>> No client guides found at ../phet-io-client-guides/ratio-and-proportion/, no guides being built.
>> TypeScript compilation complete: 1165ms
Fatal error: Protocol error: Connection closed. Most likely the page has been closed.
Snapshot from 4/20/2022, 3:33:58 AM
@jonathanolson FYI,
Any idea what is causing this? Possibly CPU or memory limits? (What happens if we try to run 100 copies of things at the same time?)
Yeah. That is a good idea, though I'm unsure how to do that locally. It seems like too much of a space constrain to have that many checkouts. Perhaps we can adapt CTQ to kick off 100 puppeteer loads and see if we can recreate.
Perhaps the issue is that there is just one error/exit hook we are missing from Puppeteer that we could use to trigger a retry. Like on browser crash or something.
Today for https://github.com/phetsims/phet-io/issues/1848 @zepumph and I tried checking out grunt checkout-shas
for gravity-and-orbits 1.5 and got this error during npm install:
We think this means we may need to maintenance release updated puppeteer versions.
@jonathanolson and I think that the "Error: Navigation failed because browser has disconnected!" problems are not related to this issue. But instead because we are doing killall chrome
on bayes, which breaks builds sometimes. The only thing left for this issue is to MR puppeteer so that previous PhET-iO sims can still build.
We did one manual patch for this in Natural Selection 1.4
@samreid and @jonathanolson ran into some build failures such that it looks like even phet brand sims that don't run puppeteer are still having a build failure on old versions of puppeteer. We should MR all sims with PUppeteer in the package.json. We also found that this failed when npm installing perennial-alias as well, so I believe that we have to do that repo too.
@jonathanolson just ran into the MR stuff around this for another MR. I'm so sorry!!!! We are discussing and want to proceed with this MR.
I see that the new latest version is 19.2.2. We should update to that on master and then also propagate that to old versions too.
I committed a revert commit on the perennial one to test https://github.com/phetsims/gravity-and-orbits/issues/479#issuecomment-1319496893
I don't know if I need to restart the build server to pick up perennial package.json changes.
It seems the build succeeded, so I'll leave perennial puppeteer at "puppeteer": "~13.5.2",
for now. We may need to do the same for aqua or chipper, until we sort out the ~/.cache/puppeteer
issue on linux.
I worked with @mattpen, we needed to restart the build server. After pulling on the server, npm updating, and restarting, we production deployed chains and had no errors. We are ready to close this in terms of the recent upgrade to 19.2. We are NOT ready to close this issue in terms of the MR to back propagate the new version to old shas. Over to @jonathanolson to close if all goes well with the MR (and thank you so much for taking this on!).
I believe that all has been done here on my end.
Maintenance complete, closing.
Really great work! Thank you so much.
On Tue, Dec 20, 2022, 15:53 Jonathan Olson @.***> wrote:
Closed #268 https://github.com/phetsims/perennial/issues/268 as completed.
— Reply to this email directly, view it on GitHub https://github.com/phetsims/perennial/issues/268#event-8082396855, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUKB34NS3UEFDWRY4XQ66TWOI2INANCNFSM5STMESXA . You are receiving this because you were mentioned.Message ID: @.***>
@jonathanolson and @samreid and I ran into this once again while publishing this MR. We cracked the case though! our fix for old branches (to move the cleanup call to before the resolve). This is not sufficient! @samreid and I believe that there is a behavior change between the old version of Puppeteer originally published with these sims vs the new, 19.2 in which page.goto is still running when we get the message callback to resolve. This means that we need to defensively guard our rejections, knowing that resolving and closing the page will trigger page.goto (which is mid run) to error out.
We will add code comments to master to make this more clear. The easiest way to see this is to console.log in the cleanup
function.
For the MR:
I think the fastest thing to do would be for @jonathanolson and I to pair on this to find the sims needed and work out each intricacy.
Patched and deployed without incident. Closing.
A real life miracle! Thanks @jonathanolson for all the hard work.
Over in https://github.com/phetsims/chipper/issues/1171 we needed to upgrade Node to 16, and perennial 5 breaks on Mac M1 chips and won't even install. So we should upgrade. The latest version is 13.5.2 right now.