Go Down

Topic: Boards Manager - Error Downloading http://downloads.arduino.cc/packages/pack... (Read 531 times) previous topic - next topic

antman81

It looks like others have found this problem while attempting to add the DUE board to their IDE. The DUE board ins't supported by default, so when attempting to add the SAMD files (from a Mac):

  Tools  |  Board* |  Boards Manager

Results in an error in the popup which shows:

Error Downloading http://downloads.arduino.cc/packages/package_index.json

However, I can go to a browser and load that JSON text without issue. So it doesn't appear to be anything network related (same symptom also from 2 internet sources).

The console spits out some additional error diagnostics, for me:

 Error downloading http://downloads.arduino.cc/packages/package_index.json
java.lang.RuntimeException: java.lang.Exception: Error downloading http://downloads.arduino.cc/packages/package_index.json
   at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$0(ContributionManagerUI.java:151)
   at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Error downloading http://downloads.arduino.cc/packages/package_index.json
   at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:131)
   at cc.arduino.contributions.packages.ContributionInstaller.download(ContributionInstaller.java:334)
   at cc.arduino.contributions.packages.ContributionInstaller.downloadIndexAndSignature(ContributionInstaller.java:309)
   at cc.arduino.contributions.packages.ContributionInstaller.updateIndex(ContributionInstaller.java:287)
   at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$0(ContributionManagerUI.java:147)
   ... 1 more
Caused by: java.io.IOException: Received invalid http status code from server: 416
   at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:194)
   at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:128)
   at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:129)
   ... 5 more
 Error downloading http://downloads.arduino.cc/packages/package_index.json
java.lang.RuntimeException: java.lang.Exception: Error downloading http://downloads.arduino.cc/packages/package_index.json
   at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$0(ContributionManagerUI.java:151)
   at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Error downloading http://downloads.arduino.cc/packages/package_index.json
   at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:131)
   at cc.arduino.contributions.packages.ContributionInstaller.download(ContributionInstaller.java:334)
   at cc.arduino.contributions.packages.ContributionInstaller.downloadIndexAndSignature(ContributionInstaller.java:309)
   at cc.arduino.contributions.packages.ContributionInstaller.updateIndex(ContributionInstaller.java:287)
   at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$0(ContributionManagerUI.java:147)
   ... 1 more
Caused by: java.io.IOException: Received invalid http status code from server: 416
   at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:194)
   at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:128)
   at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:129)
   ... 5 more
 Error downloading http://downloads.arduino.cc/packages/package_index.json
java.lang.RuntimeException: java.lang.Exception: Error downloading http://downloads.arduino.cc/packages/package_index.json
   at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$0(ContributionManagerUI.java:151)
   at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Error downloading http://downloads.arduino.cc/packages/package_index.json
   at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:131)
   at cc.arduino.contributions.packages.ContributionInstaller.download(ContributionInstaller.java:334)
   at cc.arduino.contributions.packages.ContributionInstaller.downloadIndexAndSignature(ContributionInstaller.java:309)
   at cc.arduino.contributions.packages.ContributionInstaller.updateIndex(ContributionInstaller.java:287)
   at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onUpdatePressed$0(ContributionManagerUI.java:147)
   ... 1 more
Caused by: java.io.IOException: Received invalid http status code from server: 416
   at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:194)
   at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:128)
   at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:129)
   ... 5 more


Any ideas?

ard_newbie

Maybe a solution in case a previous DUE compiler upload attempt failed, stepwise:

In Menu: File>Preferences, at the bottom of the Preferences window, click  in the url:
C:\Users\...\AppData\Local\Arduino15\preferences.txt

Then select: packages/Arduino/hardware/sam

Delete the sam folder.

Close and reopen an IDE window, in Menu: Tools>Type of Board>Board Manager, select Arduino Sam Boards (Cortex M3), Install.

pert

I think you're on the right track ard_newbie, except probably deleting the wrong thing.

I think this is the explanation of the problem:
https://github.com/arduino/Arduino/issues/6628
It seems Arduino IDE 1.8.5 and older try to use a partially downloaded package_index.json file so if something get's corrupted with that file it causes this 416 error. The solution is to delete the file.

This issue has since been resolved, but after the Arduino IDE 1.8.5 release so likely it wouldn't happen when using the hourly build or future IDE releases.

Go Up