update-engine.service restart does not reset the variable CURRENT_OP #1625

Closed
honeyankit opened this Issue Oct 20, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@honeyankit

honeyankit commented Oct 20, 2016

Issue Report

Bug

CoreOS Version

835.13.0

$ cat /etc/os-release
NAME=CoreOS
ID=coreos
VERSION=835.13.0
VERSION_ID=835.13.0
BUILD_ID=
PRETTY_NAME="CoreOS 835.13.0"
ANSI_COLOR="1;32"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"

Environment

What hardware/cloud provider/hypervisor is being used to run CoreOS?
VirtualBox (Version 5.1.2 r108956)

Expected Behavior

After CoreOS upgrade, restart of update-engine.service updates the boot flags even when
CURRENT_OP=UPDATE_STATUS_UPDATED_NEED_REBOOT

Actual Behavior

After CoreOS upgrade and immediately restarting update-engine.service, the update-engine.service check if CURRENT_OP is UPDATE_STATUS_UPDATED_NEED_REBOOT then
it should not update the boot flags.

Reproduction Steps


montana@node-001e67e310ba ~ $ sudo update_engine_client –update

[1022/081942:INFO:update_engine_client.cc(243)] Initiating update check and install.
[1022/081942:INFO:update_engine_client.cc(248)] Waiting for update to complete.
LAST_CHECKED_TIME=1477124382
PROGRESS=0.000000
CURRENT_OP=UPDATE_STATUS_UPDATE_AVAILABLE
NEW_VERSION=0.0.0.0
NEW_SIZE=216935744
LAST_CHECKED_TIME=1477124382
PROGRESS=0.110558
CURRENT_OP=UPDATE_STATUS_DOWNLOADING
NEW_VERSION=0.0.0.0
NEW_SIZE=216935744
LAST_CHECKED_TIME=1477124382
PROGRESS=0.271275
CURRENT_OP=UPDATE_STATUS_DOWNLOADING
NEW_VERSION=0.0.0.0
NEW_SIZE=216935744
LAST_CHECKED_TIME=1477124382
PROGRESS=0.582663
CURRENT_OP=UPDATE_STATUS_DOWNLOADING
NEW_VERSION=0.0.0.0
NEW_SIZE=216935744
LAST_CHECKED_TIME=1477124382
PROGRESS=0.743379
CURRENT_OP=UPDATE_STATUS_DOWNLOADING
NEW_VERSION=0.0.0.0
NEW_SIZE=216935744
LAST_CHECKED_TIME=1477124382
PROGRESS=0.000000
CURRENT_OP=UPDATE_STATUS_FINALIZING
NEW_VERSION=0.0.0.0
NEW_SIZE=216935744
LAST_CHECKED_TIME=1477124382
PROGRESS=0.000000
CURRENT_OP=UPDATE_STATUS_FINALIZING
NEW_VERSION=0.0.0.0
NEW_SIZE=216935744
LAST_CHECKED_TIME=1477124382
PROGRESS=0.000000
CURRENT_OP=UPDATE_STATUS_UPDATED_NEED_REBOOT
NEW_VERSION=0.0.0.0
NEW_SIZE=216935744
[1022/082022:INFO:update_engine_client.cc(193)] Update succeeded -- reboot needed.


montana@node-001e67e310ba ~ $ sudo cgpt show /dev/sda

   start        size    part  contents
       0           1          Hybrid MBR
       1           1          Pri GPT header
       2          32          Pri GPT table
    4096      262144       1  Label: "EFI-SYSTEM"
                              Type: EFI System Partition
                              UUID: FC3BD0BF-DA8D-4416-8B63-B173BCF33DF7
                              Attr: Legacy BIOS Bootable
  266240        4096       2  Label: "BIOS-BOOT"
                              Type: BIOS Boot Partition
                              UUID: F381EB7A-15B3-4744-9A68-2EECD2B6B893
  270336     2097152       3  Label: "USR-A"
                              Type: Alias for coreos-rootfs
                              UUID: 7130C94A-213A-4E5A-8E26-6CCE9662F132
                              **Attr: priority=1 tries=0 successful=1**
 2367488     2097152       4  Label: "USR-B"
                              Type: Alias for coreos-rootfs
                              UUID: E03DD35C-7C2D-4A47-B3FE-27F15780A57C
                              **Attr: priority=2 tries=1 successful=0**
 4464640      262144       6  Label: "OEM"
                              Type: Alias for linux-data
                              UUID: 28AAC862-F988-47E2-AE68-F458F3B4A5EA
 4726784      131072       7  Label: "OEM-CONFIG"
                              Type: CoreOS reserved
                              UUID: 81246349-2C58-4934-8E5B-B2BF74739F47
 4857856   995357327       9  Label: "ROOT"
                              Type: CoreOS auto-resize
                              UUID: 5CC492CE-4752-419A-8097-0899DA04968C

1000215183 32 Sec GPT table
1000215215 1 Sec GPT header

At this point, priority for /dev/sda4 is changed to 2 and tries to 1 which is correct.


montana@node-001e67e310ba ~ $ sudo update_engine_client -status
[1022/082101:INFO:update_engine_client.cc(233)] Querying Update Engine status...
LAST_CHECKED_TIME=1477124382
PROGRESS=0.000000
CURRENT_OP=UPDATE_STATUS_UPDATED_NEED_REBOOT
NEW_VERSION=0.0.0.0
NEW_SIZE=216935744


