← Back to issue list

tarfile.ReadError: unexpected end of data

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1899311
Type
issue
State
open
Author
~amodster
Labels
craft-418
Created
Updated
Closed

Current evaluation

snapcraft pull fails with tarfile.ReadError 'unexpected end of data' when extracting a local tar source. 5+ years old, snapcraft 2.43.1, zero comments, no maintainer interaction. Likely a truncated/corrupt tar file on the user's side, not a snapcraft defect.

Suggested action: close not a bug

Reason: The 'unexpected end of data' tarfile.ReadError is raised by Python's tarfile module when the archive file is truncated or corrupt — the tar header declares a member size larger than the remaining bytes in the file. This is a user data issue (the local file '../../dkentry-py3-dotnet.tar' is incomplete), not a snapcraft bug; snapcraft correctly surfaced the underlying error. The user's only 'reproduction' was importing the tarfile module, which is unrelated. The issue is also on a 2020-era version (2.43.1) with no reproduction steps, no maintainer response, and no activity in ~5 years.

Impact: 10 Quick Win: 8.0 Staleness: 92 Complexity: 20 Confidence: 72 Support Request: 75

Issue body

Hello tar archive extract is failing. parts: #dkentry-py3-dotnet, place to hold support items dkentry-py3-dotnet: source: '../../dkentry-py3-dotnet.tar' source-type: tar snapcraft, version 2.43.1+18.4 ubuntu@SER-VM-Ubuntu:~/UbuntuCore/SnapsDev/frozenmountain-doorking-snap$ snapcraft --debug --no-parallel-builds --target-arch=armhf pull dkentry-py3-dotnet Setting target machine to 'armhf' Pulling dkentry-py3-dotnet Sorry, an error occurred in Snapcraft: Traceback (most recent call last): File "/usr/bin/snapcraft", line 11, in <module> load_entry_point('snapcraft==2.43.1+18.4', 'console_scripts', 'snapcraft')() File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 70, in pull _execute(steps.PULL, parts, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 35, in _execute lifecycle.execute(step, project_config, parts) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 90, in execute executor.run(step, part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 194, in run self._handle_step(part_names, part, step, current_step, cli_config) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 208, in _handle_step getattr(self, "_run_{}".format(current_step.name))(part) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 250, in _run_pull self._run_step(step=steps.PULL, part=part, progress="Pulling") File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 327, in _run_step getattr(part, step.name)() File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 415, in pull self._runner.pull() File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 83, in pull "override-pull", self._override_pull_scriptlet, self._sourcedir File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 162, in _run_scriptlet scriptlet_name, function_call.strip() File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/_runner.py", line 218, in _handle_builtin_function function(**function_args) File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 434, in _do_pull self.source_handler.pull() File "/usr/lib/python3/dist-packages/snapcraft/internal/sources/_base.py", line 106, in pull self.provision(self.source_dir, src=source_file, clean_target=False) File "/usr/lib/python3/dist-packages/snapcraft/internal/sources/_tar.py", line 70, in provision self._extract(tarball, dst) File "/usr/lib/python3/dist-packages/snapcraft/internal/sources/_tar.py", line 108, in _extract tar.extractall(members=filter_members(tar), path=dst) File "/usr/lib/python3.6/tarfile.py", line 2012, in extractall numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2054, in extract numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2124, in _extract_member self.makefile(tarinfo, targetpath) File "/usr/lib/python3.6/tarfile.py", line 2173, in makefile copyfileobj(source, target, tarinfo.size, ReadError, bufsize) File "/usr/lib/python3.6/tarfile.py", line 257, in copyfileobj raise exception("unexpected end of data") tarfile.ReadError: unexpected end of data We would appreciate it if you created a bug report at https://launchpad.net/snapcraft/+filebug with the above text included. I was able to import the tar python module. python3 Python 3.6.9 (default, Jul 17 2020, 12:50:27) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tarfile >>> quit()

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 10
Quick Win: 8.0
Staleness: 92
Complexity: 20
Confidence: 72
Support Request: 75
close not a bug snapcraft pull fails with tarfile.ReadError 'unexpected end of data' when extracting a local tar source. 5+ years old, snapcraft 2.43.1, zero comments, no maintainer interaction. Likely a truncated/corrupt tar file on the user's side, not a snapcraft defect.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 30
close stale Tar extraction fails with ReadError: unexpected end of data during snapcraft pull. Issue is 5+ years old, uses snapcraft v2.43.1, has no maintainer interaction or reproduction steps.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 30
close stale Snapcraft fails to extract a tar archive with 'unexpected end of data' error during the pull step. Issue is very old and likely obsolete due to version changes.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 40
close stale Reports tarfile.ReadError during snapcraft pull on version 2.43.1. Over 5 years old, lacks reproduction steps, and references an obsolete environment.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 15
close stale Reports a tarfile.ReadError during snapcraft pull with version 2.43.1. No maintainer response or reporter follow-up in over five years. The reported version is unsupported and the codebase has changed significantly.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1573753 sources can't extract tar.xz archive snapcraft (launchpad) open Snapcraft 2.8.4 fails to extract a tar.xz source (transmission-2.92) with a KeyError on a missing symlink target during tarfile.extractall. 10+ years old, no maintainer response; traceback references code paths no longer present in the current codebase.
72%