update loop, update fails

General support for the Pi-Star System
pa3kc
Posts: 5
Joined: Thu Aug 16, 2018 2:04 pm

update loop, update fails

Post by pa3kc »

I run into an update loop with the latest Pi-Star_RPi_V4.1.4_09-Jun-2021.

Clean install.

After first login I run:

Code: Select all

pi-star@pi-star(rw):~$ sudo /usr/local/sbin/pistar-update
Updating OS...

Hit:1 http://httpredir.debian.org/debian buster-backports InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Done
Checking nginx config
Stopping Services...
Done
Updating DV Binaries...
No updates for /usr/local/bin available
Done
Updating Pi-Star Binaries...
Updating /usr/local/sbin...
fatal: not a git repository (or any of the parent directories): .git
Found a new version of pistar-update...
From https://github.com/AndyTaylorTweet/Pi-Star_Binaries_sbin
 * branch            master     -> FETCH_HEAD
Updating db3daba..9e36263
error: Your local changes to the following files would be overwritten by merge:
        pistar-upnp.service
Please commit your changes or stash them before you merge.
Aborting
Update to new version of pistar-update was not successfull, forcing update...
error: Entry 'pistar-upnp.service' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'origin/master'.
Restarting update process with the new version...
Updating OS...

Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Hit:3 http://httpredir.debian.org/debian buster-backports InRelease
^Cading package lists... 0%
I stop it there with CTRL-C it keeps doing this over and over.

It seems to fail on the git updates.


// EDIT:
Just checked with Pi-Star_RPi_V4.1.4_08-Feb-2021 clean install and updates/upgrades go without problems.
CT2HRB
Posts: 19
Joined: Thu Apr 26, 2018 8:15 pm

Re: update loop, update fails

Post by CT2HRB »

@pa3kc: just to confirm, you did see "Restarting update process with the new version..." (along with other lines) again, and again, and again... right? (non-stop, on a single run of the update script) Seeing it restart update once is normal as KE7FNS said, forever it's not normal.

@MW0MWZ: this may be related to what I pointed to you on github, that could eventually happen (comments):
https://github.com/AndyTaylorTweet/Pi-S ... 0119dd321e
pa3kc
Posts: 5
Joined: Thu Aug 16, 2018 2:04 pm

Re: update loop, update fails

Post by pa3kc »

KE7FNS wrote: Sun Jun 20, 2021 11:07 pm
I suggest reimaging the SD card with the latest image and restoring your configuration.
I did re-imaged the SD card twice but got the same results.

With the February version Pi-Star_RPi_V4.1.4_08-Feb-2021 I had not problems and all is working with updating/upgrading.

For me this isn't a issue any more.

It's nice to see the Pi-star project is still there after these years.
A big thanks to all devs and volunteers for creating and maintaining the project!

73
User avatar
MW0MWZ
Site Admin
Posts: 1505
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: update loop, update fails

Post by MW0MWZ »

I was quite sure (initially) that this was not my error... but it appears a slice of humble pie is waiting for me... d'oh.
Working on a fix for this issue at the moment, more news on that very soon.
Andy

73 de MW0MWZ
http://pistar.uk
CT2HRB
Posts: 19
Joined: Thu Apr 26, 2018 8:15 pm

Re: update loop, update fails

Post by CT2HRB »

I told you it could happen, you didn't believe me :P

The issue is triggered specifically when user tries to fetch an update that includes both updated pistar-update and pistar-upnp.service files at same time. Users who updated progressively will not experience the problem as they likely updated each file at a time on different days, users that didn't update for some days (or maybe with fresh image) may get the problem as they will likely fetch both files at same time.
User avatar
MW0MWZ
Site Admin
Posts: 1505
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: update loop, update fails

Post by MW0MWZ »

The exciting problem here is that this is fixable, but only with manual intervention currently - because while I have fixed the update script, you wont get it if you are already looping....

the following action on the CLI will cure it;

Code: Select all

pi-star@pi-star(ro):~$ rpi-rw
pi-star@pi-star(rw):~$ sudo pkill pistar-update
pi-star@pi-star(rw):~$ sudo rm -rf /usr/local/sbin/pistar-upnp.service
pi-star@pi-star(rw):~$
From here you can either run the update from the cli or the dashboard and it will fix itself.
I'm building a pre-fixed version of the image that will be uploaded shortly.
Andy

73 de MW0MWZ
http://pistar.uk
User avatar
MW0MWZ
Site Admin
Posts: 1505
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: update loop, update fails

Post by MW0MWZ »

CT2HRB wrote: Mon Jun 21, 2021 5:56 pm I told you it could happen, you didn't believe me :P

The issue is triggered specifically when user tries to fetch an update that includes both updated pistar-update and pistar-upnp.service files at same time. Users who updated progressively will not experience the problem as they likely updated each file at a time on different days, users that didn't update for some days (or maybe with fresh image) may get the problem as they will likely fetch both files at same time.
Well I believe you now alright - I'm concerned this could re-surface later too, thinking about how I may deal with any other edge case currently...
Andy

73 de MW0MWZ
http://pistar.uk
CT2HRB
Posts: 19
Joined: Thu Apr 26, 2018 8:15 pm

Re: update loop, update fails

Post by CT2HRB »

From some quick tests I made, I think the "update-index --assume-unchanged" is actually just making things worst, if you didn't do it then the "reset --hard" would actually work without the rm. The "assume-unchanged" never really allowed the file to be updated and actually prevents "reset --hard" to work :(

You could eventually revert changes on pistar-upnp.service temporarily for some days to allow users to get fixed pistar-update and then bring it back after a few days? maybe...
User avatar
MW0MWZ
Site Admin
Posts: 1505
Joined: Wed Apr 04, 2018 9:15 pm
Location: Wales, UK
Contact:

Re: update loop, update fails

Post by MW0MWZ »

CT2HRB wrote: Mon Jun 21, 2021 6:30 pm You could eventually revert changes on pistar-upnp.service temporarily for some days to allow users to get fixed pistar-update and then bring it back after a few days? maybe...
I'm not sure that I can, its changed a lot over the last few days, so what point do I pick...
The assume-unchanged is supposed to let you keep local changes to the pistar-upnp.service - that was sane enough, removing the file and running the reset does cure it - so that's the fall-back position for it.

I've removed the latest download of 4.1.4, since updating from that causes a loop - a pre-fixed 4.1.5 will be live shortly - plus I already patched the update process to take care of things, the only down side is that if you get to the point where its looped - you are stuck there until you manually fix it - an that's bad :(
Andy

73 de MW0MWZ
http://pistar.uk
CT2HRB
Posts: 19
Joined: Thu Apr 26, 2018 8:15 pm

Re: update loop, update fails

Post by CT2HRB »

See what you think of the PR I did submit on Bin repo, to try to fix this automagically.
Post Reply