Bug 1321363 - KIckstart install results in [FAILED] Failed to start Switch Root.
Summary: KIckstart install results in [FAILED] Failed to start Switch Root.
Keywords:
Status: CLOSED DUPLICATE of bug 1280448
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda-images
Version: 23
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-25 19:23 UTC by Pascal van Dam
Modified: 2016-03-28 13:47 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-28 13:47:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pascal van Dam 2016-03-25 19:23:43 UTC
Description of problem:

Installation of Fedora23 using virt-install results in [FAILED] Failed to start Switch Root. Running the install without ks="" option will launch anaconda without issue.



Version-Release number of selected component (if applicable):

Fedora 23

How reproducible:

Install a Fedora 23 


Steps to Reproduce:
1. Virt-install command:

ID=fedevn07

set -x

virt-install \
-n ${ID} \
--description "DEVELOPMENT WS07 on Fedora/WS 23 iSCSI 64 bit ${ID}" \
--ram=2048 \
--vcpus=2 \
--os-variant=fedora22 \
--accelerate \
--hvm \
--network bridge:br0,model=virtio,rom_bar=off \
--nographics \
-l http://ftp.nluug.nl/pub/os/Linux/distr/fedora/linux/releases/23/Workstation/x86_64/os/ \
--boot loader_type=pflash,loader_ro=yes,loader=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd,nvram_template=/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd \
--nodisks  \
--initrd-inject=/home/pascal/kvm/${ID}.ks \
--extra-args="console=tty0 console=ttyS0,115200n8 serial ks=file:/${ID}.ks"

2. Kickstart file:

#version=DEVEL
install
# System authorization information
auth --enableshadow --passalgo=sha512
logging --level=debug
# Use network installation
url --url="http://ftp.nluug.nl/pub/os/Linux/distr/fedora/linux/releases/23/Workstation/x86_64/os/"
#url --url="http://mirror.1000mbps.com/fedora/linux/development/rawhide/Server/x86_64/os/"
# Use graphical install
#graphical
text
# Run the Setup Agent on first boot
firstboot --enable

# Keyboard layouts
keyboard --vckeymap=us-intl --xlayouts='us (intl)'
# System language
lang en_US.UTF-8

# Network information
network  --bootproto=dhcp --device=ens3 --ipv6=auto --activate
network  --hostname=fedevn07
# Root password
rootpw --iscrypted <topsecret>
# System timezone
timezone Europe/Amsterdam --isUtc
# X Window System configuration information
#xconfig  --startxonboot
iscsiname iqn.2015-12.nest.kleefdraakjes:fedevn07
iscsi --ipaddr 10.8.63.157
iscsi --ipaddr 10.8.63.133
ignoredisk --only-use=mpatha,mpathb,sdb,sda,sdd,sdc
# System bootloader configuration
bootloader --location=mbr --boot-drive=mpatha
# Partition clearing information
clearpart --none --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=500
part /boot/efi --fstype="efi" --size=200 --fsoptions="umask=0077,shortname=winnt"
part pv.224 --fstype="lvmpv" --ondisk=mpatha --size=8870
part pv.231 --fstype="lvmpv" --ondisk=mpathb --size=9570
volgroup fedora_fedevn07 --pesize=4096 pv.224 pv.231
logvol /  --fstype="xfs" --size=16384 --fsoptions="defaults,_netdev" --name=root --vgname=fedora_fedevn07
logvol swap  --fstype="swap" --size=2048 --name=swap --vgname=fedora_fedevn07

%packages
@^workstation-product-environment

%end


%post
/usr/bin/chvt 2
# redirect the output to the log file
exec >/root/ks-post-anaconda.log 2>&1
# show the output on the 7th console
tail -f /root/ks-post-anaconda.log >/dev/tty7 &
# changing to VT 7 that we can see what's going on....
/usr/bin/chvt 7

#
# Set the correct time
#

dnf -y install ntpdate

/usr/sbin/ntpdate -bus ntp.xs4all.nl
/sbin/clock --systohc


