-
Notifications
You must be signed in to change notification settings - Fork 296
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
OpenAI: Cannot read properties of null #3357
Comments
Thanks for pointing this out. It looks like we failed to test if DogStatsD is enabled in the tracer before using it. I'll work on a fix. |
This should be fixed in tracer versions v4.6.0 / v3.27.0 / v2.40.0. |
Amazing. Thank you! |
@tlhunter This is still happening with more or less the same stracktrace, reading the original and current error more closely it looks like Presumably there's nothing on the public API for the library for me to do other than |
Can we get this re-opened? |
+1 |
@vanstinator @GeoffreyPlitt When these errors happen, are your applications making a call to openai immediately in the process, like some sort of script or batch process? Or are they making the request later, like within an HTTP request handler? |
I'm not using OpenAI, just dd-trace. No script or batch process, it's a NodeJS web server. Uncaught TypeError: Cannot read properties of null (reading 'dogstatsd') |
@GeoffreyPlitt this is super concerning! Can you send me an email of your I'm curious if @vanstinator I was also assuming you are using |
@tlhunter If this was a personal project I would, but I don't think I can send the entire package lockfile for my client. I was also surprised to find dd-trace has dependencies on OpenAI, but if you search the code, you'll find OpenAI plugin stuff under "packages": |
Update: my project does use OpenAI for a little AI demo, and apparently dd-trace found that and started running the code in datadog-plugin-openai. I wish it left things alone. I think most people would find it absurd that dd-trace contains an OpenAI plugin. Like, what the heck is that doing in here? But even if it somehow has a reason to be here, is there a way to disable it? |
dd-trace doesn't ship with the openai package and otherwise doesn't provide any machine learning functionality. It does instrument the package if it's loaded by an application, much like we instrument the postgres and redis packages when an app loads them. As a temporary fix this environment variable should help: I'm working on a better solution which doesn't require the environment variable. |
|
Sorry for the delay here. We had a bug in how we were implementing I submitted a patch to our internal systems to always call |
Ended up reverting our upgrade. Our project has way too many entry points to use this env-var band-aid. @tlhunter do you have a branch I can follow for the true bugfix? |
@tlhunter Can we re-open this issue until the bug is fixed? |
@GeoffreyPlitt @vanstinator Sorry for not updating the ticket but this should have been fixed on July 21st with the release of the following tracer versions: v4.8.0, v3.29.0, and v2.42.0. Please upgrade to at least one of those versions. If the problem persists I can open this issue up again. |
Thank you! Will test |
Expected behaviour
Bumping dd-trace from
4.2.0
to4.4.0
should work.Actual behaviour
Instead our applications are failing to start up with the following error:
Steps to reproduce
This seems similar to #3296
Our repo is a fairly convoluted monorepo, so I can't trivially pull out relevant pieces to share. If the issue is non-obvious I'm happy to spend the time putting together an example repo that replicates the behavior.
We're calling
tracer.init
in a require hook before we do anything else, and anytracer.use
calls are happening after we calltracer.init
.Environment
The text was updated successfully, but these errors were encountered: