apt update fails - 'std::runtime_error' what(): random_device::__x86_rdrand(void)

Bug #1784796 reported by David Haggett
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I am seeing the following error randomly on issuing sudo apt update:

 Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [65.4 kB]
 0% [1 InRelease gpgv 69.9 kB] [3 InRelease 7,779 B/65.4 kB 12%]terminate called after throwing an instance of 'std::runtime_error'
   what(): random_device::__x86_rdrand(void)
 Aborted

Once this occurs, it normally takes at least one, but frequently more than one reboot to resolve. It only happens on one of my systems - a self-build server based on Asrock Rack motherboard C3758D4I-4L running Ubuntu server.

I've observed the same issue on the same hardware with the Ubuntu 18.04.1 live ISO. I'm booting in Legacy mode.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: apt 1.6.3
ProcVersionSignature: Ubuntu 4.15.0-29.31-generic 4.15.18
Uname: Linux 4.15.0-29-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
Date: Wed Aug 1 08:37:28 2018
InstallationDate: Installed on 2018-04-28 (94 days ago)
InstallationMedia: Ubuntu-Server 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
David Haggett (m-dw) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

This should be a problem with not enough entropy that should have been fixed in recent kernel versions. APT 1.7 will have a fix for that, it's not backported to 1.6 yet, but it should be easily doable.

I'd say: make sure you are running the latest kernel and that you don't start apt shortly after boot.

Revision history for this message
David Haggett (m-dw) wrote :

Ah! Awesome, thanks. So the fact that I run apt immediately after rebooting to check if I've cleared the problem, is what is causing the problem. That figures.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Fixed in 1.7.0~alpha2

Changed in apt (Ubuntu):
status: New → Fix Released
Revision history for this message
David Haggett (m-dw) wrote :

OK, this appears to have been fixed in a kernel update, but then broken again, and the error is no longer intermittent - I cannot apt update, which means I can't apt upgrade to a fixed version.

Do you have any suggestions?

Revision history for this message
Hanno Böck (hanno-hboeck) wrote :

Hi, can someone with the permission please re-open?
I'm seeing this on a relatively recent system (18.04, updates have been successfully done lately), so it's definitely not fixed since august last year.

Revision history for this message
Julian Andres Klode (juliank) wrote :

This has been fixed in 18.10, not 18.04 - the breaking kernel change was reverted in 18.04, so we decided we don't need to backport it.

This is a system wide issue if the kernel runs out of entropy and by no means an apt one. I suggest you report a kernel bug if you still see issues like this on the recent kernel

Revision history for this message
Hanno Böck (hanno-hboeck) wrote :

Any recommendation how to update if you can't update due to this bug?

"apt update" will always fail, so no matter if it's a kernel or apt update I need, I won't get it.

Revision history for this message
Julian Andres Klode (juliank) wrote :

This should really only be an issue early during boot, or if you require a lot of randomness. So I guess wait, use your keyboard a lot, generate a lot of network traffic? Or manually inject randomness? I don't really know, and it's out of scope for the bug report to discuss this - you might want to ask in one of the user support channels (forums, irc, mailing lists).

Revision history for this message
David Haggett (m-dw) wrote :

In my case, it was happening on a headless server so lots of keyboard access isn't an option. I actually fixed it on my system by reversing a change to a BIOS setting which I had initially changed to work around the same issue on a previous occurrence.

The setting on my system related to the execute disable bit.

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.