/bin/dnf -y clean all
/bin/dnf -y install wget
cd /tmp
#wget http://10.8.61.83/centos/local/7/repocfg.tgz
#wget http://10.8.61.83/centos/local/7/autofs.tar
cd /
#tar xvf /tmp/repocfg.tgz
#for k in /etc/pki/rpm-gpg/* ; do /bin/rpm --import ${k} ; done
dnf -y clean all

dnf -y update
dnf -y groups install mate-desktop

....

Etc


3. Run the above virt-install command (virt-install 1.3.2) 

Actual results:

FAILED] Failed to start Switch Root.
See 'systemctl status initrd-switch-root.service' for details.

Generating "/run/initramfs/rdsosreport.txt"


Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.


:/# systemctl status initrd--switch-root.service
\u25cf initrd--switch-root.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
:/# systemctl status initrd-switch-root.service 
\u25cf initrd-switch-root.service - Switch Root
   Loaded: loaded (/usr/lib/systemd/system/initrd-switch-root.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2016-03-25 13:20:14 UTC; 44s ago
  Process: 672 ExecStart=/usr/bin/systemctl --no-block --force switch-root /sysroot (code=exited, status=1/FAILURE)
 Main PID: 672 (code=exited, status=1/FAILURE)

Mar 25 13:20:14 localhost systemd[1]: Starting Switch Root...
Mar 25 13:20:14 localhost systemctl[672]: Failed to switch root: Specified s....
Mar 25 13:20:14 localhost systemd[1]: initrd-switch-root.service: Main proc...RE
Mar 25 13:20:14 localhost systemd[1]: Failed to start Switch Root.
Mar 25 13:20:14 localhost systemd[1]: initrd-switch-root.service: Unit ente...e.
Mar 25 13:20:14 localhost systemd[1]: initrd-switch-root.service: Triggerin...s.
Mar 25 13:20:14 localhost systemd[1]: initrd-switch-root.service: Failed wi...'.
Hint: Some lines were ellipsized, use -l to show in full.
:/# systemctl status initrd-switch-root.service  -l
\u25cf initrd-switch-root.service - Switch Root
   Loaded: loaded (/usr/lib/systemd/system/initrd-switch-root.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2016-03-25 13:20:14 UTC; 46s ago
  Process: 672 ExecStart=/usr/bin/systemctl --no-block --force switch-root /sysroot (code=exited, status=1/FAILURE)
 Main PID: 672 (code=exited, status=1/FAILURE)

Mar 25 13:20:14 localhost systemd[1]: Starting Switch Root...
Mar 25 13:20:14 localhost systemctl[672]: Failed to switch root: Specified switch root path /sysroot does not seem to be an OS tree. os-release file is missing.
Mar 25 13:20:14 localhost systemd[1]: initrd-switch-root.service: Main process exited, code=exited, status=1/FAILURE
Mar 25 13:20:14 localhost systemd[1]: Failed to start Switch Root.
Mar 25 13:20:14 localhost systemd[1]: initrd-switch-root.service: Unit entered failed state.
Mar 25 13:20:14 localhost systemd[1]: initrd-switch-root.service: Triggering OnFailure= dependencies.
Mar 25 13:20:14 localhost systemd[1]: initrd-switch-root.service: Failed with result 'exit-code'.
:/# 

Install aborts.

Expected results:

Install is being done conform kickstart file.


Additional info:

Under Centos-7 this works ok. Under earlier versions of Fedora 23 this worked ok too.

Comment 1 Pascal van Dam 2016-03-25 20:11:49 UTC
Ok. Did some further testing and analysis. Looks like the cause is happening earlier in the boot process:

[    8.867772] dracut-cmdline[177]: Traceback (most recent call last):
[    8.871588] dracut-cmdline[177]: File "/sbin/parse-kickstart", line 609, in <module>
[    8.874628] dracut-cmdline[177]: outfile, output = process_kickstart(path)
[    8.877433] dracut-cmdline[177]: File "/sbin/parse-kickstart", line 585, in process_kickstart
[    8.880589] dracut-cmdline[177]: processed_file = preprocessKickstart(ksfile)
[    8.883566] dracut-cmdline[177]: File "/usr/lib/python3.4/site-packages/pykickstart/parser.py", line 124, in preprocessKickstart
[    8.887406] dracut-cmdline[177]: contents = load_to_str(f)
[    8.889778] dracut-cmdline[177]: File "/usr/lib/python3.4/site-packages/pykickstart/load.py", line 44, in load_to_str
[    8.893354] dracut-cmdline[177]: return _load_file(location)
[  OK  ] Started dracut cmdline hook.
[    8.896543] audit: type=1130 audit(1458936549.016:8): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=dracut-cmdline comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    8.897995] dracut-cmdline[177]: File "/usr/lib/python3.4/site-packages/pykickstart/load.py", line 93, in _load_file
[    8.904277] dracut-cmdline[177]: contents = fh.read()
[    8.906194] dracut-cmdline[177]: File "/usr/lib64/python3.4/encodings/ascii.py", line 26, in decode
[    8.909971] dracut-cmdline[177]: return codecs.ascii_decode(input, self.errors)[0]
[    8.912334] dracut-cmdline[177]: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3144: ordinal not in range(128)
[    8.916977] dracut-cmdline[177]: /lib/anaconda-lib.sh: line 212: /tmp/ks.info: No such file or directory
[    8.943712] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    8.954019] Loading iSCSI transport class v2.0-870.
         Starting dracut pre-udev hook...
