Bug 1497444 - kernel-core package installation gives cat: write error: Broken pipe error
Summary: kernel-core package installation gives cat: write error: Broken pipe error
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: dracut-maint-list
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1502196 1525253 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-30 13:16 UTC by Ömer Fadıl Usta
Modified: 2018-04-30 02:57 UTC (History)
43 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-18 09:09:43 UTC
Type: Bug


Attachments (Terms of Use)
debug log of dracut (2.40 MB, text/plain)
2017-11-30 23:59 UTC, Heldwin
no flags Details

Description Ömer Fadıl Usta 2017-09-30 13:16:22 UTC
Description of problem:
Whenever trying to install kernel-core package it gives this error
cat: write error: Broken pipe
but completes the installation, maybe it is not an important bug but want to report it.

[usta@sakura ~]$ sudo dnf reinstall kernel-core
Last metadata expiration check: 0:30:52 ago on Sat 30 Sep 2017 03:40:54 PM EEST.
Dependencies resolved.
===================================================================================================================================================
 Package                           Arch                         Version                                        Repository                     Size
===================================================================================================================================================
Reinstalling:
 kernel-core                       x86_64                       4.14.0-0.rc2.git3.1.fc28                       rawhide                        23 M

Transaction Summary
===================================================================================================================================================

Total download size: 23 M
Is this ok [y/N]: y
Downloading Packages:
kernel-core-4.14.0-0.rc2.git3.1.fc28.x86_64.rpm                                                                    2.2 MB/s |  23 MB     00:10    
---------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                              2.0 MB/s |  23 MB     00:11     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                           1/1 
  Reinstalling     : kernel-core-4.14.0-0.rc2.git3.1.fc28.x86_64                                                                               1/2 
  Running scriptlet: kernel-core-4.14.0-0.rc2.git3.1.fc28.x86_64                                                                               1/2 
  Running scriptlet: kernel-core-4.14.0-0.rc2.git3.1.fc28.x86_64                                                                               2/2 
  Erasing          : kernel-core-4.14.0-0.rc2.git3.1.fc28.x86_64                                                                               2/2 
  Running scriptlet: kernel-core-4.14.0-0.rc2.git3.1.fc28.x86_64                                                                               2/2 
cat: write error: Broken pipe
  Verifying        : kernel-core-4.14.0-0.rc2.git3.1.fc28.x86_64                                                                               1/2 
  Verifying        : kernel-core-4.14.0-0.rc2.git3.1.fc28.x86_64                                                                               2/2 

Reinstalled:
  kernel-core.x86_64 4.14.0-0.rc2.git3.1.fc28                                                                                                      

Complete!

Comment 1 Axel Sommerfeldt 2017-10-14 09:44:31 UTC
Same here on Fedora 27:

dnf reinstall kernel-core
Failed to synchronize cache for repo 'taw-Riot', disabling.
Failed to synchronize cache for repo 'ring', disabling.
Last metadata expiration check: 2:23:57 ago on Sat Oct 14 09:17:53 2017.
Dependencies resolved.
============================================================================================================================================
 Package                           Arch                         Version                                  Repository                    Size
============================================================================================================================================
Reinstalling:
 kernel-core                       x86_64                       4.13.5-300.fc27                          fedora                        21 M

Transaction Summary
============================================================================================================================================

Total download size: 21 M
Is this ok [y/N]: y
Downloading Packages:
kernel-core-4.13.5-300.fc27.x86_64.rpm                                                                      534 kB/s |  21 MB     00:40    
--------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                       527 kB/s |  21 MB     00:41     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                    1/1 
  Reinstalling     : kernel-core-4.13.5-300.fc27.x86_64                                                                                 1/2 
  Running scriptlet: kernel-core-4.13.5-300.fc27.x86_64                                                                                 1/2 
  Running scriptlet: kernel-core-4.13.5-300.fc27.x86_64                                                                                 2/2 
  Erasing          : kernel-core-4.13.5-300.fc27.x86_64                                                                                 2/2 
  Running scriptlet: kernel-core-4.13.5-300.fc27.x86_64                                                                                 2/2 
cat: write error: Broken pipe
  Verifying        : kernel-core-4.13.5-300.fc27.x86_64                                                                                 1/2 
  Verifying        : kernel-core-4.13.5-300.fc27.x86_64                                                                                 2/2 

Reinstalled:
  kernel-core.x86_64 4.13.5-300.fc27                                                                                                        

Complete!

Comment 2 Laura Abbott 2017-11-10 16:47:51 UTC
*** Bug 1502196 has been marked as a duplicate of this bug. ***

Comment 3 Bojan Smojver 2017-11-18 01:16:21 UTC
Yeah, same problem here. My grub.cfg does not get edited properly either. No idea what's going on.

