Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Update | Update to v6.20.5 fails #2458

Closed
maartenlangeveld opened this issue Jan 28, 2019 · 11 comments
Closed

DietPi-Update | Update to v6.20.5 fails #2458

maartenlangeveld opened this issue Jan 28, 2019 · 11 comments
Labels
Solution available 🥂 Definite solution has been done
Milestone

Comments

@maartenlangeveld
Copy link

Details:

  • Date | Mon 28 Jan 23:16:07 CET 2019
  • Bug report | N/A
  • DietPi version | v6.19.7 (Fourdee/master)
  • Img creator | DietPi Core Team
  • Pre-image | FriendlyARM
  • SBC device | NanoPi NEO 2 (aarch64) (index=65)
  • Kernel version | v94 #82 SMP Fri Dec 8 14:33:14 CST 2017
  • Distro | stretch (index=4)
  • Command | chmod -R +x /DietPi /var/lib/dietpi/services /etc/cron.daily/dietpi /etc/cron.hourly/dietpi /etc/profile.d/dietpi-*.sh /etc/bashrc.d/dietpi-bash_completion.sh /etc/bashrc.d/dietpi-login.sh /etc/bashrc.d/dietpi-posix-set-locale.sh /etc/bashrc.d/dietpi-ps1_kill_animation.sh /etc/bashrc.d/dietpi-unsupported_terminal.sh
  • Exit code | 1
  • Software title | DietPi-Update

Steps to reproduce:

  1. dietpi-update

Expected behaviour:

  • update to v6.20.5

Actual behaviour:

Extra details:

  • ...

Additional logs:

Log file contents:
chmod: cannot access '/etc/profile.d/dietpi-*.sh': No such file or directory
@Gravesy83
Copy link

I just got pretty much the same error, but on a Raspberry Pi 2 :

Details:

  • Date | Mon 28 Jan 23:37:55 CET 2019
  • Bug report | N/A
  • DietPi version | v6.19.7 (Fourdee/master)
  • Img creator | n/a
  • Pre-image | n/a
  • SBC device | RPi 2 Model B (armv7l) (index=2)
  • Kernel version | Letsencrypt supports Free Noip.com Dynamic DNS #1159 SMP Sun Nov 4 17:50:20 GMT 2018
  • Distro | stretch (index=4)
  • Command | chmod -R +x /DietPi /var/lib/dietpi/services /etc/cron.daily/dietpi /etc/cron.hourly/dietpi /etc/profile.d/dietpi-*.sh /etc/bashrc.d/dietpi-bash_completion.sh /etc/bashrc.d/dietpi-login.sh /etc/bashrc.d/dietpi-posix-set-locale.sh /etc/bashrc.d/dietpi-ps1_kill_animation.sh /etc/bashrc.d/dietpi-unsupported_terminal.sh
  • Exit code | 1
  • Software title | DietPi-Update

Steps to reproduce:

  1. run dietpi-update
  2. ...

Expected behaviour:

  • ... update to next version

Actual behaviour:

  • ... update fails

Extra details:

  • ...

Additional logs:

Log file contents:
chmod: cannot access '/etc/profile.d/dietpi-*.sh': No such file or directory

@MichaIng
Copy link
Owner

@maartenlangeveld @Gravesy83
Thanks for reporting.

Hmm from which initial version did you update?

pre-v6.20 images should actually have /etc/profile.d/dietpi-unsupported_terminal.sh which fits the pattern. This is removed (moved to /etc/**bashrc.d**/dietpi-unsupported_terminal.sh) with patch v6.20, but after the chown command.

Did you manually removed /etc/profile.d/dietpi-unsupported_terminal.sh?

However, to fix, please place a fake script to match the pattern, at best exactly the expected one, so it will be removed on patch automatically:
> /etc/profile.d/dietpi-unsupported_terminal.sh

@maartenlangeveld
Copy link
Author

maartenlangeveld commented Jan 28, 2019

I installed DietPi on my NanoPi NEO2 (headless) using DietPi_v6.14_NanoPiNEO2-ARMv8-Stretch.img (downloaded) then updated to v6.19.7. This night after a reboot I did an upgrade to v6.20.5 using dietpi-update command.

