Bug 2060415

Summary: can't uncompress dumped file by podman container checkpoint
Product: Red Hat Enterprise Linux 8 Reporter: Alex Jia <ajia>
Component: podmanAssignee: Urvashi Mohnani <umohnani>
Status: ASSIGNED --- QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.6CC: bbaude, dwalsh, jligon, jnovy, lsm5, mheon, pthomas, tsweeney, umohnani, ypu
Target Milestone: rcFlags: jnovy: needinfo? (umohnani)
tsweeney: needinfo? (umohnani)
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Jia 2022-03-03 13:48:27 UTC
Description of problem:
Altough podman container checkpoint/restore can be ran successfully, but it's failed to manually uncompress dumped file generated by podman container checkpoint, and got error lile this "gzip: stdin: not in gzip format XXX", it's okay to podman v4.0 on RHEL 9.

Version-Release number of selected component (if applicable):
[root@sweetpig-21 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.6 Beta (Ootpa)

[root@sweetpig-21 ~]# rpm -q podman runc crun criu systemd kernel
podman-4.0.2-1.module+el8.6.0+14379+4ec2a99a.x86_64
runc-1.0.3-2.module+el8.6.0+14379+4ec2a99a.x86_64
crun-1.4.2-1.module+el8.6.0+14379+4ec2a99a.x86_64
criu-3.15-3.module+el8.6.0+14379+4ec2a99a.x86_64
systemd-239-58.el8.x86_64
kernel-4.18.0-369.el8.x86_64

How reproducible:
always

Steps to Reproduce:
1. podman run -it --name foobar quay.io/libpod/alpine:latest sleep 1000
2. podman container checkpoint foobar -e /tmp/foobar.tar.gz
3. tar xvf /tmp/foobar.tar.gz or tar zxvf /tmp/foobar.tar.gz

Actual results:
[root@sweetpig-21 ~]# podman run -it --name foobar quay.io/libpod/alpine:latest sleep 1000

open a new terminal window

[root@sweetpig-21 ~]# podman ps
CONTAINER ID  IMAGE                         COMMAND     CREATED         STATUS             PORTS       NAMES
4282ccd8a7de  quay.io/libpod/alpine:latest  sleep 1000  11 seconds ago  Up 11 seconds ago              foobar

[root@sweetpig-21 ~]# podman exec foobar ps|grep sleep
    1 root      0:00 sleep 1000

[root@sweetpig-21 ~]# podman --runtime=runc container checkpoint foobar -e /tmp/foobar.tar.gz
4282ccd8a7deeaef0b8afeab7b071d219144cd451cee4d76c60bebc74bf8c48d
[root@sweetpig-21 ~]# podman ps
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
[root@sweetpig-21 ~]# podman ps -a
CONTAINER ID  IMAGE                         COMMAND     CREATED             STATUS                    PORTS       NAMES
4282ccd8a7de  quay.io/libpod/alpine:latest  sleep 1000  About a minute ago  Exited (0) 7 seconds ago              foobar
[root@sweetpig-21 ~]# podman container restore --latest
4282ccd8a7deeaef0b8afeab7b071d219144cd451cee4d76c60bebc74bf8c48d
[root@sweetpig-21 ~]# podman ps
CONTAINER ID  IMAGE                         COMMAND     CREATED             STATUS                 PORTS       NAMES
4282ccd8a7de  quay.io/libpod/alpine:latest  sleep 1000  About a minute ago  Up About a minute ago              foobar
[root@sweetpig-21 ~]# podman exec foobar ps|grep sleep
    1 root      0:00 sleep 1000
[root@sweetpig-21 ~]# tar zxvf /tmp/foobar.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Expected results:
fix it.

Additional info:

it works well for podman-4.0.1-1.el9.x86_64 w/ crun and runc runtime on 9.0.

[root@kvm-07-guest10 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux release 9.0 Beta (Plow)

[root@kvm-07-guest10 podman]# rpm -q podman crun runc criu systemd kernel
podman-4.0.1-1.el9.x86_64
crun-1.4.2-1.el9.x86_64
runc-1.1.0-2.el9.x86_64
criu-3.15-13.el9.x86_64
systemd-250-3.el9.x86_64
kernel-5.14.0-69.el9.x86_64

[root@kvm-07-guest10 ~]# criu check --all
Looks good.

...ignore...

[root@kvm-07-guest10 dumpfile]# file checkpoint-7ea942556e5222fd7e1fe93fce9121c7dc730d0159be6e5346c595e558d86bbe.tar.gz
checkpoint-7ea942556e5222fd7e1fe93fce9121c7dc730d0159be6e5346c595e558d86bbe.tar.gz: Zstandard compressed data (v0.8+), Dictionary ID: None

[root@kvm-07-guest10 dumpfile]# tar xvf checkpoint-7ea942556e5222fd7e1fe93fce9121c7dc730d0159be6e5346c595e558d86bbe.tar.gz
artifacts/
devshm-checkpoint.tar
config.dump
spec.dump
network.status
stats-dump
checkpoint/
checkpoint/cgroup.img
checkpoint/core-1.img
checkpoint/descriptors.json
checkpoint/fdinfo-2.img
checkpoint/files.img
checkpoint/fs-1.img
checkpoint/ids-1.img
checkpoint/inventory.img
checkpoint/ipcns-var-11.img
checkpoint/mm-1.img
checkpoint/mountpoints-13.img
checkpoint/netns-10.img
checkpoint/pagemap-1.img
checkpoint/pages-1.img
checkpoint/pstree.img
checkpoint/seccomp.img
checkpoint/timens-0.img
checkpoint/tmpfs-dev-56.tar.gz.img
checkpoint/tmpfs-dev-59.tar.gz.img
checkpoint/tmpfs-dev-60.tar.gz.img
checkpoint/tmpfs-dev-61.tar.gz.img
checkpoint/tmpfs-dev-62.tar.gz.img
checkpoint/tmpfs-dev-63.tar.gz.img
checkpoint/tty-info.img
checkpoint/utsns-12.img

Comment 1 Tom Sweeney 2022-03-04 16:06:03 UTC
@umohnani could you take a peek at this please?

Comment 2 Urvashi Mohnani 2022-04-06 14:14:40 UTC
Yup, working on it.

Comment 3 Tom Sweeney 2023-05-04 22:48:14 UTC
@umohnani is this still a WIP and/or can you add a PR link here please?