Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

rkt 0.7.0 fetch fails when an ACI compressed with xz #1224

Closed
kazuki opened this issue Jul 31, 2015 · 2 comments · Fixed by #1462
Closed

rkt 0.7.0 fetch fails when an ACI compressed with xz #1224

kazuki opened this issue Jul 31, 2015 · 2 comments · Fixed by #1462
Assignees
Milestone

Comments

@kazuki
Copy link

kazuki commented Jul 31, 2015

rkt fetch/run always fails when an ACI compressed with xz.

$  rkt version
rkt version 0.7.0
appc version 0.6.1

$ sudo rkt --insecure-skip-verify fetch test.aci
error copying image: exit status 1

I found a commit that caused this issue using git-bisect.
7fbfb35

This commit adds code that calling aci.ManifestFromImage before calling WriteACI.
ManifestFromImage reads ACI file partially.
Currently, XZ decompressor implementation is executing xz command at goroutine.
ManifestFromImage partially reads ACI file.
But xz command is still executing after ManifestFromImage exited.

Therefore, file position is changed by xz command that was executed at ManifestFromImage, and cannot read begining of file at WriteACI.

@sgotti
Copy link
Contributor

sgotti commented Aug 1, 2015

@kazuki Thanks for your report and analysis! I can reproduce this easily with a quite big ACI having the manifest at the start of the tar as this helps keeping more than one xz process running.

I'm testing some patches (for both appc/spec and rkt) that should fix this. I also discovered another bug while looking at this. I'll link the related PRs here when ready.

@jonboulle
Copy link
Contributor

Blocked on #1272

@jonboulle jonboulle added this to the v0.9.0 milestone Aug 19, 2015
jonboulle added a commit to jonboulle/rkt that referenced this issue Sep 23, 2015
The interface for aci.NewCompressedReader changed in the upstream appc
code (appc/spec#462) to return a ReadCloser
instead of a Reader. Hence it's now our responsibility to close the
returned ACI.

Fixes rkt#1224
@jonboulle jonboulle self-assigned this Sep 23, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants