open-telemetry / open-telemetry/opentelemetry-python-contrib
Bazelisk build failed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
Describe your environment
OS: Ubuntu
Python version: Python 3.9.19
Package version: 0.47b0
What happened?
Attempt to build a Python project using opentelemetry.instrumentation.grpc using Bazel fails.
Here is the minimal project reproducing the problem: https://github.com/pjachowi/otel_intrumentation_problem
Steps to Reproduce
- Clone the repo https://github.com/pjachowi/otel_intrumentation_problem
- bazelisk run //:requirements.update
- bazelisk run //:test
Expected Result
Successful run
Actual Result
$ bazelisk run //:test
INFO: Analyzed target //:test (73 packages loaded, 4272 targets configured).
INFO: Found 1 target...
Target //:test up-to-date:
bazel-bin/test
INFO: Elapsed time: 0.401s, Critical Path: 0.04s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/test
Traceback (most recent call last):
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/main/test.py", line 1, in
from opentelemetry.instrumentation import grpc
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_opentelemetry_instrumentation_grpc/site-packages/opentelemetry/instrumentation/grpc/init.py", line 291, in
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_opentelemetry_instrumentation/site-packages/opentelemetry/instrumentation/instrumentor.py", line 27, in
from opentelemetry.instrumentation.dependencies import (
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_opentelemetry_instrumentation/site-packages/opentelemetry/instrumentation/dependencies.py", line 4, in
from pkg_resources import (
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_setuptools/site-packages/pkg_resources/init.py", line 96, in
from jaraco.text import (
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_setuptools/site-packages/setuptools/_vendor/jaraco/text/init.py", line 231, in
files(name).joinpath('Lorem ipsum.txt').read_text(encoding='utf-8')
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/pathlib.py", line 1266, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/pathlib.py", line 1252, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/pathlib.py", line 1120, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/nobody/.cache/bazel/_bazel_nobody/b0c935cccbea1e51f1a6303d0c0ad81d/execroot/main/bazel-out/k8-fastbuild/bin/test.runfiles/py_deps_setuptools/site-packages/setuptools/_vendor/jaraco/text/Lorem ipsum.txt'
Additional context
The problem appared with the latest release 0.47b0, however pinning opentelemetry-instrumentation-grpc==0.46b0 reproduces the problem as well.
Would you like to implement a fix?
None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the linked minimal project and run bazelisk run //:requirements.update followed by bazelisk run //:test. Start with the import chain through opentelemetry.instrumentation.grpc, dependencies.py, and setuptools' vendored jaraco/text package, then verify that the test completes without the missing Lorem ipsum.txt FileNotFoundError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100