-
Notifications
You must be signed in to change notification settings - Fork 230
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 'encrypted') #4466
Comments
This looks like some kind of race condition, where the underlying request socket is already disposed at the time the agent tries to read stuff from it... |
@ddolcimascolo I don't suppose you have a small repro, do you? Ideally I'd be able to reproduce on my end. I understand if you don't ahve one though. |
@ddolcimascolo Oh, also posting the output of |
Some notes:
defineGetter(req, 'secure', function secure(){
return this.protocol === 'https';
});
defineGetter(req, 'protocol', function protocol(){
var proto = this.connection.encrypted
? 'https'
: 'http';
...
ObjectDefineProperty(IncomingMessage.prototype, 'connection', {
__proto__: null,
get: function() {
return this.socket;
},
set: function(val) {
this.socket = val;
},
}); Here is where it would be nice to have a reproduction case. I didn't think this would be null. The Node.js docs for
|
Hi @trentm Thx for your quick reply. I don't have a repro, but as the issue happens relatively often, I can try to correlate with server logs to narrow it down at least. I'll try to put this up tomorrow (I'm in France, though) OK for the Cheers, |
Thx for the pointers. I quickly checked and yes, the fact that See nodejs/node#41011, nodejs/undici#1115 and jaredhanson/passport-oauth2#183 |
I also noticed #2479 where you fixed something that look really similar here in the library. David |
Describe the bug
I have dozens of these errors in Elastic APM and they seem to originate from this agent. The stacktrace is always
To Reproduce
I don't know exactly. I have thousands of APM transactions, and only a few of them exhibit this behavior. I'm willing to help reproduce but I really don't know where to start...
Expected behavior
No exception in APM.
Environment (please complete the following information)
How are you starting the agent? (please tick one of the boxes)
agent.start()
directly (e.g.require('elastic-apm-node').start(...)
)elastic-apm-node/start
from within the source code-r elastic-apm-node/start
Additional context
Agent config options:
Click to expand
package.json
dependencies:Click to expand
The text was updated successfully, but these errors were encountered: