Skip to content
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

Python autoinstrumentation fails with "__sched_cpufree: symbol not found" under Alpine 3.18 #1968

Closed
alexflint opened this issue Sep 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@alexflint
Copy link

Describe your environment

Python 3.10
Alpine Linux 3/18
Kubernetes 1.25
opentelemetry-operator-0.37.1 0.83.0

Steps to reproduce

dosomething.py:

print("doing something")

Dockerfile:

FROM python:3.11-alpine
ADD dosomething.py /dosomething.py
CMD ["python3", "/dosomething.py"]

job.yaml:

apiVersion: batch/v1
kind: Job
metadata:
  name: dosomething
spec:
  template:
    metadata:
      annotations:
        instrumentation.opentelemetry.io/inject-python: "true"
    spec:
      containers:
      - name: dosomething
        image: myregsitry/dosomething:latest
        imagePullPolicy: "Always"
      restartPolicy: Never
  backoffLimit: 4

Run the job with kubectl create -f job.yaml

What is the expected behavior?

Expected the job to run successfully

What is the actual behavior?

I get the following error in the logs for the "dosomething" container:

Defaulted container "dosomething" out of: dosomething, opentelemetry-auto-instrumentation (init)
Instrumenting of system_metrics failed
Traceback (most recent call last):
  File "/otel-auto-instrumentation/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 87, in _load_instrumentors
    distro.load_instrumentor(entry_point, skip_dep_check=True)
  File "/otel-auto-instrumentation/opentelemetry/instrumentation/distro.py", line 62, in load_instrumentor
    instrumentor: BaseInstrumentor = entry_point.load()
                                     ^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation/pkg_resources/__init__.py", line 2518, in load
    return self.resolve()
           ^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation/pkg_resources/__init__.py", line 2524, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation/opentelemetry/instrumentation/system_metrics/__init__.py", line 79, in <module>
    import psutil
  File "/otel-auto-instrumentation/psutil/__init__.py", line 102, in <module>
    from . import _pslinux as _psplatform
  File "/otel-auto-instrumentation/psutil/_pslinux.py", line 26, in <module>
    from . import _psutil_linux as cext
ImportError: Error relocating /otel-auto-instrumentation/psutil/_psutil_linux.abi3.so: __sched_cpufree: symbol not found
Failed to auto initialize opentelemetry
Traceback (most recent call last):
  File "/otel-auto-instrumentation/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 39, in initialize
    _load_instrumentors(distro)
  File "/otel-auto-instrumentation/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 91, in _load_instrumentors
    raise exc
  File "/otel-auto-instrumentation/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 87, in _load_instrumentors
    distro.load_instrumentor(entry_point, skip_dep_check=True)
  File "/otel-auto-instrumentation/opentelemetry/instrumentation/distro.py", line 62, in load_instrumentor
    instrumentor: BaseInstrumentor = entry_point.load()
                                     ^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation/pkg_resources/__init__.py", line 2518, in load
    return self.resolve()
           ^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation/pkg_resources/__init__.py", line 2524, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation/opentelemetry/instrumentation/system_metrics/__init__.py", line 79, in <module>
    import psutil
  File "/otel-auto-instrumentation/psutil/__init__.py", line 102, in <module>
    from . import _pslinux as _psplatform
  File "/otel-auto-instrumentation/psutil/_pslinux.py", line 26, in <module>
    from . import _psutil_linux as cext
ImportError: Error relocating /otel-auto-instrumentation/psutil/_psutil_linux.abi3.so: __sched_cpufree: symbol not found
doing something...

Additional context

Maybe this is caused by alpine?

@alexflint alexflint added the bug Something isn't working label Sep 24, 2023
@pmcollins
Copy link
Member

Thanks for the submission. This is an issue in the operator repo and is being tracked here: open-telemetry/opentelemetry-operator#2264
Any reason to keep this open?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants