Bug 231300 - sysutils/py-salt: Fails to start with ZEROMQ=off
Summary: sysutils/py-salt: Fails to start with ZEROMQ=off
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Ben Woods
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2018-09-11 14:12 UTC by Alexander Ushakov
Modified: 2020-03-08 00:55 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (christer.edwards)
koobs: merge-quarterly?


Attachments
Patch to fix python dependencies when ZEROMQ option disabled (757 bytes, patch)
2020-03-08 00:55 UTC, Ben Woods
woodsb02: maintainer-approval? (christer.edwards)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Ushakov 2018-09-11 14:12:51 UTC
If in port config of py-salt select only tcp transport than ZeroMQ transport wouldn't be installed and it is normal. But then when saltstack is started it shows the next error message:

Traceback (most recent call last):
  File "/usr/local/bin/salt-master", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3098, in <module>                                                                                        
    @_call_aside
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3082, in _call_aside                                                                                     
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3111, in _initialize_master_working_set                                                                  
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 573, in _build_master                                                                                    
    ws.require(__requires__)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 891, in require                                                                                          
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 777, in resolve                                                                                          
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pyzmq>=2.2.0' distribution was not found and is required by salt

This error is caused by line in /usr/local/lib/python2.7/site-packages/salt-2018.3.1-py2.7.egg-info/requires.txt:
pyzmq>=2.2.0

Removing of it solves the problem.
Comment 1 Walter Schwarzenfeld freebsd_triage 2019-08-02 12:05:54 UTC
In the meantime we have 2019.2.0. Does the problem still exist?
Comment 2 Alexander Ushakov 2019-08-13 08:44:05 UTC
(In reply to Walter Schwarzenfeld from comment #1)
Unfortunately version py27-salt-2019.2.0_2 still has this problem
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2019-08-23 10:45:21 UTC
^Triage: Correct assignee and maintainer-feedback flags (python is not maintainer, but remains CC'd)

If pyzmq isn't declared as an extras_require (but instead as an install_requires), then it is an unconditional dependency by way of its (potentially incorrect) declaration, and *_DEPENDS must match to suit, or the requirements in sources patched appropriately

@Alexander, can you please confirm the exact set/values of port OPTIONS that produces this error. My interpretation is that this is reproducible *only* if TCP=ON (non default) and ZMQ=OFF (also non default)
Comment 4 Alexander Ushakov 2019-08-25 12:35:26 UTC
(In reply to Kubilay Kocak from comment #3)
> My interpretation is that this is reproducible *only* if TCP=ON (non default) and ZMQ=OFF (also non default)
Yes, as I've written in my first post problem appears under these conditions. I suppose that it is enough to just deselect ZEROMQ to reproduce bug.
Comment 5 Fabian Keil 2019-09-06 15:46:11 UTC
With salt-ssh from py36-salt-2019.2.0_2 the error is also
reproducible with TCP=off and ZEROMQ=off.
Comment 6 Ben Woods freebsd_committer 2020-03-08 00:55:11 UTC
Created attachment 212238 [details]
Patch to fix python dependencies when ZEROMQ option disabled

There is a build time option --salt-transport that should be set to change python dependencies specified in the requires.txt. For those not familiar, the structure of the requires.txt file is outlined in the following link:
https://setuptools.readthedocs.io/en/latest/formats.html#requires-txt

According to the salt setup.py code, the supported values for --salt-transport include:
- zeromq - adds python dependencies for zeromq to the core requirements section of requires.txt
- raet - adds python dependencies for raet to the core requirements section of requires.txt
- both - no impact
- ssh - no impact
- none - no impact

https://github.com/saltstack/salt/blob/v2019.2.3/setup.py#L1006

Note that the raet dependencies are already included extra requirements section of requires.txt under the [RAET] optional feature.

It is also worth noting that raet support is removed in the next release of salt (v3000).

Given this, the attached patch only toggles the zeromq option on or off inline with the selection of the port option.

Thoughts on this patch?