Go Down

Topic: Boards Manager - Error Downloading http://downloads.arduino.cc/packages/pack... (Read 4692 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.

Alfrow

This can also happen if there is an incomplete json file for the board manager in ArduinoData folder.

I deleted it and fixed the issue.

bighole_mcginty

i too have found this problem

i have tried the java commandline code
i can navigate to the url
i have tried deleting the app data files
i have tried installing as a portable installation
there is no "relevantKnowledge" spyware installed
i have tried navigating to the url copying the text and saving the file in the appropriate app data folder (even on the portable install)
i still suspect its a java issue brought about by the I T gestapo
anyone with more info? ideas? suggestions? monetary gifts?

ard_newbie


What is the selected option you have in File/Preferences, Network folder ?


ard_newbie


I have the same option selected.

Maybe an issue with the last Sam board compiler (32-bits ARM Cortex M3) version. If you delete the sam folder as explained in reply#1, and you select and install an old version (e.g. 1.6.6) and BTW check your USB cable (lots of issues with faulty cables), can you download aminimal sketch ?

bighole_mcginty

um i havent got as far as hooking up a board yet just trying to get the library index and board index to show up then may be i can install the appropriate one(s)

pert

bighole_mcginty, are you getting the "Received invalid http status code from server: 416" error?

bighole_mcginty

i'm using version 1.8.7 if that is of any help
no, no error like that.
but as per other posts -"caused by java.net.sockettimeoutexcepton:connect timed out

at java. net.twostacksplainsocketimpl.socketconnect(nativemethod) blah blah blah

bighole_mcginty

is there a way i can turn the automatic downloading of index's off and just install them manually from the url while the "the collective" (myself included) comes up with a solution?

pert

no, no error like that.
but as per other posts -"caused by java.net.sockettimeoutexcepton:connect timed out

at java. net.twostacksplainsocketimpl.socketconnect(nativemethod) blah blah blah
Ah, so your problem is not really the same. Please post the complete output, using code tags (</> button on the toolbar).

is there a way i can turn the automatic downloading of index's off
Well, you can turn of automated checks for new releases by unchecking File > Preferences > Check for updates on startup. That same preference controls checks for IDE updates, board updates, and library updates.

and just install them manually from the url
That is possible, but it's fairly complex because there are multiple tools that need to be installed in a specific folder structure. Let's have a look at the error and see if you can get it working properly before diving into a hacky workaround.

Go Up