Skip to content

opentelemetry-bootstrap breaks with setuptools 66.0.0 (PEP 440) on Ubuntu, for some Python versions #1591

@tammy-baylis-swi

Description

@tammy-baylis-swi

Describe your environment
Installing the latest opentelemetry-instrumentation on Ubuntu 18.04/20.04, with Python 3.10/3.11, then running opentelemetry-bootstrap results in a setuptools/pkg_resources error (see "actual behavior" below).

A workaround is to uninstall the latest version of setuptools and to install setuptools==65.7.0. There are breaking changes in setuptools==66.0.0 (released this week) such that non-conforming versions (as per PEP 440) may result in failures.

This did not happen when I tried Python 3.7, 3.8, 3.9. This may also have to do with installing Python 3.10/3.11 from deadsnakes, but I don't think there exists another way to install newer Python on these Ubuntu versions without switching default repo or manually downloading and installing (recent example guides here, here, here)

Steps to reproduce
I've posted a way to reproduce in Docker in this repo: https://github.com/tammy-baylis-swi/otel-python-bootstrap-invalidversion. The steps:

  1. Run a docker container based on an Ubuntu image, e.g. ubuntu:20.04
  2. Install Python 3.10 as it does not come with the container. Note that if using apt-get another repo must be used (recent example guides here, here, here). The reproduce repo above manages this in sh.
  3. Install opentelemetry-instrumentation
  4. Run opentelemetry-bootstrap

What is the expected behavior?
No tracebacks/errors should happen when opentelemetry-bootstrap is called.

What is the actual behavior?
A traceback pops up with pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '0.23ubuntu1'. I'll attach a text file with full example trace:

traceback_invalidversion.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions