Salt issue with fedora 32

52 views
Skip to first unread message

gal...@gmail.com

unread,
Jul 1, 2020, 7:00:15 AM7/1/20
to qubes-users
I've tried to set up my templates using salt.

The plan is to clone the fedora minimal template and install extra packages to make a new template and it all works with fedora 31. With 32 I am getting this error:

template-web-32:
      ----------
      _error:
          Failed to return clean data
      retcode:
          1
      stderr:
          Traceback (most recent call last):
            File "/var/tmp/.root_62a99a_salt/salt-call", line 27, in <module>
              salt_call()
            File "/var/tmp/.root_62a99a_salt/pyall/salt/scripts.py", line 440, in salt_call
              import salt.cli.call
            File "/var/tmp/.root_62a99a_salt/pyall/salt/cli/call.py", line 5, in <module>
              import salt.utils.parsers
            File "/var/tmp/.root_62a99a_salt/pyall/salt/utils/parsers.py", line 28, in <module>
              import salt.config as config
            File "/var/tmp/.root_62a99a_salt/pyall/salt/config/__init__.py", line 100, in <module>
              _DFLT_IPC_WBUFFER = _gather_buffer_space() * .5
            File "/var/tmp/.root_62a99a_salt/pyall/salt/config/__init__.py", line 89, in _gather_buffer_space
              import salt.grains.core
            File "/var/tmp/.root_62a99a_salt/pyall/salt/grains/core.py", line 40, in <module>
              from platform import _supported_dists
          ImportError: cannot import name '_supported_dists' from 'platform' (/usr/lib64/python3.8/platform.py)
      stdout:

How can I fix this?

Thanks for reading.

Peter Funk

unread,
Jul 1, 2020, 9:37:58 AM7/1/20
to gal...@gmail.com, qubes-users
Hi,

gal...@gmail.com schrieb am Mittwoch, den 01.07.2020 um 04:00:
...
> to make a new template and it all works with fedora 31. With 32 I am
> getting this error:
...
> import salt.grains.core
> File "/var/tmp/.root_62a99a_salt/pyall/salt/grains/core.py",
> line 40, in <module>
> from platform import _supported_dists
> ImportError: cannot import name '_supported_dists' from
> 'platform' (/usr/lib64/python3.8/platform.py)
> stdout:
>
> How can I fix this?

I only viewed this traceback.

As Python programmer not knowing salt in detail I've the following comment:

identifiers beginning with an undescore (here: "_supported_dists")
should be considered as private to the module in question (here: platform.py
from Python 3.8 standard library). It is not recommended to use any private
features from library modules in other code because they might change without
notice due to further development of the module in upcoming versions of the
Python language. However the Python language allows this:

But the programmer of "salt" did this in the module
pyall/salt/grains/core.py which now breaks in this combination.

This should be reported to the salt development team if there is not
already an existing issue on this. It looks like an incompatibility
between this version of salt (not mentioned in the Traceback) and
Python 3.8

Regards, Peter Funk
--
Peter Funk ✉:Oldenburger Str.86, 27777 Ganderkesee, Germany; 📱:+49-179-640-8878
✉office: ArtCom GmbH, Haferwende 2, D-28357 Bremen, Germany
☎office:+49-421-20419-0 <http://www.artcom-gmbh.de/>

Peter Funk

unread,
Jul 1, 2020, 10:59:20 AM7/1/20
to gal...@gmail.com, qubes-users
> > File "/var/tmp/.root_62a99a_salt/pyall/salt/grains/core.py",
> > line 40, in <module>
> > from platform import _supported_dists
> > ImportError: cannot import name '_supported_dists' from
> > 'platform' (/usr/lib64/python3.8/platform.py)
...

I had the chance to do some more research: This particular line was originally
added in 2012 to salt/grains/core.py:
https://github.com/saltstack/salt/commit/1f050476dee2b27278f1c8f7772339444c153f06
But the current version of this module from looks very different:
https://github.com/saltstack/salt/blob/master/salt/grains/core.py

So it seems like the version of salt in your installation of Qubes OS
is to old by now to work together with the Python 3.8 in Fedora 32.

gal...@gmail.com

unread,
Jul 2, 2020, 3:23:57 PM7/2/20
to qubes-users
Thank you Peter.

I'm no salt or qubes expert. I put the salt configuration together by looking at examples found from this forum. They all worked with fedora 31 and all I have done this time is change 31 to 32.

I have not made any changes in dom0 other than putting my salt files in a directory.

unman

unread,
Jul 3, 2020, 8:45:13 PM7/3/20
to qubes-users
On Wed, Jul 01, 2020 at 04:59:15PM +0200, Peter Funk wrote:
> > > File "/var/tmp/.root_62a99a_salt/pyall/salt/grains/core.py",
> > > line 40, in <module>
> > > from platform import _supported_dists
> > > ImportError: cannot import name '_supported_dists' from
> > > 'platform' (/usr/lib64/python3.8/platform.py)
> ...
>
> I had the chance to do some more research: This particular line was originally
> added in 2012 to salt/grains/core.py:
> https://github.com/saltstack/salt/commit/1f050476dee2b27278f1c8f7772339444c153f06
> But the current version of this module from looks very different:
> https://github.com/saltstack/salt/blob/master/salt/grains/core.py
>
> So it seems like the version of salt in your installation of Qubes OS
> is to old by now to work together with the Python 3.8 in Fedora 32.
>
> Regards, Peter Funk

There's an oblique reference to this in the announcement of the Fedora 32
template, in the section that refers to using the Qubes Updater. That
change is necessary because the Updater uses Salt - so the notice could
have referred to *any* use of salt including the Qubes Updater.

unman

unman

unread,
Jul 3, 2020, 9:41:55 PM7/3/20
to qubes-users
Although making *that* change isnt enough to get salt working, even with
the full Fedora-32 template.

unman

unread,
Jul 3, 2020, 10:49:02 PM7/3/20
to qubes-users
Scratch that - I've been away a while and am a bit rusty. With that
change, works fine, (at least for me).

gal...@gmail.com

unread,
Jul 4, 2020, 5:30:10 AM7/4/20
to qubes-users
Thank you unman.

I set the update VM to use fedora 32 and now it works.

Reply all
Reply to author
Forward
0 new messages