@maartenlangeveld
Copy link
Author

maartenlangeveld commented Jan 28, 2019 via email

@maartenlangeveld
Copy link
Author

maartenlangeveld commented Jan 28, 2019 via email

@MichaIng
Copy link
Owner

MichaIng commented Jan 28, 2019

Strange, cant fine the issue currently:

Can't see the reason for your errors currently, especially since I successfully updated my own RPi just yesterday to nearly identical Beta and lots of virtual machines during development time.
However please apply the mentioned fix by creating the fake file.

@Fourdee
Do you have any clue? Perhaps an async issue?
We could remove error handling from chmod or find something similar to rm -f option to ignore missing files, but actually it is good to know, if those files are either missing or write access/chmod fails, since this is indeed an important error otherwise. In this case somehow just the earlier update script somehow attempts to chmod a file that either was never created as expected or removed earlier than expected, or, the wrong script version was run. But I have no idea currently how any of those could have happened, besides due to async, the new code was not yet fully synced to disk.

Perhaps we should place another sync after code has been placed and before incremental patching. Although if this really was an issue, we should have faced much more error reports like this 🤔. And I can't believe that async really works bad as this, overwriting a bunch of files and not having the new files when reading back...

@MichaIng
Copy link
Owner

MichaIng commented Jan 28, 2019

@maartenlangeveld
It can take a while due to reinstalls, depending on which additional software titles you have installed.
But it should print something to the terminal, prefixed with DietPi-Patchfile.
You can check which script it is currently running via second SSH session (or second terminal) running: htop


Report on forum: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5469

  • Seems to occur device-independently, but according to update counts (and our own tests) not in every case.

Following survey page v6.20 counts to guess how many users are affected: https://dietpi.com/survey/

23:20:19 UTC DietPi v6.20 108
23:35:25 UTC DietPi v6.20 107
23:51:01 UTC DietPi v6.20 110
00:06:14 UTC DietPi v6.20 113
00:20:17 UTC DietPi v6.20 118
00:35:50 UTC DietPi v6.20 119
01:50:32 UTC DietPi v6.20 136
02:20:58 UTC DietPi v6.20 138
02:35:20 UTC DietPi v6.20 141
12:06:05 UTC DietPi v6.20 236

@MichaIng
Copy link
Owner

MichaIng commented Jan 29, 2019

I will now recover the file as empty on update branch to prevent the issue. We can then remove it with v6.21 where the new update script is in place/synced definitely.

EDIT: Okay merged: Fourdee@0cc30eb

  • Whatever causes this issue, the above commit should resolve it + includes some fail safe sync just in case it is due to disk async, which could otherwise imply other issues as well.
  • The fake file is empty, thus has no effect and will be removed during last incremental patch stage. So the final update result is not affected at all.
  • We just need to remember to remove it again for v6.21 release. I will leave it in place now, until everything else is verified to work well and we do the first new dev commits.

@MichaIng MichaIng reopened this Jan 29, 2019
@MichaIng MichaIng added this to the v6.20 milestone Jan 29, 2019
@MichaIng MichaIng changed the title Update to v6.20.5 failed DietPi-Update | Update to v6.20.5 fails Jan 29, 2019
@MichaIng
Copy link
Owner

@maartenlangeveld @Gravesy83
Okay this has been solved. Thanks again for reporting. Feel free to reopen the issue, if required.

@MichaIng
Copy link
Owner

Okay, issue is related to: https://github.com/Fourdee/DietPi/issues/2466

  • DietPi-RAMdisk stops too late, after /boot being already unmounted.
  • So new code is not saved to disk.
  • On reboot, old code from disk is loaded, where update still expects the removed file.

Only question: Why actually reboot is done DURING update? Should only be the case on first run updates. However we leave the fake file in place AND revert the RAMdisk+RAMlog changes to assure both are stopped before local-fs.target and as failsafe DietPi.mount var-log.mount/boot.mount and -.mount (root).

@MichaIng
Copy link
Owner

Hotfix via v6.20.6 merged. Should resolved all related issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

3 participants