Gary's picture

Hello,

Since the beginning of the month, every day, we've been receiving the following error, emailed to us from Turnkey Core.  Is this a symptom of Turnkey Core being run as a VMWare virtual machine?  What would be the best way to fix this so that grub-pc can finish configuring itself?


CRON-APT RUN [/etc/cron-apt/config]: Wed Mar 10 00:10:01 UTC 2021
CRON-APT SLEEP: 1143, Wed Mar 10 00:29:04 UTC 2021
CRON-APT ACTION: 5-install
CRON-APT LINE: /usr/bin/apt-get -o quiet=1 dist-upgrade -q -y -o APT::Get::Show-Upgraded=true -o Dir::Etc::sourcelist=/etc/apt/sources.list.d/security.sources.list -o Dir::Etc::sourceparts=nonexistent -o DPkg::Options::=--force-confdef -o DPkg::Options::=--force-confold
Setting up grub-pc (2.02+dfsg1-20+deb10u4) ...
You must correct your GRUB install devices before proceeding:

  DEBIAN_FRONTEND=dialog dpkg --configure grub-pc
  dpkg --configure -a
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)

Forum: 
Jeremy Davis's picture

First up, thanks so much for reporting this. It appears that there is an issue with the auto security updates!

In order to understand the extent of the issue, could you please share where this server is running? FYI I have managed to reproduce on Hub (AWS) servers, but not on LXC or ISO install (I haven't yet tested VM builds).

TBH, I'm not completely sure why that's occurring, but where this issue occurs, it appears that the grub-pc update requires interaction (it is asking where to (re)install grub). I'm not sure, but it seems possible that we should probably be tweaking the grub settings for any affected builds when we produce the images.

In the meantime, the issue is pretty easy to resolve, just interactively re-run the secupdates; like this:

turnkey-install-security-updates

When it asks for where to install grub, I suggest selecting all available options. That is unlikely to be necessary if you know what you are doing, so feel free to not do that if you know where you need to install it. But installing it in multiple places only takes up a few kb of disk space and ensures that it will definitely be where the system expects it to be.

If you want/need more info about how to do that, I've included further details on the bug I just opened...

That should fix the issue and stop the noise and ensure future security updates auto install.

Gary's picture

Hello,

Many, many thanks for the explanation and for letting me know what we need to do.

We installed the .ova file with VMWare, and with ESXi Host v. 6.7

We're not quite out of the proverbial woods just yet; I executed "turnkey-install-security-updates", and the following was outputed:


root@tomcat-apache ~# turnkey-install-security-updates
+ SEC_UPDATES=FORCE                                                                                                                                                                                                
+ /usr/lib/inithooks/firstboot.d/95secupdates                                                                                                                                                                      
Hit:1 http://deb.debian.org/debian buster InRelease                                                                                                                                                                
Get:2 http://security.debian.org buster/updates InRelease [65.4 kB]                                                                                                                                                
Ign:3 http://archive.turnkeylinux.org/debian buster-security InRelease                                                                                                                                             
Ign:4 http://archive.turnkeylinux.org/debian buster InRelease                                                                                                                                                      
Hit:5 http://archive.turnkeylinux.org/debian buster-security Release                                                                                                                                               
Hit:6 http://archive.turnkeylinux.org/debian buster Release                                                                                                                                                        
Fetched 65.4 kB in 1s (127 kB/s)                                                                                                                                                                                   
Reading package lists...                                                                                                                                                                                           
Reading package lists...                                                                                                                                                                                           
Building dependency tree...                                                                                                                                                                                        
Reading state information...                                                                                                                                                                                       
Reading package lists...                                                                                                                                                                                           
Building dependency tree...                                                                                                                                                                                        
Reading state information...                                                                                                                                                                                       
Calculating upgrade...                                                                                                                                                                                             
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.                                                                                                                                                     
1 not fully installed or removed.                                                                                                                                                                                  
After this operation, 0 B of additional disk space will be used.                                                                                                                                                   
Setting up grub-pc (2.02+dfsg1-20+deb10u4) ...                                                                                                                                                                     
You must correct your GRUB install devices before proceeding:                                                                                                                                                      
                                                                                                                                                                                                                   
  DEBIAN_FRONTEND=dialog dpkg --configure grub-pc                                                                                                                                                                  
  dpkg --configure -a                                                                                                                                                                                              
dpkg: error processing package grub-pc (--configure):                                                                                                                                                              
 installed grub-pc package post-installation script subprocess returned error exit status 1                                                                                                                        
Errors were encountered while processing:                                                                                                                                                                          
 grub-pc                                                                                                                                                                                                           
Enumerating objects: 1932, done.                                                                                                                                                                                   
Counting objects: 100% (1932/1932), done.                                                                                                                                                                          
Compressing objects: 100% (1194/1194), done.                                                                                                                                                                       
Writing objects: 100% (1932/1932), done.                                                                                                                                                                           
Total 1932 (delta 231), reused 1932 (delta 231)                                                                                                                                                                    
E: Sub-process /usr/bin/dpkg returned an error code (1)                                                                                                                                                            
root@tomcat-apache ~#  

Jeremy Davis's picture

I'm sure that it allowed me to do it interactively when I tested?! But perhaps there is something else I did first which I didn't note. I should manually retest it all myself so I am 100%. Once I've done that, I'll do a blog post and send out a newsletter notification.

Anyway, explicitly installing the grub-pc update will definitely work!

apt install grub-pc

The previous explanation of what to do during the install still applies.

For what it's worth, an alternate route would be to reconfigure grub-pc:

dpkg-reconfigure grub-pc
Gary's picture

Hello,

We tried "apt-get install grub-pc", and, interactively, we were offered the following three choices for where to install GRUB:

	/dev/sda1 (19937 MB; LVM PV AIgoaB-jwvI-JEkh-fRzH-YLob-vBhz-sHOtaB on /dev/sda1)
	/dev/sda (21474 MB; Virtual_disk)
	/dev/dm-0 (18253 MB; turnkey-root)

We selected all three, and the following question was asked, and we answered "Yes":

GRUB failed to install to the following devices:
	/dev/sda1 /dev/dm-0
Do you want to continue anyway? If you do, your computer may not start up properly.
	Writing GRUB to boot device failed - continue?

And then, lo and behold, we were able to reboot properly, and apt-get no longer indicates that there are any packages that have not yet been configured.  Thanks again!

My apologies, I have to make one correction to my first post on this topic: we are using the Tomcat Apache appliance, not the Core appliance.

FYI, a complete list of everything we saw on the screen is below.  Thanks again!

root@tomcat-apache ~# apt-get install grub-pc
Reading package lists... Done
Building dependency tree
Reading state information... Done
grub-pc is already the newest version (2.02+dfsg1-20+deb10u4).
grub-pc set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up grub-pc (2.02+dfsg1-20+deb10u4) ...
Installing for i386-pc platform.
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15262: grub-install
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15262: grub-install
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15262: grub-install
grub-install: error: unable to identify a filesystem in hostdisk//dev/sda; safety check can't be
    performed.
Installing for i386-pc platform.
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15280: grub-install
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15280: grub-install
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15280: grub-install
Installation finished. No error reported.
Installing for i386-pc platform.
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15298: grub-install
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15298: grub-install
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15298: grub-install
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15298: grub-install
File descriptor 3 (pipe:[17709860]) leaked on vgs invocation. Parent PID 15298: grub-install
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by
    using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged.
grub-install: error: diskfilter writes are not supported.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.19.0-14-amd64
Found initrd image: /boot/initrd.img-4.19.0-14-amd64
Found linux image: /boot/vmlinuz-4.19.0-12-amd64
Found initrd image: /boot/initrd.img-4.19.0-12-amd64
Found linux image: /boot/vmlinuz-4.19.0-9-amd64
Found initrd image: /boot/initrd.img-4.19.0-9-amd64
done
Enumerating objects: 1932, done.
Counting objects: 100% (1932/1932), done.
Compressing objects: 100% (1194/1194), done.
Writing objects: 100% (1932/1932), done.
Total 1932 (delta 231), reused 1932 (delta 231)
Jeremy Davis's picture

Thanks for confirming that worked! :)

