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

salt-master doesn't work in fedora 31 + tornado 6 #54392

Closed
itamarjp opened this issue Sep 3, 2019 · 21 comments
Closed

salt-master doesn't work in fedora 31 + tornado 6 #54392

itamarjp opened this issue Sep 3, 2019 · 21 comments
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt P4 Priority 4 severity-high 2nd top severity, seen by most users, causes major problems
Milestone

Comments

@itamarjp
Copy link

itamarjp commented Sep 3, 2019

https://bugzilla.redhat.com/show_bug.cgi?id=1748170

No module named 'tornado.stack_context'

https://www.tornadoweb.org/en/stable/releases/v6.0.0.html

APIs deprecated in Tornado 5.1 have been removed. This includes the tornado.stack_context

https://koji.fedoraproject.org/koji/buildinfo?buildID=1338741

@DmitryKuzmenko
Copy link
Contributor

Salt doesn't support Tornado 6.0 yet but is looking at addressing the issue but are unable to give a timeframe as to when support will be available.

@DmitryKuzmenko DmitryKuzmenko added Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE P4 Priority 4 Core relates to code central or existential to Salt severity-high 2nd top severity, seen by most users, causes major problems labels Sep 10, 2019
@DmitryKuzmenko DmitryKuzmenko added this to the Approved milestone Sep 10, 2019
@kurobeats
Copy link

I don't mean to throw fuel on this fire but I've now lost configuration and control of 15 hosts. They all have a fun memory leak too (if I leave salt-minion enabled).

@leifliddy
Copy link
Contributor

I'm running into this exact same issue. Could someone post a workaround regardless of 'hacky' it is?
I'm trying to avoid setting up a full virtualenv for salt.

I'm thinking about installing tornado5 in an alternate location and changing these references.
Has someone already tried this?

/usr/lib/python3.7/site-packages/salt/minion.py:            with tornado.stack_context.ExceptionStackContext(timeout_handler):
/usr/lib/python3.7/site-packages/salt/minion.py:        with tornado.stack_context.StackContext(functools.partial(RequestContext,
/usr/lib/python3.7/site-packages/salt/minion.py:            with tornado.stack_context.StackContext(minion_instance.ctx):
/usr/lib/python3.7/site-packages/salt/minion.py:            with tornado.stack_context.ExceptionStackContext(timeout_handler):
/usr/lib/python3.7/site-packages/salt/minion.py:            with tornado.stack_context.ExceptionStackContext(timeout_handler):
/usr/lib/python3.7/site-packages/salt/minion.py:        with tornado.stack_context.ExceptionStackContext(timeout_handler):
/usr/lib/python3.7/site-packages/salt/master.py:from tornado.stack_context import StackContext
/usr/lib/python3.7/site-packages/salt/client/mixins.py:import tornado.stack_context
/usr/lib/python3.7/site-packages/salt/client/mixins.py:            with tornado.stack_context.StackContext(self.functions.context_dict.clone):

@brejoc
Copy link
Contributor

brejoc commented Nov 8, 2019

@leifliddy You'd have to downgrade python3-tornado to the latest 4.x version. But I only see 6.0.2 in the Fedora repos.

@leifliddy
Copy link
Contributor

leifliddy commented Nov 9, 2019

@brejoc thanks! tornado 5.x works fine with salt. In fact, I used the python2-tornado-5.0.2-5 rpm on Fedora 30 without issue. With Fedora 31, all of the python salt dependency packages were transitioned from python2 --> python3.
I'm such an idiot, for some reason I was thinking there were other python tornado dependencies on my system. But nope, only salt uses it.
Managed to get salt working by installing tornado 5.x

rpm -e --nodeps python3-tornado
pip3 install --install-option="--prefix=/usr" tornado==5.1.1

@iggy
Copy link
Contributor

iggy commented Dec 8, 2019

Alpine Linux upgraded to tornado 6 as well, so this is going to be an issue there.

@llua
Copy link
Contributor

llua commented Dec 8, 2019

opensuse tumbleweed has had tornado 6 for awhile too: https://software.opensuse.org/package/python3-tornado

@thekabal
Copy link

I also experienced this in Fedora 31, and was able to solve it following the instructions in this comment: #54392 (comment) . Well done!

@brejoc
Copy link
Contributor

brejoc commented Jan 13, 2020

opensuse tumbleweed has had tornado 6 for awhile too: https://software.opensuse.org/package/python3-tornado

It's true that there is tornado 6, but we also have several old tornado versions exactly for cases like this. So openSUSE is good for now.

@arizvisa
Copy link
Contributor

arizvisa commented Jan 16, 2020

This issue isn't just for salt-master, it's for salt in general which includes salt-minions too. So this includes minions that are bootstrapped without providing the parameters to install from pip. Using salt-cloud/salt-bootstrap to install from pip requires 2 things. Installing from git, which is blocked due to an issue in salt-bootstrap, and to use a virtualenv which isn't available in salt-bootstrap for anything but ubuntu.

I imagine most users would rather install python-tornado into their minion's global python packages and risk ruining dependencies rather than not communicate with any of their minions that salt-bootstrap can't install a downgraded tornado in.

Can the OP update the title to something like "salt doesn't work with tornado 6 which is now default for most distributions"?

@arizvisa
Copy link
Contributor

saltstack/salt-bootstrap#1381 seems to have been merged, so the workaround that I had mentioned wrt installing python-tornado into a minion's global packages is now done by salt-bootstrap. A re-deploy w/ it should perform #54392 (comment)

For users that can't re-deploy, just ssh in and apply the directions mentioned in that comment as prior mentioned by thekabal.

@53c70r
Copy link

53c70r commented Feb 10, 2020

bootstrap using

curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
sudo sh bootstrap-salt.sh git develop

will fail on Fedora31;

WARNING: Running pip install with root privileges is generally not a good idea. Try `python -m pip install --user` instead.
Ignoring tornado: markers 'python_version < "3"' don't match your environment
WARNING: Running pip install with root privileges is generally not a good idea. Try `python -m pip install --user` instead.
Collecting tornado<5.0,>=4.2.1
  Downloading https://files.pythonhosted.org/packages/e3/7b/e29ab3d51c8df66922fea216e2bddfcb6430fb29620e5165b16a216e0d3c/tornado-4.5.3.tar.gz (484kB)
Installing collected packages: tornado
  Running setup.py install for tornado: started
    Running setup.py install for tornado: finished with status 'done'
Successfully installed tornado-4.5.3
 *  INFO: Running config_salt()
 *  INFO: Running install_fedora_git()
bootstrap-salt.sh: line 3942: python2: command not found
 * ERROR: Failed to run install_fedora_git()!!!

@arizvisa
Copy link
Contributor

@53c70r, does saltstack/salt-bootstrap#1424 fix things?

@53c70r
Copy link

53c70r commented Feb 13, 2020

No since the Merge was 9 days ago and i executed the commands 3 days ago.

@53c70r
Copy link

53c70r commented Feb 13, 2020

vim bootstrap-salt.sh +3942

install_fedora_git() {
    if [ "${_PY_EXE}" != "" ]; then
        _PYEXE=${_PY_EXE}
        echoinfo "Using the following python version: ${_PY_EXE} to install salt"
    else
        _PYEXE='python2'
    fi

    if [ "${_POST_NEON_INSTALL}" -eq $BS_TRUE ]; then
         __install_salt_from_repo_post_neon "${_PY_EXE}" || return 1
        return 0
    fi

    if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
        ${_PYEXE} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1
    else
        ${_PYEXE} setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1
    fi
    return 0
}

_PYEXE='python2'
but since Fedora does not have python2 it can't execute the command.

vim bootstrap-salt.sh +271
_PY_EXE=""

@arizvisa
Copy link
Contributor

@53c70r, what about with '-x python3'?

@53c70r
Copy link

53c70r commented Feb 18, 2020

Works fine.

@brejoc
Copy link
Contributor

brejoc commented Mar 11, 2020

If Salt would be upgraded to version 3000, the tornado dependency would be gone, since it's vendored in salt/ext now.

@dmurphy18
Copy link
Contributor

@itamarjp With Salt 2000 release a version of Tornado compatible with Salt is embedded in Salt, it utilizes Tornado v4.5.3. Salt 3000 is now available for current versions of Fedora.

With the Sodium point release it is hope that Salt will be able to utilize bot Tornado v5.x and v6.x and work is on-going in this effort, and is currently under QA.

If this satisfies the issue , please consider closing this issue.

@arizvisa
Copy link
Contributor

super glad that salt is finally vendorizing core dependencies. updating to newer releases should be significantly safer.

@sagetherage
Copy link
Contributor

closing this issue as fixed in 3000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt P4 Priority 4 severity-high 2nd top severity, seen by most users, causes major problems
Projects
None yet
Development

No branches or pull requests