balena-io / etcher

Flash OS images to SD cards & USB drives, safely and easily.
https://etcher.io/
Apache License 2.0
29.96k stars 2.12k forks source link

Etcher displays "Error: undefined" when given a bad zipfile #2637

Open lurch opened 5 years ago

lurch commented 5 years ago

Interested in joining the Etcher team? Drop us a line at join+etcher@balena.io

Version = 1.4.9, Type = deb /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 Tue Feb 19 2019 01:30:27 GMT+0000 (GMT) Application start ({"packageType":"deb","version":"1.4.9","applicationSessionUuid":"65b33838-63df-4e33-a75e-555a3ded03d5"}) /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 Tue Feb 19 2019 01:30:27 GMT+0000 (GMT) Not checking for updates ({"shouldCheckForUpdates":true,"updatesEnabled":false,"stable":true,"applicationSessionUuid":"65b33838-63df-4e33-a75e-555a3ded03d5"}) /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 etcher:sdk:scanner start +1s true /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 Tue Feb 19 2019 01:30:27 GMT+0000 (GMT) SafeWebview loaded ({"event":{"isTrusted":false,"status":false,"newURL":"https://assets.balena.io/etcher-featured/index.html?etcher-version=1.4.9&api-version=2","originalURL":"https://assets.balena.io/etcher-featured/index.html?etcher-version=1.4.9&api-version=2","httpResponseCode":200,"requestMethod":"GET","referrer":"","headers":{"access-control-allow-origin":["*"],"age":["277"],"cache-control":["max-age=600"],"cf-ray":["4ab4f7e3781a361d-MAN"],"content-encoding":["gzip"],"content-type":["text/html; charset=utf-8"],"date":["Tue, 19 Feb 2019 01:30:27 GMT"],"expect-ct":["max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""],"expires":["Mon, 18 Feb 2019 19:14:48 GMT"],"last-modified":["Fri, 15 Feb 2019 15:06:10 GMT"],"server":["cloudflare"],"status":["200"],"vary":["Accept-Encoding"],"via":["1.1 varnish"],"x-cache":["HIT"],"x-cache-hits":["1"],"x-fastly-request-id":["4505bb9c0c980821515a633eb506c3d7dfaa3c59"],"x-github-request-id":["C44E:49C9:DCF18:1291ED:5C6B01D9"],"x-served-by":["cache-lhr6334-LHR"],"x-timer":["S1550539828.842633,VS0,VE0"]},"resourceType":"mainFrame"},"applicationSessionUuid":"65b33838-63df-4e33-a75e-555a3ded03d5","flashingWorkflowUuid":"b656f3eb-a1c4-45ed-9a77-9cdf9e4a2829"}) /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 Tue Feb 19 2019 01:30:28 GMT+0000 (GMT) SafeWebview loaded ({"event":{"isTrusted":false,"status":false,"newURL":"https://www.balena.io/etcher/success-banner/?etcher-version=1.4.9&api-version=2","originalURL":"https://www.balena.io/etcher/success-banner/?etcher-version=1.4.9&api-version=2","httpResponseCode":200,"requestMethod":"GET","referrer":"","headers":{"accept-ranges":["bytes"],"cache-control":["public, max-age=0"],"connection":["keep-alive"],"content-encoding":["gzip"],"content-type":["text/html; charset=UTF-8"],"date":["Tue, 19 Feb 2019 01:30:27 GMT"],"etag":["W/\"3c5e0-168f20da8c0\""],"last-modified":["Fri, 15 Feb 2019 16:46:48 GMT"],"server":["Cowboy"],"transfer-encoding":["chunked"],"vary":["Accept-Encoding"],"via":["1.1 vegur, 1.1 vegur"]},"resourceType":"mainFrame"},"applicationSessionUuid":"65b33838-63df-4e33-a75e-555a3ded03d5","flashingWorkflowUuid":"b656f3eb-a1c4-45ed-9a77-9cdf9e4a2829"}) /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 Tue Feb 19 2019 01:30:29 GMT+0000 (GMT) Open image selector ({"applicationSessionUuid":"65b33838-63df-4e33-a75e-555a3ded03d5","flashingWorkflowUuid":"b656f3eb-a1c4-45ed-9a77-9cdf9e4a2829"}) /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 "Archive read error" console.(anonymous function) @ /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 Tue Feb 19 2019 01:30:59 GMT+0000 (GMT) Open image selector ({"applicationSessionUuid":"65b33838-63df-4e33-a75e-555a3ded03d5","flashingWorkflowUuid":"b656f3eb-a1c4-45ed-9a77-9cdf9e4a2829"}) /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58 "Bad archive" console.(anonymous function) @ /opt/balenaEtcher/resources/app.asar/node_modules/raven-js/dist/raven.js:58


I created a couple of deliberately-bad zipfiles, just to see how Etcher would react :wink: 
```bash
touch empty.zip
dd if=/dev/urandom of=fake.zip bs=1M count=2

When I try to select empty.zip I see this error dialog image even though the DevTools console says "Archive read error".

Similarly when I select fake.zip I see the error dialog image even though the DevTools console says "Bad archive".

It might be nice if the error dialogs displayed to the user contained the more-informative message that the DevTools console displays (i.e. "Error: Archive read error" or "Error: Bad archive"), rather than simply displaying "Error: undefined" ?

thundron commented 5 years ago

@lurch I think you just lighted the light bulb on my head for an issue we saw in error reporting