Also as a complete aside, for future reference, there is nothing wrong with using 'apt-get', but as of Debian Stretch (the basis of the previous TurnKey major release - v15.x) you can just use 'apt'.

It's takes most of the arguments of 'apt-get' (e.g. 'apt update', 'apt install', 'apt remove', etc), plus many of arguments of 'apt-cache' too (e.g. 'apt policy', 'apt show', etc). But it provides a more user-friendly interactive UI (e.g. a progress bar along the bottom of the screen). You can read more about that on the apt(8) man page (or via commandline: 'man apt').

For programmatic purposes though, you should still use 'apt-get' (as noted by apt if you use it in a script-like way). E.g.

# apt update | tee
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Hit:1 https://deb.debian.org/debian buster InRelease
Hit:2 https://security.debian.org buster/updates InRelease
Ign:3 http://archive.turnkeylinux.org/debian buster-security InRelease
Ign:4 http://archive.turnkeylinux.org/debian buster InRelease
Hit:5 http://archive.turnkeylinux.org/debian buster-security Release
Hit:7 http://archive.turnkeylinux.org/debian buster Release
Reading package lists...
Building dependency tree...
Reading state information...
All packages are up to date.
Jeremy Davis's picture

It's irrelevant for you now, but just wanted to let you know, that after your feedback and a fair bit more exploration and testing, I have published a blog post detailing this issue and the fix.

Thanks again for reporting the issue.

Gary's picture

And thank you, as well, for all your help!

Add new comment