Download error: size not equal to remote size

I am trying to set up PlatformIO in a work environment. The board I want to use is the Arduino Due with the arduino platform. I am using the python embedded environment with the package pip_system_certs installed (I installed this in the PlatformIO venv as well) to allow python to accept https responses with a custom certificate. With this setup the first initialization works without a visible problem.

The problem occurs if I now try to install a package, for example with pio pkg install --global --tool “platformio/toolchain-gccarmnoneeabi”. When the download is at around 70-75% it suddenly jumps to 100% and warns about the downloaded package size is not equal to the remote size. Then it finds another mirror and starts all over again without finishing the installation.

(penv) PS C:\Users\braeu001\.platformio\penv\Scripts> pio pkg install --global --tool "platformio/toolchain-gccarmnoneeabi"
Tool Manager: Installing platformio/toolchain-gccarmnoneeabi
Downloading  [####################################]  100%
Tool Manager: Warning! Package Mirror: The size (123174473 bytes) of downloaded file 'toolchain-gccarmnoneeabi-windows_amd64-1.100301.220327.tar.gz' is not equal to remote size (165468219 bytes)
Tool Manager: Looking for another mirror...
Downloading  [####################################]  100%
Tool Manager: Warning! Package Mirror: The size (123567689 bytes) of downloaded file 'toolchain-gccarmnoneeabi-windows_amd64-1.100301.220327.tar.gz' is not equal to remote size (165468219 bytes)
Tool Manager: Looking for another mirror...
Downloading  [####################################]  100%
Tool Manager: Warning! Package Mirror: The size (123862601 bytes) of downloaded file 'toolchain-gccarmnoneeabi-windows_amd64-1.100301.220327.tar.gz' is not equal to remote size (165468219 bytes)
Tool Manager: Looking for another mirror...
Downloading  [####################################]  100%
Tool Manager: Warning! Package Mirror: The size (122617417 bytes) of downloaded file 'toolchain-gccarmnoneeabi-windows_amd64-1.100301.220327.tar.gz' is not equal to remote size (165468219 bytes)
Tool Manager: Looking for another mirror...
Downloading  [####################################]  100%
Tool Manager: Warning! Package Mirror: The size (123174473 bytes) of downloaded file 'toolchain-gccarmnoneeabi-windows_amd64-1.100301.220327.tar.gz' is not equal to remote size (165468219 bytes)
Tool Manager: Looking for another mirror...
Downloading  [############------------------------]   35%  00:01:53

Aborted!
(penv) PS C:\Users\braeu001\.platformio\penv\Scripts>

I have already asked our IT department but they can’t find anything wrong on their side. Do you have any more suggestions to try?

Delete C:\Users\<user>\.platformio\.cache.

Manually download

https://dl.registry.platformio.org/download/platformio/tool/toolchain-gccarmnoneeabi/1.100301.220327/toolchain-gccarmnoneeabi-windows_amd64-1.100301.220327.tar.gz

Is it successfull? What filesize does it have?

Clearing the cache did not help. Running the command afterwards resulted in the same problem.

On the company network a manual download has the same issue at around the same filesize as above (123174473 bytes). On my private system the download works as expected with a filesize of 165468219 bytes.
This leads me to suspect that there is some software somewhere which interrupts the download. I will forward this link to our IT department to check.

1 Like

We have found the issue on our side and are now thinking about how to fix it.
Our Palo Alto firewall flags one of the files in the archive as a thread and interrupts the download.

This seems to be linked to CVE-2019-5010 and as it is flagged as high severity we would like to avoid to add an Exception for this. Would it be possible to fix this vulnerability in the upstream package?

@jonasb2497 , I have exactly the same issue. What solution did you come up with to get around the problem?

Thanks and best regards,

Maxime