Comment 4 Amit Ugol 2017-11-22 04:22:16 UTC
I think that dracut creates a file with cat and then closes it causing cat to complain about the pipe. The verbose log from reinstalling kernel core: (set -x 
 in /usr/lib/kernel/install.d/50-dracut.install and add -v to the command.)

+ dracut -v /boot/2ac2df52725849988ffb627438d0378d/4.13.13-300.fc27.x86_64/initrd 4.13.13-300.fc27.x86_64
dracut: Executing: /usr/bin/dracut -v /boot/2ac2df52725849988ffb627438d0378d/4.13.13-300.fc27.x86_64/initrd 4.13.13-300.fc27.x86_64
dracut: dracut module 'busybox' will not be installed, because command 'busybox' could not be found!
dracut: dracut module 'biosdevname' will not be installed, because command 'biosdevname' could not be found!
dracut: dracut module 'busybox' will not be installed, because command 'busybox' could not be found!
dracut: *** Including module: bash ***
dracut: *** Including module: systemd ***
dracut: *** Including module: systemd-initrd ***
dracut: *** Including module: nss-softokn ***
dracut: *** Including module: i18n ***
dracut: *** Including module: network ***
dracut: *** Including module: ifcfg ***
dracut: *** Including module: drm ***
dracut: *** Including module: plymouth ***
dracut: *** Including module: kernel-modules ***
dracut: *** Including module: kernel-network-modules ***
dracut: *** Including module: resume ***
dracut: *** Including module: rootfs-block ***
dracut: *** Including module: terminfo ***
dracut: *** Including module: udev-rules ***
dracut: Skipping udev rule: 40-redhat.rules
dracut: Skipping udev rule: 50-firmware.rules
dracut: Skipping udev rule: 50-udev.rules
dracut: Skipping udev rule: 91-permissions.rules
dracut: Skipping udev rule: 80-drivers-modprobe.rules
dracut: *** Including module: dracut-systemd ***
dracut: *** Including module: usrmount ***
dracut: *** Including module: base ***
dracut: *** Including module: fs-lib ***
dracut: *** Including module: shutdown ***
dracut: *** Including modules done ***
dracut: *** Installing kernel module dependencies ***
dracut: *** Installing kernel module dependencies done ***
dracut: *** Resolving executable dependencies ***
dracut: *** Resolving executable dependencies done***
dracut: *** Hardlinking files ***
dracut: *** Hardlinking files done ***
dracut: *** Stripping files ***
dracut: *** Stripping files done ***
dracut: *** Generating early-microcode cpio image ***
dracut: *** Constructing GenuineIntel.bin ****
dracut: *** Store current command line parameters ***
dracut: *** Creating image file '/boot/2ac2df52725849988ffb627438d0378d/4.13.13-300.fc27.x86_64/initrd' ***
cat: write error: Broken pipe
dracut: *** Creating initramfs image file '/boot/2ac2df52725849988ffb627438d0378d/4.13.13-300.fc27.x86_64/initrd' done ***
+ ret=0
+ exit 0

