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

supervisor package broken due to missing pkg_resources/setuptools #36785

Closed
chadlwilson opened this issue Dec 13, 2024 · 1 comment · Fixed by #36800
Closed

supervisor package broken due to missing pkg_resources/setuptools #36785

chadlwilson opened this issue Dec 13, 2024 · 1 comment · Fixed by #36800

Comments

@chadlwilson
Copy link
Contributor

chadlwilson commented Dec 13, 2024

As of today something seems to have broken the supervisor package.

Traceback (most recent call last):
  File "/usr/bin/supervisord", line 5, in <module>
    from supervisor.supervisord import main
  File "/usr/lib/python3.12/site-packages/supervisor/supervisord.py", line 41, in <module>
    from supervisor.options import ServerOptions
  File "/usr/lib/python3.12/site-packages/supervisor/options.py", line 13, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

At a quick guess the problem is that the package depends on generic py3-setuptools and something changed in my setup causing Python 3.13 to be installed, meaning this dependency installs py3.13-setuptools. However supervisor is specifically running with python 3.12 so then setuptools is not found.

https://wolfi.pkgs.org/rolling/wolfi-base-aarch64/supervisor-4.2.5-r6.apk.html

Replicate with

docker run -it cgr.dev/chainguard/wolfi-base sh -c "apk update && apk add supervisor && supervisord"
$ docker run -it cgr.dev/chainguard/wolfi-base sh -c "apk update && apk add supervisor && supervisord"
fetch https://packages.wolfi.dev/os/aarch64/APKINDEX.tar.gz
 [https://packages.wolfi.dev/os]
OK: 107868 distinct packages available
(1/17) Installing py3-pip-wheel (24.3.1-r1)
(2/17) Installing libbz2-1 (1.0.8-r9)
(3/17) Installing libexpat1 (2.6.4-r0)
(4/17) Installing libffi (3.4.6-r5)
(5/17) Installing gdbm (1.24-r1)
(6/17) Installing xz (5.6.3-r2)
(7/17) Installing libstdc++ (14.2.0-r6)
(8/17) Installing mpdecimal (4.0.0-r3)
(9/17) Installing ncurses-terminfo-base (6.5_p20241006-r4)
(10/17) Installing ncurses (6.5_p20241006-r4)
(11/17) Installing readline (8.2.13-r1)
(12/17) Installing sqlite-libs (3.47.2-r0)
(13/17) Installing python-3.12-base (3.12.8-r2)
(14/17) Installing python-3.13-base (3.13.1-r4)
(15/17) Installing py3.13-setuptools (75.6.0-r1)
(16/17) Installing supervisor-config (4.2.5-r6)
(17/17) Installing supervisor (4.2.5-r6)
Executing glibc-2.40-r3.trigger
Executing busybox-1.37.0-r0.trigger
OK: 107 MiB in 32 packages
Traceback (most recent call last):
  File "/usr/bin/supervisord", line 5, in <module>
    from supervisor.supervisord import main
  File "/usr/lib/python3.12/site-packages/supervisor/supervisord.py", line 41, in <module>
    from supervisor.options import ServerOptions
  File "/usr/lib/python3.12/site-packages/supervisor/options.py", line 13, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

Workaround seems to be to add a manual additional dependency on py3.12-setuptools. Probably the dependency needs to be changed to match the "specific python version" in the other dependencies to ensure setuptools is in the right place.

Possibly started happening due to #36432 I am guessing.

@chadlwilson chadlwilson changed the title supervisor package broken due to missing pkg_resources supervisor package broken due to missing pkg_resources/setuptools Dec 13, 2024
@chadlwilson
Copy link
Contributor Author

chadlwilson commented Dec 13, 2024

Perhaps the package just needs a rebuild on the latest build environment so it picks up and builds against 3.13 instead of 3.12.

sitepackages=$(python3 -c 'import site; print(site.getsitepackages()[0])')

Seems a little brittle though. Perhaps if the build/install is specifically against a versioned site-packages chosen at build time, the dependency on setuptools should be expressed against that same python version? Not sure if there is a way to do this dynamically though. Maybe something similar to #28955 (comment) is good enough though, rather than automatically updating to whatever the latest python3 is in the build env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant