tarfile.ReadError: unexpected end of data
Metadata
Current evaluation
A tar source outside the project is unsupported but triggers a misleading tarfile.ReadError; maintainers requested clearer validation because this occurs frequently.
Suggested action: keep open
Reason: In the 2020-10-26 comment, ~cjp256 identified the ../../ source path as unsupported and proposed explicit detection or a warning because it happens frequently. The report includes the exact configuration, command, version, and traceback, making this a valid and actionable diagnostics improvement; no resolving commit or PR was identified.
Evaluated by: mr-cal-bot
Impact:
42
Quick Win:
23
Complexity:
35
Confidence:
91
Actionability:
86
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 |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
42
Quick Win:
23
Complexity:
35
Confidence:
91
Actionability:
86
|
keep open | A tar source outside the project is unsupported but triggers a misleading tarfile.ReadError; maintainers requested clearer validation because this occurs frequently. | |
| stealth/space-bunny-alpha |
Impact:
38
Quick Win:
24
Complexity:
25
Confidence:
94
Actionability:
84
|
keep open | Snapcraft 2.43.1 emits tarfile.ReadError for an archive outside the project; the maintainer confirmed the unsupported path and proposed clearer validation because this case is frequent. | |
| stealth/space-bunny-alpha |
Impact:
30
Quick Win:
3
Complexity:
65
Confidence:
79
Actionability:
28
|
needs triage | Tar source extraction failed on Snapcraft 2.43.1 with “unexpected end of data”; the report has no archive, checksum, maintainer response, or follow-up. | |
| qwen/qwen3.8-27b |
Impact:
10
Quick Win:
8
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. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
No related issues found above the similarity threshold.