Skip to content

failed to pull and unpack image: failed reading status of resume write #3089

@sofat1989

Description

@sofat1989

We use containerd of version v.12.4 for k8s. In one node of our cluster, cannot pull one image. It throws out this error

failed reading status of resume write: stat /var/lib/containerd/io.containerd.content.v1.content/ingest/cddbab0c1f2bab91536889d3938a596ee7838e2db8c9f4e30bc6094216c8a02d/data: no such file or directory: not found

We checked this data directory /var/lib/containerd/io.containerd.content.v1.content/ingest/cddbab0c1f2bab91536889d3938a596ee7838e2db8c9f4e30bc6094216c8a02d/. It is empty. We think it may be caused by the interrupted previous pulling

Pulling other images is OK

How to reproduce

Step 1: pull an image
Step 2: ctrl +c to break the pulling
Step 3: clean all the contents in one dir under /var/lib/containerd/io.containerd.content.v1.content/ingest/
image

Step 4: retry to pull this image. It will throw the error

I check the codes here. If the dir exists and no data in this dir, it will directly throw out this error

if err := os.Mkdir(path, 0755); err != nil {
		if !os.IsExist(err) {
			return nil, err
		}
               status, err := s.status(path)
		if err != nil {
			return nil, errors.Wrap(err, "failed reading status of resume write")
		}
      .....
} else {
      // setup the target location.
     // write the ref to a file for later use
     ...
}

So shall we add a logic to check whether the dir is empty?
if so, we will go to write ref, startdat and updatedata file treating this ingest new
And if any errors happened during the resume process, we re-create these files again

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions