-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
TypeError: Cannot read properties of null (reading 'finishWrite') #188676
Comments
Runtime has no changes with insiders, this seems like a regression from the recent http proxy changes based on similar errors in upstream. Passing onto @chrmarti From a quick look the extension relies on https://github.com/mongodb-js/compass/tree/main/packages/data-service package which makes network connection. @alenakhineika it would be great if you can reduce the test case to a minimal extension sample for us to debug this issue further. Thanks! |
Unfortunately, we haven't been able to isolate the issue for a minimal extension sample so far. To reproduce the problem, you can follow these steps:
npm ci
npm run compile
npm test When running all tests, you may observe multiple failures with the |
Maybe a related discussion: nodejs/node#46094 |
Found it. The place in our code that fails with the latest Insiders is fetch with a biggish timeout. I created a minimal test so you can try it, but here is the code snippet for a quick look: test('minimal test with fetch', async () => {
const fetch = require('cross-fetch');
let unparsedCIDRs;
try {
// The uncaught `TypeError: Cannot read properties of null (reading 'finishWrite')`
// is being thrown for several fetch calls with 5000 timeout:
// https://github.com/mongodb-js/mongodb-cloud-info/blob/main/index.js#L30
for (let i = 0; i < 15; i++) {
unparsedCIDRs = await fetch(CIDRS_URL, { timeout: 5000 }).then((res) =>
res.json()
);
}
} catch (error) {
console.log(error);
}
assert.notStrictEqual(unparsedCIDRs, null);
}); |
@alenakhineika Thanks for putting together this test! My investigation so far:
Still need to check older versions to see if that check was backported and see if there is a way to test this assessment. |
nodejs/node@7f7a899 is available in 18.8.0 and 16.18.0, our exploration builds based on Node v18 has this change, @chrmarti you can use the builds from https://builds.code.visualstudio.com/builds/exploration to verify the assessment. |
The test does not reproduce the issue in the exploration build. Still trying to understand what is happening (please ignore the above code pointers) by looking at the Node.js code at the What I don't quite understand is that the callstack to
But @deepak1556 Could you point me at the Node.js source that went into Electron? I believe that is not the exact same as that at https://github.com/nodejs/node? |
Electron pulls Node.js source from https://github.com/nodejs/node when building, what you are looking at is the correct one. I think the async stack is missing a trampoline calll, but you are seeing a write after shutdown stack same as nodejs/node#46094 (comment) |
Thanks @deepak1556. This looks like an upstream issue to me, |
We have reverted to the previous way of loading certificates as we are getting close to a release (#189133). |
We're seeing this again in our macos and Windows CI jobs for VSCode "Insiders" (not current VSCode stable version 1.82.2). Was node or electron updated in the last 2 days on VSCode Insiders? |
There is fix in upstream for the above scenario, I will backport it to relevant release lines. |
@justinmk3 Could you confirm that todays Insiders build fixes the problem? Thanks! |
Confirmed, thanks! |
Something has changed in the latest Insiders so our MongoDB extension CI started to fail with errors (any branch but here is an example):
Do you have any idea what might cause it so we can make changes on our side? Might it be something with your dependencies?
The text was updated successfully, but these errors were encountered: