Bug 1748170 - No module named 'tornado.stack_context'
Summary: No module named 'tornado.stack_context'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: salt
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: David Murphy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1768268 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-03 04:53 UTC by Itamar Reis Peixoto
Modified: 2020-11-05 04:44 UTC (History)
13 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-11-05 04:44:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github saltstack salt issues 54392 0 'None' closed salt-master doesn't work in fedora 31 + tornado 6 2021-01-16 15:42:25 UTC

Description Itamar Reis Peixoto 2019-09-03 04:53:41 UTC
Description of problem:


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

Comment 1 Jason Elwell 2019-11-05 01:45:27 UTC
*** Bug 1768268 has been marked as a duplicate of this bug. ***

Comment 2 Jason Elwell 2019-11-05 01:50:53 UTC
Hackish fix:

#Remove tornado package
sudo rpm -e --nodeps python3-tornado

#install last supported tornado version from python repos
sudo pip3 install tornado==5.1.1

#salt-minion doesn't find them outside of managed paths, so links needed.
ln -s /usr/local/lib64/python3.7/site-packages/tornado /usr/lib64/python3.7/site-packages
ln -s /usr/local/lib64/python3.7/site-packages/tornado-5.1.1-py3.7.egg-info /usr/lib64/python3.7/site-packages

Comment 3 Itamar Reis Peixoto 2019-11-05 09:34:53 UTC
(In reply to Jason Elwell from comment #2)

I have downloaded salt-2018.3 and old tornado src.rpm from koji, recompiled and installed.

Comment 4 Christopher Heiny 2019-11-05 23:13:20 UTC
(In reply to Jason Elwell from comment #2)
> Hackish fix:
> 
> [snip]

Jason's hackish fix is working fine for me with Fedora 31 salt minions and a Fedora 28 salt master.

Thanks!

Comment 5 Jochen Breuer 2019-11-07 20:08:57 UTC
Afaik Tornado 5 support in Salt is still an ongoing task. You should pick the latest 4.x release if possible.
https://github.com/saltstack/salt/issues/51883

Comment 6 Jason Elwell 2019-11-10 00:08:22 UTC
(In reply to Jochen Breuer from comment #5)
> Afaik Tornado 5 support in Salt is still an ongoing task. You should pick
> the latest 4.x release if possible.
> https://github.com/saltstack/salt/issues/51883

Jochen, It looks like you're absolutely right.  Tornado less than 5.0 is the requirement for 2019.2.1, looking at that branch's docs:
https://github.com/saltstack/salt/blob/2019.2.1/requirements/static/fedora-30.in

However, looking at my F30 install, the version is:
python3-tornado-5.0.2-5.fc30.x86_64
Which may not mean much if care wasn't taken, since salt may go the way of upstart.  

I'm currently not seeing any errors logged with the 5.1.1 version.  However since that is the supported tornado version to run salt...

#hackish fix, to install 4.5.3:
sudo rpm -e --nodeps python3-tornado
sudo pip3 install tornado==4.5.3
sudo ln -s /usr/local/lib64/python3.7/site-packages/tornado /usr/lib64/python3.7/site-packages
sudo ln -s /usr/local/lib64/python3.7/site-packages/tornado-4.5.3-py3.7.egg-info /usr/lib64/python3.7/site-packages

#downgrade to 4.5.3, if you'd implemented my previous hackish fix:
sudo pip3 install tornado==4.5.3
sudo ln -s /usr/local/lib64/python3.7/site-packages/tornado-4.5.3-py3.7.egg-info /usr/lib64/python3.7/site-packages
sudo unlink /usr/lib64/python3.7/site-packages/tornado-5.1.1-py3.7.egg-info

Comment 7 Marek Marczykowski 2020-05-02 10:30:14 UTC
The issue in the initial report is fixed in salt 3000 which is packaged for Fedora 30+, so this bug can be closed.

Comment 8 Jason Elwell 2020-05-25 06:10:56 UTC
To undo my hackish fix for Fedora 31 and set things back to rights, you may want to do the following.  This will not happen on it's own.  


###Check an be sure to see the hackish changes are still there

$ rpm -q python3-tornado
package python3-tornado is not installed

#if this returns 5.1.1, change the paths for removal, if this returns 6, STOP!  you didn't apply my fix
$ pip3 freeze |grep tornado
tornado==4.5.3

$ file /usr/lib64/python3.7/site-packages/tornado*
/usr/lib64/python3.7/site-packages/tornado:                      symbolic link to /usr/local/lib64/python3.7/site-packages/tornado
/usr/lib64/python3.7/site-packages/tornado-4.5.3-py3.7.egg-info: symbolic link to /usr/local/lib64/python3.7/site-packages/tornado-4.5.3-py3.7.egg-info



###If you have double checked the output matches the info above, remove the old tornado package (without pip)

$ sudo rm /usr/lib64/python3.7/site-packages/tornado 
$ sudo rm /usr/lib64/python3.7/site-packages/tornado-4.5.3-py3.7.egg-info
$ sudo rm -R /usr/local/lib64/python3.7/site-packages/tornado 
$ sudo rm -R /usr/local/lib64/python3.7/site-packages/tornado-4.5.3-py3.7.egg-info 

#confirm the package is gone, this should return nothing
$ pip3 freeze |grep tornado

#install the Fedora provided tornado package
$ sudo dnf -y install python3-tornado

#restart the service
$ sudo systemctl restart salt-master
$ sudo systemctl restart salt-minion

Comment 9 Ben Cotton 2020-11-03 15:32:57 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.


Note You need to log in before you can comment on or make changes to this bug.