You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NewRelic is incompatible with ChromaDB due to conflicting openetelemetry protos
Description
When using newrelic-python in conjunction with chromadb (or any dependency really using chromadb, crewai for example), import errors caused by mismatching proto versions prevent the app from starting up & working. Other threads mentioning setting settings.debug.otlp_content_encoding = "json" unfortunately don't really work when NewRelic is used with the newrelic-admin wrapper script, as the OLTP imports in NewRelic run before any of the application code is hit & could change that settings.
Expected Behavior
NewRelic works with any other dependency.
Full stacktrace:
Traceback (most recent call last):
File "/generic/path/python/bin/celery", line 8, in <module>
sys.exit(main())
File "/generic/path/python/lib/python3.12/site-packages/celery/__main__.py", line 15, in main
sys.exit(_main())
File "/generic/path/python/lib/python3.12/site-packages/celery/bin/celery.py", line 236, in main
return celery(auto_envvar_prefix="CELERY")
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/celery/bin/base.py", line 135, in caller
return f(ctx, *args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/celery/bin/worker.py", line 348, in worker
worker = app.Worker(
File "/generic/path/python/lib/python3.12/site-packages/celery/worker/worker.py", line 93, in __init__
self.app.loader.init_worker()
File "/generic/path/python/lib/python3.12/site-packages/celery/loaders/base.py", line 110, in init_worker
self.import_default_modules()
File "/generic/path/python/lib/python3.12/site-packages/celery/loaders/base.py", line 104, in import_default_modules
raise response
File "/generic/path/python/lib/python3.12/site-packages/celery/utils/dispatch/signal.py", line 276, in send
response = receiver(signal=self, sender=sender, **named)
File "/generic/path/python/lib/python3.12/site-packages/celery/fixups/django.py", line 100, in on_import_modules
self.worker_fixup.validate_models()
File "/generic/path/python/lib/python3.12/site-packages/celery/fixups/django.py", line 140, in validate_models
run_checks()
File "/generic/path/python/lib/python3.12/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/generic/path/python/lib/python3.12/site-packages/django/core/checks/urls.py", line 136, in check_custom_error_handlers
handler = resolver.resolve_error_handler(status_code)
File "/generic/path/python/lib/python3.12/site-packages/newrelic/hooks/framework_django.py", line 598, in wrapper
return wrapped(*args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/django/urls/resolvers.py", line 732, in resolve_error_handler
callback = getattr(self.urlconf_module, "handler%s" % view_type, None)
File "/generic/path/python/lib/python3.12/site-packages/django/utils/functional.py", line 47, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/generic/path/python/lib/python3.12/site-packages/django/urls/resolvers.py", line 711, in urlconf_module
return import_module(self.urlconf_name)
File "/generic/path/python/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/generic/path/app/urls.py", line 43, in <module>
path("app/", include("app.urls")),
File "/generic/path/python/lib/python3.12/site-packages/django/urls/conf.py", line 39, in include
urlconf_module = import_module(urlconf_module)
File "/generic/path/python/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/generic/path/app/urls.py", line 3, in <module>
File "/generic/path/app/views.py", line 8, in <module>
File "/generic/path/app/serializers.py", line 23, in <module>
File "/generic/path/app/processing/auto_reconciler.py", line 23, in <module>
File "/generic/path/app/processing/multi_step.py", line 13, in <module>
File "/generic/path/app/crew.py", line 1, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/__init__.py", line 3, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/agent.py", line 8, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/agents/__init__.py", line 2, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/agents/parser.py", line 6, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/utilities/__init__.py", line 13, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/utilities/embedding_configurator.py", line 4, in <module>
File "/generic/path/python/lib/python3.12/site-packages/chromadb/__init__.py", line 6, in <module>
File "/generic/path/python/lib/python3.12/site-packages/chromadb/auth/token_authn/__init__.py", line 24, in <module>
from chromadb.telemetry.opentelemetry import (
File "/generic/path/python/lib/python3.12/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 13, in <module>
File "/generic/path/python/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/__init__.py", line 22, in <module>
from opentelemetry.exporter.otlp.proto.common.trace_encoder import (
File "/generic/path/python/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/common/trace_encoder.py", line 16, in <module>
from opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder import (
File "/generic/path/python/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/common/_internal/__init__.py", line 30, in <module>
File "/generic/path/python/lib/python3.12/site-packages/opentelemetry/proto/common/v1/common_pb2.py", line 16, in <module>
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
TypeError: Couldn't build proto file into descriptor pool: duplicate file name opentelemetry/proto/common/v1/common.proto
NewRelic is incompatible with ChromaDB due to conflicting
openetelemetry
protosDescription
When using
newrelic-python
in conjunction withchromadb
(or any dependency really usingchromadb
,crewai
for example), import errors caused by mismatching proto versions prevent the app from starting up & working. Other threads mentioning settingsettings.debug.otlp_content_encoding = "json"
unfortunately don't really work when NewRelic is used with thenewrelic-admin
wrapper script, as the OLTP imports in NewRelic run before any of the application code is hit & could change that settings.Expected Behavior
NewRelic works with any other dependency.
Full stacktrace:
List of dependencies to reproduce
The text was updated successfully, but these errors were encountered: