grub-install: error: failed to register the EFI boot entry: Invalid argument (FAT /boot/efi partition)

Bug #2068684 reported by L. John Collier

This bug report will be marked for expiration in 39 days if no further activity occurs. (find out why)

12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
subiquity
Incomplete
Undecided
Unassigned
ubuntu-desktop-provision
Incomplete
Undecided
Unassigned

Bug Description

During installation the process stopped with a message that "something went wrong."
From the log it appears that the problem may be associated with grub. This message appears repeatedly in the log: "grub-install: warning: Cannot set EFI variable Boot0002." Another "grub-install: error: failed to register the EFI boot entry: Invalid argument" also appears frequently.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report Could you add the logs from/var/log/installer after getting the problem?

Also could you give details on your partitioning choices, especially for /boot?

Changed in ubuntu-desktop-provision:
status: New → Incomplete
summary: - "Something went wrong" during install
+ grub-install: error: failed to register the EFI boot entry: Invalid
+ argument
Changed in subiquity:
status: New → Incomplete
Revision history for this message
L. John Collier (colliers-barci-westnet) wrote : Re: [Bug 2068684] Re: "Something went wrong" during install

Hi Sebastien,

There is no log in /var/log/installer . . .

This screenshot shows the partitions as I chose to set them up.

screenshot of partitions

Partition 1 is /boot/efi
Partition 2 is Filesystem Root.  I/t/ contains Ubuntu 24.04 (?) as per
the following screenshot

Partition 3 is /home, containing all my data (nothing on this system yet).
Partition 4 is Swap.

You are correct to surmise that subiquity is  involved.  It appeared in
all of the lines of the log where there was an error message.

Regards.

John

On 7/6/24 4:51 pm, Sebastien Bacher wrote:
> Thank you for your bug report Could you add the logs
> from/var/log/installer after getting the problem?
>
> Also could you give details on your partitioning choices, especially for
> /boot?
>
>
> ** Also affects: subiquity
> Importance: Undecided
> Status: New
>
> ** Changed in: ubuntu-desktop-provision
> Status: New => Incomplete
>
> ** Summary changed:
>
> - "Something went wrong" during install
> + grub-install: error: failed to register the EFI boot entry: Invalid argument
>
> ** Changed in: subiquity
> Status: New => Incomplete
>

Revision history for this message
Sebastien Bacher (seb128) wrote (last edit ): Re: grub-install: error: failed to register the EFI boot entry: Invalid argument

The log should be there after you see the error, where did you check? During the installer session?

You wrote in your original description
> This message appears repeatedly in the log: "grub-install: warning: Cannot set EFI variable Boot0002."
which log were you referring to?

Could you also provide extra details on your /boot/efi? Which filesystem is used on the partition you selected?

Revision history for this message
L. John Collier (colliers-barci-westnet) wrote : Re: [Bug 2068684] Re: grub-install: error: failed to register the EFI boot entry: Invalid argument

Hi Sebastien.

I shall reply seriatum if that is OK, using red text.

On 10/6/24 4:34 pm, Sebastien Bacher wrote:
> The log should be there after you see the error, where did you check?
> During the installer session?
The log I saw appeared after I agreed to report the problem.  It was on
screen.  Apparently it did not get saved,  I certainly did not save it .
. .
> You wrote in your original description
>> This message appears repeatedly in the log: "grub-install: warning: Cannot set EFI variable Boot0002."
> which log were you referring to?
The one that appeared on screen after I agreed to report the problem.
>
> Could you also provide extra details on your /boot/efi? Which filesystem
> is used on the partition you selected?
The file system used on the /boot/efi  partition is reported as "FAT (32
bit version)". This is the same as the file system used on the
boot/EFI/  partition of the Ubuntu 22.04 installation on my desktop PC.
I'm not sure whether it means anything, but the /boot/efi  folder in the
problem installation of Ubuntu 24.04, appears to be empty.  The same
folder in the desktop equivalent folder contains 10MB.

You may also be interested to note that the new install of 24.04 is on a
fairly new ASUS F1603Z laptop.  After I finished with the bug report I
discovered that the machine was, as you might expect, still running on
the live session off the USB stick installation media.  I shut that down
normally, removed the USB device and restarted the machine.  It started
normally and appears to be running properly.  The machine starts and
stops normally.

John.

summary: grub-install: error: failed to register the EFI boot entry: Invalid
- argument
+ argument (FAT /boot/efi partition)
Revision history for this message
Sorcerer (al.drozdov) wrote (last edit ):

On my old ASUS X200MA I got the similar problem (secure boot is off). But the error was not 'Cannot set EFI variable Boot0002' as here but 'Cannot delete EFI variable Boot0001'.

What I did to workaround:

When LiveUSB is loaded, before starting the Ubuntu installer, open a terminal window and run:
sudo efibootmgr

It shows Boot0000 and Boot0001 related to the hard drive entries.

As the Ubuntu installer is going to remove Boot0001 (and Boot0000 I suppose), I decided to remove it manually:
sudo efibootmgr -B -b 0001
sudo efibootmgr -B -b 0000

Note that the first time I called efibootmgr -B -b 0001, it fails with "Invalid argument" error (I don't know why). It succeeded after a retry though.

Launch Ubuntu installer after the manipulations above, and it will be finished successfully. At least for me, it helped.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.