Bug 1012787 - BootLoaderError: failed to set new efi boot target
BootLoaderError: failed to set new efi boot target
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: efibootmgr (Show other bugs)
rawhide
Unspecified Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
: FutureFeature, Reopened
Depends On:
Blocks: 782468
  Show dependency treegraph
 
Reported: 2013-09-27 02:58 EDT by Ladislav Jozsa
Modified: 2016-08-18 22:25 EDT (History)
13 users (show)

See Also:
Fixed In Version: efibootmgr-13-2.fc25
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-18 22:25:04 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
anaconda-tb (589.59 KB, text/plain)
2013-09-27 02:58 EDT, Ladislav Jozsa
no flags Details
anaconda.log (9.10 KB, text/plain)
2013-09-27 03:00 EDT, Ladislav Jozsa
no flags Details
packaging.log (101.78 KB, text/plain)
2013-09-27 03:00 EDT, Ladislav Jozsa
no flags Details
program.log (54.80 KB, text/plain)
2013-09-27 03:00 EDT, Ladislav Jozsa
no flags Details
storage.log (220.91 KB, text/plain)
2013-09-27 03:00 EDT, Ladislav Jozsa
no flags Details
sys.log (177.72 KB, text/plain)
2013-09-27 03:00 EDT, Ladislav Jozsa
no flags Details

  None (edit)
Description Ladislav Jozsa 2013-09-27 02:58:32 EDT
Created attachment 803772 [details]
anaconda-tb

Description of problem:
When running beaker job, testing autopart I got following traceback:

anaconda 19.31.18-1 exception report
Traceback (most recent call first):
  File "/usr/lib64/python2.7/site-packages/pyanaconda/bootloader.py", line 1671, in add_efi_boot_target
    raise BootLoaderError("failed to set new efi boot target")
  File "/usr/lib64/python2.7/site-packages/pyanaconda/bootloader.py", line 1676, in install
    self.add_efi_boot_target()
  File "/usr/lib64/python2.7/site-packages/pyanaconda/bootloader.py", line 1695, in write
    self.install()
  File "/usr/lib64/python2.7/site-packages/pyanaconda/bootloader.py", line 2352, in writeBootLoader
    storage.bootloader.write()
  File "/usr/lib64/python2.7/site-packages/pyanaconda/install.py", line 172, in doInstall
    writeBootLoader(storage, payload, instClass, ksdata)
  File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 168, in run
    threading.Thread.run(self, *args, **kwargs)
BootLoaderError: failed to set new efi boot target

Local variables in innermost frame:
boot_part_num: 1
self: <pyanaconda.bootloader.EFIGRUB object at 0x7fc157e43a50>
boot_disk: existing 30029MB disk sda (0) with existing gpt disklabel
rc: 1

Version-Release number of selected component (if applicable):
anaconda-19.31.18-1.el7

How reproducible:
seen once

Actual results:
Traceback occured

Expected results:
No traceback should occur

Additional info:
https://beaker.engineering.redhat.com/jobs/504493
Comment 1 Ladislav Jozsa 2013-09-27 03:00:33 EDT
Created attachment 803773 [details]
anaconda.log
Comment 2 Ladislav Jozsa 2013-09-27 03:00:38 EDT
Created attachment 803774 [details]
packaging.log
Comment 3 Ladislav Jozsa 2013-09-27 03:00:43 EDT
Created attachment 803775 [details]
program.log
Comment 4 Ladislav Jozsa 2013-09-27 03:00:48 EDT
Created attachment 803776 [details]
storage.log
Comment 5 Ladislav Jozsa 2013-09-27 03:00:53 EDT
Created attachment 803777 [details]
sys.log
Comment 7 Brian Lane 2013-09-27 20:38:46 EDT
That means there is no space left in your UEFI variable storage. You have an incredible number of boot entries listed:

11:46:23,448 INFO program: Running... efibootmgr
11:46:27,687 INFO program: BootCurrent: 0003
11:46:27,688 INFO program: Timeout: 10 seconds
11:46:27,688 INFO program: BootOrder: 0003,009E,00C6,00C7,00C8,00C9,00CA,00CB,00CC,00CD,00CE,00CF,00D0,00D1,00D2
11:46:27,688 INFO program: Boot0000* CD/DVD Rom
11:46:27,689 INFO program: Boot0001* Floppy Disk
11:46:27,689 INFO program: Boot0002* Hard Disk 0
11:46:27,689 INFO program: Boot0003* PXE Network
11:46:27,690 INFO program: Boot0004* Hard Disk 1
11:46:27,690 INFO program: Boot0005* Hard Disk 2
11:46:27,690 INFO program: Boot0006* Hard Disk 3
11:46:27,691 INFO program: Boot0007* Hard Disk 4
11:46:27,691 INFO program: Boot0008* USB Storage
11:46:27,691 INFO program: Boot0009* Diagnostics
11:46:27,691 INFO program: Boot000A* iSCSI
11:46:27,691 INFO program: Boot000B* iSCSI Critical
11:46:27,692 INFO program: Boot000C* Legacy Only
11:46:27,692 INFO program: Boot000D* Embedded Hypervisor
11:46:27,692 INFO program: Boot000E* Fedora
11:46:27,692 INFO program: Boot000F* CD/DVD Rom
11:46:27,692 INFO program: Boot0010* Floppy Disk
11:46:27,692 INFO program: Boot0011* Hard Disk 0
11:46:27,693 INFO program: Boot0012* Hard Disk 1
11:46:27,693 INFO program: Boot0013* Hard Disk 2
11:46:27,693 INFO program: Boot0014* Hard Disk 3
11:46:27,693 INFO program: Boot0015* Hard Disk 4
11:46:27,693 INFO program: Boot0016* USB Storage
11:46:27,693 INFO program: Boot0017* Diagnostics
11:46:27,694 INFO program: Boot0018* iSCSI
11:46:27,694 INFO program: Boot0019* iSCSI Critical
11:46:27,694 INFO program: Boot001A* Legacy Only
11:46:27,694 INFO program: Boot001B* Embedded Hypervisor
11:46:27,694 INFO program: Boot001C* CD/DVD Rom
11:46:27,694 INFO program: Boot001D* Floppy Disk
11:46:27,695 INFO program: Boot001E* Hard Disk 0
11:46:27,695 INFO program: Boot001F* Hard Disk 1
11:46:27,695 INFO program: Boot0020* Hard Disk 2
11:46:27,695 INFO program: Boot0021* Hard Disk 3
11:46:27,695 INFO program: Boot0022* Hard Disk 4
11:46:27,695 INFO program: Boot0023* USB Storage
11:46:27,696 INFO program: Boot0024* Diagnostics
11:46:27,696 INFO program: Boot0025* iSCSI
11:46:27,696 INFO program: Boot0026* iSCSI Critical
11:46:27,696 INFO program: Boot0027* Legacy Only
11:46:27,696 INFO program: Boot0028* Embedded Hypervisor
11:46:27,696 INFO program: Boot0029* CD/DVD Rom
11:46:27,697 INFO program: Boot002A* Floppy Disk
11:46:27,697 INFO program: Boot002B* Hard Disk 0
11:46:27,697 INFO program: Boot002C* Hard Disk 1
11:46:27,697 INFO program: Boot002D* Hard Disk 2
11:46:27,697 INFO program: Boot002E* Hard Disk 3
11:46:27,697 INFO program: Boot002F* Hard Disk 4
11:46:27,697 INFO program: Boot0030* USB Storage
11:46:27,697 INFO program: Boot0031* Diagnostics
11:46:27,698 INFO program: Boot0032* iSCSI
11:46:27,698 INFO program: Boot0033* iSCSI Critical
11:46:27,698 INFO program: Boot0034* Legacy Only
11:46:27,698 INFO program: Boot0035* Embedded Hypervisor
11:46:27,698 INFO program: Boot0036* CD/DVD Rom
11:46:27,698 INFO program: Boot0037* Floppy Disk
11:46:27,698 INFO program: Boot0038* Hard Disk 0
11:46:27,699 INFO program: Boot0039* Hard Disk 1
11:46:27,699 INFO program: Boot003A* Hard Disk 2
11:46:27,699 INFO program: Boot003B* Hard Disk 3
11:46:27,699 INFO program: Boot003C* Hard Disk 4
11:46:27,699 INFO program: Boot003D* USB Storage
11:46:27,699 INFO program: Boot003E* Diagnostics
11:46:27,699 INFO program: Boot003F* iSCSI
11:46:27,699 INFO program: Boot0040* iSCSI Critical
11:46:27,700 INFO program: Boot0041* Legacy Only
11:46:27,700 INFO program: Boot0042* Embedded Hypervisor
11:46:27,700 INFO program: Boot0043* CD/DVD Rom
11:46:27,700 INFO program: Boot0044* Floppy Disk
11:46:27,700 INFO program: Boot0045* Hard Disk 0
11:46:27,700 INFO program: Boot0046* Hard Disk 1
11:46:27,700 INFO program: Boot0047* Hard Disk 2
11:46:27,701 INFO program: Boot0048* Hard Disk 3
11:46:27,701 INFO program: Boot0049* Hard Disk 4
11:46:27,701 INFO program: Boot004A* USB Storage
11:46:27,701 INFO program: Boot004B* Diagnostics
11:46:27,701 INFO program: Boot004C* iSCSI
11:46:27,701 INFO program: Boot004D* iSCSI Critical
11:46:27,701 INFO program: Boot004E* Legacy Only
11:46:27,702 INFO program: Boot004F* Embedded Hypervisor
11:46:27,702 INFO program: Boot0050* CD/DVD Rom
11:46:27,702 INFO program: Boot0051* Floppy Disk
11:46:27,702 INFO program: Boot0052* Hard Disk 0
11:46:27,702 INFO program: Boot0053* Hard Disk 1
11:46:27,702 INFO program: Boot0054* Hard Disk 2
11:46:27,702 INFO program: Boot0055* Hard Disk 3
11:46:27,702 INFO program: Boot0056* Hard Disk 4
11:46:27,703 INFO program: Boot0057* USB Storage
11:46:27,703 INFO program: Boot0058* Diagnostics
11:46:27,703 INFO program: Boot0059* iSCSI
11:46:27,703 INFO program: Boot005A* iSCSI Critical
11:46:27,703 INFO program: Boot005B* Legacy Only
11:46:27,703 INFO program: Boot005C* Embedded Hypervisor
11:46:27,703 INFO program: Boot005D* CD/DVD Rom
11:46:27,703 INFO program: Boot005E* Floppy Disk
11:46:27,704 INFO program: Boot005F* Hard Disk 0
11:46:27,704 INFO program: Boot0060* Hard Disk 1
11:46:27,704 INFO program: Boot0061* Hard Disk 2
11:46:27,704 INFO program: Boot0062* Hard Disk 3
11:46:27,704 INFO program: Boot0063* Hard Disk 4
11:46:27,704 INFO program: Boot0064* USB Storage
11:46:27,704 INFO program: Boot0065* Diagnostics
11:46:27,705 INFO program: Boot0066* iSCSI
11:46:27,705 INFO program: Boot0067* iSCSI Critical
11:46:27,705 INFO program: Boot0068* Legacy Only
11:46:27,705 INFO program: Boot0069* Embedded Hypervisor
11:46:27,705 INFO program: Boot006A* CD/DVD Rom
11:46:27,705 INFO program: Boot006B* Floppy Disk
11:46:27,705 INFO program: Boot006C* Hard Disk 0
11:46:27,706 INFO program: Boot006D* Hard Disk 1
11:46:27,706 INFO program: Boot006E* Hard Disk 2
11:46:27,706 INFO program: Boot006F* Hard Disk 3
11:46:27,706 INFO program: Boot0070* Hard Disk 4
11:46:27,706 INFO program: Boot0071* USB Storage
11:46:27,706 INFO program: Boot0072* Diagnostics
11:46:27,706 INFO program: Boot0073* iSCSI
11:46:27,707 INFO program: Boot0074* iSCSI Critical
11:46:27,707 INFO program: Boot0075* Legacy Only
11:46:27,707 INFO program: Boot0076* Embedded Hypervisor
11:46:27,707 INFO program: Boot0077* CD/DVD Rom
11:46:27,707 INFO program: Boot0078* Floppy Disk
11:46:27,707 INFO program: Boot0079* Hard Disk 0
11:46:27,707 INFO program: Boot007A* Hard Disk 1
11:46:27,708 INFO program: Boot007B* Hard Disk 2
11:46:27,708 INFO program: Boot007C* Hard Disk 3
11:46:27,708 INFO program: Boot007D* Hard Disk 4
11:46:27,708 INFO program: Boot007E* USB Storage
11:46:27,708 INFO program: Boot007F* Diagnostics
11:46:27,708 INFO program: Boot0080* iSCSI
11:46:27,708 INFO program: Boot0081* iSCSI Critical
11:46:27,709 INFO program: Boot0082* Legacy Only
11:46:27,709 INFO program: Boot0083* Embedded Hypervisor
11:46:27,709 INFO program: Boot0084* CD/DVD Rom
11:46:27,709 INFO program: Boot0085* Floppy Disk
11:46:27,709 INFO program: Boot0086* Hard Disk 0
11:46:27,709 INFO program: Boot0087* Hard Disk 1
11:46:27,709 INFO program: Boot0088* Hard Disk 2
11:46:27,710 INFO program: Boot0089* Hard Disk 3
11:46:27,710 INFO program: Boot008A* Hard Disk 4
11:46:27,710 INFO program: Boot008B* USB Storage
11:46:27,710 INFO program: Boot008C* Diagnostics
11:46:27,710 INFO program: Boot008D* iSCSI
11:46:27,710 INFO program: Boot008E* iSCSI Critical
11:46:27,710 INFO program: Boot008F* Legacy Only
11:46:27,711 INFO program: Boot0090* Embedded Hypervisor
11:46:27,711 INFO program: Boot0091* CD/DVD Rom
11:46:27,711 INFO program: Boot0092* Floppy Disk
11:46:27,711 INFO program: Boot0093* Hard Disk 0
11:46:27,711 INFO program: Boot0094* Hard Disk 1
11:46:27,711 INFO program: Boot0095* Hard Disk 2
11:46:27,711 INFO program: Boot0096* Hard Disk 3
11:46:27,712 INFO program: Boot0097* Hard Disk 4
11:46:27,712 INFO program: Boot0098* USB Storage
11:46:27,712 INFO program: Boot0099* Diagnostics
11:46:27,712 INFO program: Boot009A* iSCSI
11:46:27,712 INFO program: Boot009B* iSCSI Critical
11:46:27,712 INFO program: Boot009C* Legacy Only
11:46:27,712 INFO program: Boot009D* Embedded Hypervisor
11:46:27,713 INFO program: Boot009F* CD/DVD Rom
11:46:27,713 INFO program: Boot00A0* Floppy Disk
11:46:27,713 INFO program: Boot00A1* Hard Disk 0
11:46:27,713 INFO program: Boot00A2* Hard Disk 1
11:46:27,713 INFO program: Boot00A3* Hard Disk 2
11:46:27,713 INFO program: Boot00A4* Hard Disk 3
11:46:27,713 INFO program: Boot00A5* Hard Disk 4
11:46:27,714 INFO program: Boot00A6* USB Storage
11:46:27,714 INFO program: Boot00A7* Diagnostics
11:46:27,714 INFO program: Boot00A8* iSCSI
11:46:27,714 INFO program: Boot00A9* iSCSI Critical
11:46:27,714 INFO program: Boot00AA* Legacy Only
11:46:27,714 INFO program: Boot00AB* Embedded Hypervisor
11:46:27,714 INFO program: Boot00AC* CD/DVD Rom
11:46:27,715 INFO program: Boot00AD* Floppy Disk
11:46:27,715 INFO program: Boot00AE* Hard Disk 0
11:46:27,715 INFO program: Boot00AF* Hard Disk 1
11:46:27,715 INFO program: Boot00B0* Hard Disk 2
11:46:27,715 INFO program: Boot00B1* Hard Disk 3
11:46:27,715 INFO program: Boot00B2* Hard Disk 4
11:46:27,715 INFO program: Boot00B3* USB Storage
11:46:27,715 INFO program: Boot00B4* Diagnostics
11:46:27,716 INFO program: Boot00B5* iSCSI
11:46:27,716 INFO program: Boot00B6* iSCSI Critical
11:46:27,716 INFO program: Boot00B7* Legacy Only
11:46:27,716 INFO program: Boot00B8* Embedded Hypervisor
11:46:27,716 INFO program: Boot00B9* CD/DVD Rom
11:46:27,716 INFO program: Boot00BA* Floppy Disk
11:46:27,716 INFO program: Boot00BB* Hard Disk 0
11:46:27,717 INFO program: Boot00BC* Hard Disk 1
11:46:27,717 INFO program: Boot00BD* Hard Disk 2
11:46:27,717 INFO program: Boot00BE* Hard Disk 3
11:46:27,717 INFO program: Boot00BF* Hard Disk 4
11:46:27,717 INFO program: Boot00C0* USB Storage
11:46:27,717 INFO program: Boot00C1* Diagnostics
11:46:27,717 INFO program: Boot00C2* iSCSI
11:46:27,718 INFO program: Boot00C3* iSCSI Critical
11:46:27,718 INFO program: Boot00C4* Legacy Only
11:46:27,718 INFO program: Boot00C5* Embedded Hypervisor
11:46:27,718 INFO program: Boot00C6* CD/DVD Rom
11:46:27,718 INFO program: Boot00C7* Floppy Disk
11:46:27,718 INFO program: Boot00C8* Hard Disk 0
11:46:27,718 INFO program: Boot00C9* Hard Disk 1
11:46:27,718 INFO program: Boot00CA* Hard Disk 2
11:46:27,719 INFO program: Boot00CB* Hard Disk 3
11:46:27,719 INFO program: Boot00CC* Hard Disk 4
11:46:27,719 INFO program: Boot00CD* USB Storage
11:46:27,719 INFO program: Boot00CE* Diagnostics
11:46:27,719 INFO program: Boot00CF* iSCSI
11:46:27,719 INFO program: Boot00D0* iSCSI Critical
11:46:27,720 INFO program: Boot00D1* Legacy Only
11:46:27,720 INFO program: Boot00D2* Embedded Hypervisor
11:46:27,720 DEBUG program: Return code: 0
11:46:27,720 INFO program: Running... efibootmgr -c -w -L Red Hat Enterprise Linux -d /dev/sda -p 1 -l \EFI\redhat\shim.efi
11:46:31,954 DEBUG program: Return code: 1
Comment 8 Martin Banas 2013-09-30 02:25:28 EDT
Hi Brian,