montana@node-001e67e310ba ~ $ sudo systemctl restart update-engine

montana@node-001e67e310ba ~ $ sudo update_engine_client -status
[1022/082152:INFO:update_engine_client.cc(233)] Querying Update Engine status...
LAST_CHECKED_TIME=0
PROGRESS=0.000000
CURRENT_OP=UPDATE_STATUS_UPDATED_NEED_REBOOT
NEW_VERSION=0.0.0.0
NEW_SIZE=0


After restarting update-engine.service, please open the journalctl logs and wait for updating boot flag, it will takes 45 sec to show this message

montana@node-001e67e310ba ~ $ sudo journalctl -fu update-engine
-- Logs begin at Thu 2016-09-22 21:05:39 UTC. --
Oct 22 08:21:47 node-001e67e310ba update_engine[42728]: Payload Sha256 Hash = XCGNksRdOPKRTwwgoluSEdf5LdfUGXqAFYVQmv0JvH4=
Oct 22 08:21:47 node-001e67e310ba update_engine[42728]: Is Delta Payload = 0
Oct 22 08:21:47 node-001e67e310ba update_engine[42728]: Max Failure Count Per Url = 10
Oct 22 08:21:47 node-001e67e310ba update_engine[42728]: Disable Payload Backoff = 1
Oct 22 08:21:47 node-001e67e310ba update_engine[42728]: [1022/082147:INFO:payload_state.cc(377)] Payload Attempt Number = 2
Oct 22 08:21:47 node-001e67e310ba update_engine[42728]: [1022/082147:INFO:payload_state.cc(400)] Current URL Index = 0
Oct 22 08:21:47 node-001e67e310ba update_engine[42728]: [1022/082147:INFO:payload_state.cc(421)] Current URL (Url0)'s Failure Count = 0
Oct 22 08:21:47 node-001e67e310ba update_engine[42728]: [1022/082147:INFO:payload_state.cc(448)] Backoff Expiry Time = 1/1/1601 0:00:00 GMT
Oct 22 08:21:47 node-001e67e310ba systemd[1]: Started Update Engine.
Oct 22 08:21:47 node-001e67e310ba update_engine[42728]: [1022/082147:INFO:update_check_scheduler.cc(82)] Next update check in 7m8s
Oct 22 08:22:32 node-001e67e310ba update_engine[42728]: [1022/082232:INFO:update_attempter.cc(485)] Updating boot flags…


Now the priority of /dev/sda4 is changed back to 1 and /dev/sda3 to 2 so even after reboot the node will not boot with /dev/sda4 and this is the problem, the update-engine service has reset the priority after updating the boot flags

montana@node-001e67e310ba ~ $ sudo cgpt show /dev/sda
start size part contents
0 1 Hybrid MBR
1 1 Pri GPT header
2 32 Pri GPT table
4096 262144 1 Label: "EFI-SYSTEM"
Type: EFI System Partition
UUID: FC3BD0BF-DA8D-4416-8B63-B173BCF33DF7
Attr: Legacy BIOS Bootable
266240 4096 2 Label: "BIOS-BOOT"
Type: BIOS Boot Partition
UUID: F381EB7A-15B3-4744-9A68-2EECD2B6B893
270336 2097152 3 Label: "USR-A"
Type: Alias for coreos-rootfs
UUID: 7130C94A-213A-4E5A-8E26-6CCE9662F132
Attr: priority=2 tries=0 successful=1
2367488 2097152 4 Label: "USR-B"
Type: Alias for coreos-rootfs
UUID: E03DD35C-7C2D-4A47-B3FE-27F15780A57C
Attr: priority=1 tries=1 successful=0
4464640 262144 6 Label: "OEM"
Type: Alias for linux-data
UUID: 28AAC862-F988-47E2-AE68-F458F3B4A5EA
4726784 131072 7 Label: "OEM-CONFIG"
Type: CoreOS reserved
UUID: 81246349-2C58-4934-8E5B-B2BF74739F47
4857856 995357327 9 Label: "ROOT"
Type: CoreOS auto-resize
UUID: 5CC492CE-4752-419A-8097-0899DA04968C
1000215183 32 Sec GPT table
1000215215 1 Sec GPT header


montana@node-001e67e310ba ~ $ sudo reboot

montana@node-001e67e310ba ~ $ cat /etc/os-release
NAME=CoreOS
ID=coreos
VERSION=835.13.0
VERSION_ID=835.13.0
BUILD_ID=
PRETTY_NAME="CoreOS 835.13.0"
ANSI_COLOR="1;32"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues”


Other Information

Feature Request

After restating update-engine.service, the update-engine to check if the CURRENT_OP=UPDATE_STATUS_UPDATED_NEED_REBOOT the it should not update the boot flags.

Environment

What hardware/cloud provider/hypervisor is being used to run CoreOS?
VirtualBox (Version 5.1.2 r108956)

Desired Feature

Other Information

@honeyankit

This comment has been minimized.

Show comment
Hide comment
@honeyankit

honeyankit Oct 22, 2016

The issue is not with CURRENT_OP, it is with the updating boot flags after restarting update-engine.service.

The issue is not with CURRENT_OP, it is with the updating boot flags after restarting update-engine.service.

@kbrwn

This comment has been minimized.

Show comment
Hide comment

@marineam marineam referenced this issue in coreos/coreos-overlay Oct 26, 2016

Merged

update_engine: bump to 0.4.1 #2255

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment