haskell / haskell/cabal

"truncated tar archive" on cabal update

Open
#5,518 21 comments 2 reactions 0 assignees View on GitHub
attention: pr-welcome type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I had some connection issues lately which seems to have caused cabal to only partially download some files when updating the index.

This results in the error below, which gives no indication on how to fix this.

```
Andi@Horzube MINGW64 ~/trees/someCalls
$ cabal new-update
Downloading the latest package list from hackage.haskell.org
truncated tar archive
```
After some search I found that deleting .cabal/packages fixes the issue.

Ideally cabal when detecting this issue should either invalidate the cache and redownload it or at least give the user the path to the offending file.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with `cabal new-update` after creating a partial package index under `.cabal/packages`. Trace how cabal-install handles the truncated tar archive and cache path, then verify that the failure either refreshes the cache or identifies the offending file without requiring manual deletion.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.