Comment 5 Bojan Smojver 2017-11-22 04:26:02 UTC
(In reply to Bojan Smojver from comment #3)
> Yeah, same problem here. My grub.cfg does not get edited properly either. No
> idea what's going on.

BTW, this may have been a permissions problem. For whatever reason, /boot/grub2/grub.cfg on this one machine had 0400 permissions. Anyway, we'll see at the next kernel upgrade with 0664 permissions set.

Comment 6 Bojan Smojver 2017-11-22 10:02:33 UTC
(In reply to Bojan Smojver from comment #5)

> BTW, this may have been a permissions problem. For whatever reason,
> /boot/grub2/grub.cfg on this one machine had 0400 permissions. Anyway, we'll
> see at the next kernel upgrade with 0664 permissions set.

Nope. Just upgraded the same box to 4.13.14 and grub.cfg still did not get edited. Reboot brought the box back to the only (and old) kernel in grub.cfg.

Comment 7 Bojan Smojver 2017-11-23 07:22:49 UTC
(In reply to Bojan Smojver from comment #6)

> Nope. Just upgraded the same box to 4.13.14 and grub.cfg still did not get
> edited. Reboot brought the box back to the only (and old) kernel in grub.cfg.

Somehow, I must have removed grub2-pc package from this machine. Once I put that back, everything started working as expected. PEBKAC.

Comment 8 Jason Dickerson 2017-11-29 16:22:13 UTC
I assume it goes without saying, but this happens when installing kernel-debug-core as well.  

Also I have noticed the following in /boot:

[root@jdickers ~]# ls -lR /boot/3053295745c94057a40abbffb5ed2703/
/boot/3053295745c94057a40abbffb5ed2703/:
total 4
drwxr-xr-x. 2 root root 1024 Nov 29 10:14 4.13.15-300.fc27.x86_64
drwxr-xr-x. 2 root root 1024 Nov 29 10:13 4.13.15-300.fc27.x86_64+debug

/boot/3053295745c94057a40abbffb5ed2703/4.13.15-300.fc27.x86_64:
total 0

/boot/3053295745c94057a40abbffb5ed2703/4.13.15-300.fc27.x86_64+debug:
total 0
[root@jdickers ~]# 


Could this be a symptom of the broken pipe?

Comment 9 Heldwin 2017-11-30 23:59:40 UTC
Created attachment 1361367 [details]
debug log of dracut

I also see this bug on f27, when I install a new kernel, or reinstall: 
kernel-core-4.13.16-300.fc27.x86_64

It seems to only appear after the removal of the reinstalled kernel.
But my grub.cfg is correctly updated.

If I remove: dracut-config-rescue-046-5.fc27.x86_64
I don't have anymore a:
initramfs-0-rescue-$(cat /etc/machine-id).img
vmlinuz-0-rescue-$(cat /etc/machine-id)

in /boot, but only a folder with the content of /etc/machine-id, that is not deleted.

If you look in the attachment, you see also 2 --help getting triggered (one for ln and an other for cpio)

Comment 10 Tom Horsley 2017-12-05 12:19:35 UTC
I'm still seeing this, along with a new error:

  Running scriptlet: kernel-core-4.13.16-302.fc27.x86_64                  21/21 
ln: target '/boot/dtb' is not a directory
cat: write error: Broken pipe

My system still boots, but it is not very confidence inspiring to get random meaningless error spewed out when installing a new kernel.

Comment 11 Heldwin 2017-12-12 22:13:29 UTC
If I add: stdloglvl=6, in /usr/lib/dracut/dracut-logger.sh, I get more verbose infos, but I am not sure what is the source of the problem.

It leads to /usr/bin/lsinitrd (maybe something close to bug #1323401 ?), and I can see a relation with:
echo "Early CPIO image"
list_files

and all the variants of:
$CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5 
$CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9
etc.

If I comment the function: list_files, I don't get the broken pipe anymore, but maybe there are more things related.

The print to stdout seems to be laggy(?), so the broken pipe happens and is printed before the others lines that should be normally printed after. So it is confusing while trying to debug.

There is also a problem with:
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
        $(dracutlibdirs 'dracut-*') 2>/dev/null)
((ret+=$?))
echo "Version: $version"

having an empty variable $version, even if I comment the function: list_files.

Not sure if it really helps to find out what is happening, but I posted where I was lost. Maybe someone has an idea.

Comment 12 Laura Abbott 2017-12-12 23:09:50 UTC
*** Bug 1525253 has been marked as a duplicate of this bug. ***

Comment 13 Patrick Mansfield 2017-12-19 18:05:45 UTC
I'm also seeing this with Fedora 27 on two different systems.

It looks this is harmless output, as there's a change in the dracut repo to just ignore the lsinitrd "cat" errors, but there's no explanation in the changelog here:

https://git.kernel.org/pub/scm/boot/dracut/dracut.git/commit/?id=e190224345f3a8b2f9e85d84bc879dd96bf265da

There was also a previous change to avoid outputting the "Broken pipe" error at least in some cases, this change:

https://git.kernel.org/pub/scm/boot/dracut/dracut.git/commit/lsinitrd.sh?id=3ce142861d88c357864d3a3bef7ec453826d737d

Comment 14 Laura Abbott 2017-12-19 19:05:27 UTC
This is almost certainly dracut related and not the kernel or any of its packaging.

Comment 15 Robert Scheck 2017-12-20 02:02:07 UTC
Oh dear, fancy "pagure over dist-git" stuff is just broken. I am definitely
not the default assignee for "dracut", re-assigning manually. And the whole
mess is only because I created a fork of dracut in pagure to provide a small
patch...

Comment 16 kevin 2018-01-13 18:08:54 UTC
This issue just happened to me but there wasn't any problem adding an entry to /boot/grub2/grub.cfg and I rebooted with the new kernel without an issue.

Comment 17 Russell Odom 2018-01-17 12:22:02 UTC
I am seeing this same error, and /boot/grub2/grub.cfg was not being updated with new kernel installations (the fc27 kernel when I initially upgraded from fc25 was added, but nothing since).

I installed grub2-pc as per comment 7 (thanks for the tip, Bojan!) and reinstalled the latest kernel-core, and although the "cat: write error: Broken pipe" still shows, grub.cfg is now being updated with the new kernel.

Looking through "dnf history", it seems grub2-pc got removed when I did a "dnf autoremove" as part of my post-upgrade cleanup. I think this needs to be set as an explicit dependency of the kernel-core package so it's not removed. I will log a separate bug for that.

Comment 18 Russell Odom 2018-01-17 12:34:35 UTC
Bug 1535458 logged.

Comment 20 Harald Hoyer 2018-01-18 09:09:43 UTC
dracut-046-92.git20180118.fc28


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