[    8.967814] iscsi: registered transport (tcp)
[    9.029812] FDC 0 is a S82078B
[    9.036215] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[    9.037661] EDD information not available.
[    9.053131] No iBFT detected.
[    9.059063] md: raid0 personality registered for level 0
[    9.069381] md: raid1 personality registered for level 1
[    9.105020] raid6: sse2x1   gen()  3562 MB/s
[    9.123029] raid6: sse2x1   xor()  2369 MB/s
[    9.141015] raid6: sse2x2   gen()  4949 MB/s
[    9.160014] raid6: sse2x2   xor()  3316 MB/s
[    9.177015] raid6: sse2x4   gen()  5093 MB/s
[    9.195012] raid6: sse2x4   xor()  3191 MB/s
[    9.213015] raid6: avx2x1   gen()  7148 MB/s
[    9.230015] raid6: avx2x2   gen()  9156 MB/s
[    9.248010] raid6: avx2x4   gen() 10679 MB/s
[    9.248879] raid6: using algorithm avx2x4 gen() 10679 MB/s
[    9.249926] raid6: using avx2x2 recovery algorithm
[    9.253301] async_tx: api initialized (async)
[    9.256502] xor: automatically using best checksumming function:
[    9.267009]    avx       : 14940.000 MB/sec
[    9.287148] md: raid6 personality registered for level 6
[    9.288351] md: raid5 personality registered for level 5
[    9.289442] md: raid4 personality registered for level 4
[    9.300661] md: raid10 personality registered for level 10
[    9.306094] md: linear personality registered for level -1
[    9.317838] device-mapper: multipath round-robin: version 1.0.0 loaded
[    9.329962] sha256_ssse3: Using AVX2 optimized SHA-256 implementation
[    9.368516] RPC: Registered named UNIX socket transport module.
[    9.369595] RPC: Registered udp transport module.
[    9.370426] RPC: Registered tcp transport module.
[    9.371256] RPC: Registered tcp NFSv4.1 backchannel transport module.
[  OK  ] Started dracut pre-udev hook.
[    9.487456] audit: type=1130 audit(1458936549.607:9): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=dracut-pre-udev comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
         Starting udev Kernel Device Manager...
[  OK  ] Started udev Kernel Device Manager.
[    9.507920] audit: type=1130 audit(1458936549.627:10): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-udevd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
         Starting dracut pre-trigger hook...
[    9.640951] dracut-pre-trigger[402]: cat: /tmp/dd_disk: No such file or directory


E.g. 8.867772] dracut-cmdline[177]: Traceback (most recent call last):
is where the it starts to go wrong.

Comment 2 David Shea 2016-03-28 13:47:22 UTC
Unfortunately, there is a bug in pykickstart that was not discovered until too late for Fedora 23. F23 switched to python 3 in the installer environment, and this issue is caused by the changes between 2 and 3 in how unicode strings are handled. The Fedora 23 installer cannot handle non-ASCII characters in kickstart files. This issue is fixed in Fedora 24.

*** This bug has been marked as a duplicate of bug 1280448 ***


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