Bug 1409177 - Kickstart installs fail with Python 3.6
Summary: Kickstart installs fail with Python 3.6
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 26
Hardware: All
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedBlocker
Depends On:
Blocks: F26AlphaBlocker
TreeView+ depends on / blocked
 
Reported: 2016-12-30 01:57 UTC by Adam Williamson
Modified: 2017-03-02 23:37 UTC (History)
9 users (show)

Fixed In Version: anaconda-26.18-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-02 23:37:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Python 29113 0 None None None 2016-12-30 02:16:57 UTC

Description Adam Williamson 2016-12-30 01:57:59 UTC
Since Python 3.6 landed in Rawhide, all kickstart installs fail. This seems to be because python3 is broken in the anaconda dracut environment. A Python traceback appears in the journal when you attempt to install with a kickstart; you can reproduce the same traceback by booting the installer image with 'rd.break' and just trying to run 'python3' from the dracut environment. It ends with:

  File "/usr/lib64/python3.6/sysconfig.py", line 424, in _init_posix
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata_m_mlinux_x86_64-linux-gnu'

(well, on x86_64; on other arches it'd look a bit different, of course).

This seems to be because /usr/lib64/python3.6/_sysconfigdata_m_linux_x86_64-linux-gnu.py (or other arch equivalent) is not included in the initramfs.

AFAICT, the script /usr/lib/dracut/modules.d/80anaconda/python-deps - from anaconda-dracut - is used to include Python bits in the anaconda initramfs. It's called like this, in module-setup.sh:

    # python deps for parse-kickstart. DOUBLE WOOOO
    PYTHONHASHSEED=42 $moddir/python-deps $moddir/parse-kickstart $moddir/driver_updates.py | while read dep; do
        case "$dep" in
            *.so) inst_library $dep ;;
            *.py) inst_simple $dep ;;
            *) inst $dep ;;
        esac
    done

so let's see what it prints out for those files:

[adamw@adam 80anaconda]$ ./python-deps ./parse-kickstart ./driver_updates.py | grep sysconfig
/usr/lib64/python3.6/distutils/sysconfig.py
/usr/lib64/python3.6/sysconfig.py
[adamw@adam 80anaconda]$

...yeah, it does not detect that _sysconfigdata_m_linux_x86_64-linux-gnu.py is needed, by the looks of it.

I haven't had time yet to further debug why that is. It does look like python-deps has a kind of override dict for things that it can't detect properly, called alsoNeeded, so we might just have to put it in there, but I'll dig in a bit more to see.

Proposing as an Alpha blocker - this violates "The scripted installation mechanism must provide a working function for creating local user accounts, including the ability to specify a hashed password, and for specifying a hashed password for the root account.", because *nothing* about the 'scripted installation mechanism' works at all. https://fedoraproject.org/wiki/Fedora_26_Alpha_Release_Criteria#scripted-user-creation

Comment 1 Adam Williamson 2016-12-30 02:02:43 UTC
oh, to add the missing piece of the puzzle, the relevant upstream change here seems to be this one:

https://github.com/python/cpython/commit/a6431f2c8cf4783c2fd522b2f6ee04c3c204237f

note particularly the change in sysconfig.py from:

    from _sysconfigdata import build_time_vars

to:

    name = '_sysconfigdata_' + sys.abiflags
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
    build_time_vars = _temp.build_time_vars

I'm guessing it's the use of __import__ there that python-deps can't handle.

Comment 2 Adam Williamson 2016-12-30 02:16:57 UTC
I figured that since modulefinder is part of the standard lib and it's failing to find a module used by the very core of Python itself, this would be worth reporting upstream, so I did:

https://bugs.python.org/issue29113

Comment 3 Adam Williamson 2017-01-04 23:38:34 UTC
https://github.com/rhinstaller/anaconda/pull/923

Comment 4 Vendula Poncova 2017-01-06 14:51:37 UTC
Merged to rawhide.

Comment 5 Geoffrey Marr 2017-01-09 18:20:23 UTC
Discussed during the 2017-01-09 blocker review meeting: [1]

The decision to classify this bug as an "AcceptedBlocker" was made as it violates the following criteria:

"The scripted installation mechanism must provide a working function for creating local user accounts, including the ability to specify a hashed password, and for specifying a hashed password for the root account." (as the 'scripted installation mechanism' is entirely broken)

[1] https://meetbot.fedoraproject.org/fedora-blocker-review/2017-01-09/f26-blocker-review.2017-01-09-17.00.txt

Comment 6 Fedora End Of Life 2017-02-28 10:51:28 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 7 Adam Williamson 2017-03-02 23:37:36 UTC
Kickstart installs confirmed working in current Rawhide (and 26, most likely).


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