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

Fix salt-sproxy crashing because of mislead requirements in installed Salt #261

Merged
merged 1 commit into from
Sep 16, 2020
Merged

Fix salt-sproxy crashing because of mislead requirements in installed Salt #261

merged 1 commit into from
Sep 16, 2020

Conversation

dmacvicar
Copy link
Member

What does this PR do?

Salt has a msgpack<1.0.0 line in requirements/base.txt even if as a package runs with msgpack>=1.0.0 requirement in the installed metadata. If a program uses the metadata to evaluate requirements, like salt-sproxy does, it will crash.

What issues does this PR fix or reference?

I am preparing salt-sproxy (https://build.opensuse.org/package/show/home:dmacvicar/salt-sproxy) and found this problem.
Note that salt-sproxy also restricts msgpack, and we apply a similar fix.

See: https://twitter.com/mirceaulinic/status/1287871911255347200

Previous Behavior

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (msgpack 1.0.0 (/usr/lib64/python3.8/site-packages), Requirement.parse('msgpack!=0.5.5,<1.0.0,>=0.5'), {'salt'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/salt-sproxy", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3252, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'msgpack!=0.5.5,<1.0.0,>=0.5' distribution was not found and is required by salt`

New Behavior

salt-sproxy

Cannot execute command without defining a target.

Tests written?

No

Commits signed with GPG?

No

We do run Salt with msgpack>=1.0.0. A program using this metadata to
check if dependencies are satisfied will break, as salt-sproxy does.
@meaksh meaksh merged commit 0054a74 into openSUSE:openSUSE-3000.3 Sep 16, 2020
@meaksh
Copy link
Member

meaksh commented Sep 16, 2020

Thanks for the fix @dmacvicar 👍

This should be also fixing https://bugzilla.opensuse.org/show_bug.cgi?id=1176293

meaksh pushed a commit that referenced this pull request Sep 16, 2020
We do run Salt with msgpack>=1.0.0. A program using this metadata to
check if dependencies are satisfied will break, as salt-sproxy does.

update msgpack

fix msg_test

fix .decode

fix .decode 2

fix failing tests

undo decode 2

fix strict_map_key

fix tab error

add back raw True

fix upack kwargs

add raw false

move raw false

raw=false move

clean up
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 this pull request may close these issues.

2 participants