swift-models icon indicating copy to clipboard operation
swift-models copied to clipboard

Better error message on unzip failure

Open texasmichelle opened this issue 5 years ago • 2 comments

I attempted to run benchmarks on a fresh instance that did not have unzip installed. The error message is misleading, stating that the file does not exist, even though the download was successful.

We should also document unzip in the README as a required dependency, or fail more gracefully. Even better, do the unarchiving ourselves, without relying on a local install (@BradLarson).

$ swift run -c release Benchmarks   --filter WordSegScore   --filter-not x10
running WordSegScore: sentence_4...Loading resource: seg
File does not exist locally at expected path: /home/michellecasbon_google_com/.cache/swift-models/datasets/WordSeg/seg and must be fetched
Fetching URL: https://s3.eu-west-2.amazonaws.com/k-kawakami/seg.zip...
Archive saved to: /home/michellecasbon_google_com/.cache/swift-models/datasets/WordSeg
Failed to extract /home/michellecasbon_google_com/.cache/swift-models/datasets/WordSeg/seg.zip with error: Error Domain=NSCocoaErrorDomain Code=260 "The file doesn’t exist."
$ ls -l /home/michellecasbon_google_com/.cache/swift-models/datasets/WordSeg/seg.zip
-rw-r--r-- 1 michellecasbon_google_com 803248955 7375585 Oct  1 02:38 /home/michellecasbon_google_com/.cache/swift-models/datasets/WordSeg/seg.zip

texasmichelle avatar Oct 01 '20 02:10 texasmichelle

I'd like to work on this issue. I could start with getting the right error message and adding unzip as a required dependency in the README.

abhichou4 avatar Dec 06 '20 13:12 abhichou4

The problem seems to be in DatasetUtilities.swift. In extractArchive, the "The file doesn’t exist." is the unzip executable that does not exist. (here)

abhichou4 avatar Dec 27 '20 14:12 abhichou4