sdetweil / MagicMirror_scripts

Magic Mirror installation and setup scripts
368 stars 64 forks source link

apt-get upgrade hang #99

Open uphillcheddar opened 2 days ago

uphillcheddar commented 2 days ago

i ran this script on a fresh install of raspberry pi os. and it seems to hang shortly after running.

looking at the script and the resulting log it would seem that apt-get upgrade is called before the real "setup" starts. This action triggers an attempt to upgrade labwc ( recently added to rasberry os as of 10-28-24 ) before upgrading the module, a prompt is surfaced to the user regarding a new configuration and asks if they wish to use it or not (default is no). This prompt either fails to respect the assume yes flag, or because the default is no, ignores it (dont know which).

The end result is that the script never completes and if you look at the install.log, the final entry will be the prompt.

this hypothetically would only impact fresh images that have not been apt upgraded yet. in fact as a work around i just ctrl-c'd the script and ran apt upgrade manually and then after it completed ran the script again (which now no longer raises the prompt). its also possible that the prompt times out eventually and i was just too impatient, but i waited at the prompt from my manual apt upgrade for about 5min with it not proceeding so i dont think there is a time out.

prompt in questions

Configuration file '/etc/xdg/labwc/environment'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** environment (Y/I/N/O/D/Z) [default=N] ?
sdetweil commented 2 days ago

awesome info, thanks will review

what did you do on the os before running my script? if anything.

uphillcheddar commented 2 days ago

steps:

  1. use raspberry pi imager
  2. use imager to enable ssh and set user
  3. image sd card with 64bit raspberry pi os for pi 4
  4. insert and boot
  5. be lazy and run script immediately knowing it apt updates and apt upgrades.
  6. =(

i updated the title as i was initially going to mentioned that according to the google machine that apt upgrade (instead of apt-get upgrade) suppresses similar prompts from other modules , but after re-imaging the same pi and running apt upgrade before the script i was also presented the prompt. so i think for this specific prompt/module that is not the case

sdetweil commented 2 days ago

thanks for the clarity .

i redirect the output to a file so that is why you didnt see the prompt

sdetweil commented 1 day ago

so, there is a way to handle this error, by me changing the parms to apt-get upgrade

apt-get -o Dpkg::Options::='--force-confold' --force-yes -fuy dist-upgrade
To clarify Dpkg::Options::='--force-confold' from the man-page:

--force-confold: do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix. With this option alone, even configuration files that you have not modified are left untouched. You need to combine it with --force-confdef to let dpkg overwrite configuration files that you have not modified.

BUT you may STILL miss a required config file update.. altho the new file is also saved..

apt-get -o Dpkg::Options::='--force-confold --force-confdef' --force-yes -fuy upgrade

what do you think about this..

if you didn't change the affected config file, it will be upgraded.. if you DID change it, it will NOT be upgraded..

   which COULD cause your system to not restart properly, depending on the affected config file..   

the info MAY be in the log.. I haven't been able to reproduce this yet

uphillcheddar commented 1 day ago

I'm a little unclear on the "changes" that happen to the file that trigger this prompt. As I said from my perspective this is a fresh install with only three things turned on in the imager see here for info about advanced imager options

  1. SSH
  2. User defined so I can ssh
  3. Wifi creds

At first glance these shouldn't do anything related to window management by labwc. The only one that might, is disable oversscan but I do not recall enabling this option (can verify this evening after work)

My only guess is that the image generated by the imager is using a modified file and the real fix is updating that image

I found a raspberry pi forum post talking about this and it implies it's a known issue? link

That said until the image is updated to not trigger this prompt I agree with your approach, update if possible if not skip

sdetweil commented 1 day ago

yeh, SO much fun...