@ptillisch and others:
Yesterday I updated my main Arduino IDE install to 2.3.0
(I have 2 IDE 2 installs: latest released, nightly.
I also updated most of the updated boards as well (Did not update Teensy as running latest beta).
On one of them, I waw a message about "Unexpected EOF" ...
Not sure which one, but pretty sure it was one of the Arduino MBED ... ones
Could have been the Arduino RPI...
Is there an easy way to confirm if the downloaded files match what is up on the servers. Better yet a way for Arduino IDE/CLI to doublecheck and redownload if necessary?
Now to see if I can find out what their sizes match what they should be...
With the Teensy one (last on list), I can probably check the .json file to find out what size and checksum to expect.
Arduino CLI / IDE definitely does check when I put the wrong size into the package index.
But perhaps CLI / IDE has an issue where the size is not always properly checked?
Just yesterday we had a user report "Unexpected EOF". Looking at the files in {Arduino15}/packages/staging revealed the downloaded file was indeed truncated. He was using spotty public wifi in a remote location, which likely caused the download to be incomplete. However, Arduino IDE / CLI did not give any indication the download was incomplete or corrupt. Instead it appears to have disregarding the size and SHA256 checksum and tried to use it, which of course ends up with "Unexpected EOF" because the file was truncated.
Maybe there are some anomalous conditions where the size and checksum aren't being proper verified? Or maybe in some circumstances the check isn't resulting in retrying the download, or an appropriate user notification that the download failed and they need to retry later?
What evidence do you have that it tried to use the file?
From my perspective where I don't have a deep understanding about the problem due to the lack of information and ability to reproduce the fault (despite making some significant efforts to do so), it seems as likely that the "Unexpected EOF" error is occurring during the download phase rather than the installation phase.
In this screenshot, the words "Failed to install platform" appear on the line just before "Error: 2 UNKNOWN: unexpected EOF" .
Those 4 words, particularly the word "install" is the evidence which led me to (perhaps incorrectly) believe Arduino IDE / CLI was attempting to make use of the incomplete data which has the wrong size and (probably) wrong checksum.
Regardless of what stage was in play, I hope everyone can agree this "Error: 2 UNKNOWN: unexpected EOF" message falls short of Arduino's reputation for excellent usability and ease of use. The user gets no human-readable explanation of the problem. They don't get a definitive explanation the problem was an error downloading data, likely caused by poor internet connectivity. They get no advice to simply try again later, as one would normally expect to see when software knows the problem was an incomplete download.
That "Failed to install platform" message always appears when any part of the process fails. For example, if I disable my Internet connection during the installation:
Downloading packages
teensy:teensy-tools@1.59.0
teensy:teensy-compile@11.3.1
Failed to install platform: 'teensy:avr:1.59.0'.
Error: 2 UNKNOWN: read tcp 192.168.254.28:64946->162.254.150.250:443: wsarecv: An established connection was aborted by the software in your host machine.
Sure, but it's counterproductive to jump to conclusions about the cause of the fault.
So far I did not find any of the files that downloaded, to have a different size than expected.
I should have captured the screen when it happened.
It was more confusing in the case I had, as I told the system to update more than one board type. So it had messages of downloading and installing intermixed.
Totally agree the messages and the like could be improved.