Still this is a bug. Anaconda should inform user about this instead of displaying traceback. Reopening.
Comment 10 David Cantrell 2014-01-24 15:54:19 EST
This is a corner case for general RHEL and Fedora users, but it does hit us internally on beaker-controlled systems.  The easiest thing to do right now would be to update beaker so it cleans out UEFI variables periodically (or all the time when a new system is provisioned?).  We do not have time to explore UEFI variable editing in anaconda right now and it's not something we are likely to explore in RHEL.  This can be discussed in Fedora.
Comment 12 Nick Coghlan 2014-01-27 21:22:22 EST
I'm not entirely clear on what is being requested of Beaker here.

The "out of nvram" bug was traced back to buggy vendor firmware as part of the investigation of bug 1030612 (if passed an incomplete boot order, some vendor firmware will add its default entries to the list of boot options *again*, without checking if they're already there. Do this enough times, and the boot option definitions no longer fit in the available nvram).

Since efibootmgr doesn't work around that firmware misbehaviour implicitly, the Beaker rhts_post snippet was updated in 0.14.4 to avoid it by always passing all currently existing boot order entries into the "efibootmgr -o" command.

The Beaker 0.14.4 change means that any systems that are already afflicted by the firmware bug should be able to clear their nvram entries and the next provisioning cycle should sort them out.

However, I'm wary of automating that process, since the handling of UEFI variable storage is currently fraught with vendor-specific bugs, and we mess with it at our own peril. (See http://womble.decadent.org.uk/blog/the-terrible-state-of-efi-variable-storage.html for a decent overview)

It seems much safer to file tickets with eng-ops requesting that the UEFI variables be cleared manually on affected systems, so that an admin is already on-hand if anything goes wrong with that process.

I'm not sure whether or not there is an RFE or docs bug against "efibootmgr -o" about that potential issue - all an end user needs to do to trigger it on affected systems is to pass an incomplete list of boot options to "efibootmgr -o" enough times. Beaker was doing that because just passing the value of "BootCurrent" to efibootmgr -o was the easiest way for us to ensure the system always booted from the network by default (using BootNext to specify local boot when we wanted it), and anyone else that wants to ensure netboot stays at the head of the boot order seems quite likely to end up doing something similar until they get bitten by the same problem we did.
Comment 14 Dan Callaghan 2014-10-15 03:17:43 EDT
So I think we all agree that Beaker shouldn't try clearing EFI variables automatically.

Therefore setting this bug back to Anaconda, as an RFE for showing a helpful error if efibootmgr fails. The Anaconda folks can close as WONTFIX if that doesn't seem worthwhile to them.
Comment 15 Brian Lane 2014-10-17 19:50:32 EDT
efibootmgr needs to give us more info. pjones has a patch for this.
Comment 16 Peter Jones 2014-10-20 15:20:53 EDT
https://admin.fedoraproject.org/updates/efibootmgr-0.10.0-1.fc20 (and similar for .fc19, .fc21, and .fc22) should be more verbose about the error.
Comment 17 Fedora Update System 2016-08-17 13:32:52 EDT
pesign-0.112-4.fc25 mokutil-0.3.0-3.fc25 efibootmgr-13-2.fc25 efivar-28-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-650675f139
Comment 18 Fedora Update System 2016-08-17 15:52:14 EDT
efibootmgr-13-2.fc25, efivar-28-1.fc25, mokutil-0.3.0-3.fc25, pesign-0.112-4.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-650675f139
Comment 19 Fedora Update System 2016-08-18 22:24:30 EDT
efibootmgr-13-2.fc25, efivar-28-1.fc25, mokutil-0.3.0-3.fc25, pesign-0.112-4.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

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