Activity log for bug #2043482

Date Who What changed Old value New value Message
2023-11-14 14:33:12 Paul Mars bug added bug
2023-11-14 14:42:38 Paul Mars description This is not possible to properly resume when we stopped just after the germinate state. The following command will work, but the next one (executed after the first one) will crash. sudo ./ubuntu-image --debug classic --thru germinate --workdir ~/scratch/server-pc-amd64 ../ubuntu-images/ubuntu-server-pc-amd64.yaml sudo ./ubuntu-image --debug classic --resume --thru install_packages --workdir ~/scratch/server-pc-amd64 ../ubuntu-images/ubuntu-server-pc-amd64.yaml Error: invalid steps taken count (9). The state machine only have 4 steps This is not specific to the germinate state, I also reproduced this issue by stopping after the build_gadget_tree state (and this case, even encountered a panic!). Even if the command did not crash, the state "install_packages" would not installed any packages found by germinate because the list is not saved in the state written to disk. The resume feature needs more work to be able to stop/resume at any state. This may be important for the imagecraft integration. This is not possible to properly resume when we stopped just after the germinate state. The following command will work, but the next one (executed after the first one) will crash. sudo ./ubuntu-image --debug classic --thru germinate --workdir ~/scratch/server-pc-amd64 ../ubuntu-images/ubuntu-server-pc-amd64.yaml sudo ./ubuntu-image --debug classic --resume --thru install_packages --workdir ~/scratch/server-pc-amd64 ../ubuntu-images/ubuntu-server-pc-amd64.yaml Error: invalid steps taken count (9). The state machine only have 4 steps Even if the command did not crash, the state "install_packages" would not installed any packages found by germinate because the list is not saved in the state written to disk. This is not specific to the germinate state, I also reproduced this issue by stopping after the build_gadget_tree state and in this case I encountered the following panic: sudo ubuntu-image classic -v test.yaml -w ./test -t build_gadget_tree [0] parse_image_definition [1] calculate_states [2] make_temporary_directories [3] determine_output_directory [4] build_gadget_tree sudo ubuntu-image classic -v test.yaml -w ./test -r panic: runtime error: slice bounds out of range [5:4] goroutine 1 [running]: github.com/canonical/ubuntu-image/internal/statemachine.(*StateMachine).readMetadata(0xc0002d7680) /build/ubuntu-image/parts/ubuntu-image/build/internal/statemachine/state_machine.go:362 +0x591 github.com/canonical/ubuntu-image/internal/statemachine.(*ClassicStateMachine).Setup(0xc0002d7680) /build/ubuntu-image/parts/ubuntu-image/build/internal/statemachine/classic.go:51 +0x9f main.executeStateMachine(0xc0002e3f10, 0xc0002e6180, 0xc0000b5560) /build/ubuntu-image/parts/ubuntu-image/build/cmd/ubuntu-image/main.go:46 +0x2e5 main.main() /build/ubuntu-image/parts/ubuntu-image/build/cmd/ubuntu-image/main.go:157 +0x6fa The resume feature needs fixing to be able to stop/resume at any state. This may be important for the imagecraft integration.
2023-11-22 09:26:57 Paul Mars ubuntu-image: status Confirmed In Progress
2023-11-22 09:27:00 Paul Mars ubuntu-image: assignee Paul Mars (upils)
2023-12-04 08:11:20 Paul Mars tags foundations-todo
2023-12-04 17:24:59 Paul Mars ubuntu-image: status In Progress Fix Committed
2023-12-05 07:14:06 Paul Mars tags foundations-todo
2024-02-22 09:43:09 Paul Mars ubuntu-image: status Fix Committed Fix Released