Trying to installate library Error downloading https://downloads.arduino.cc/libraries/github.com/arduino-libraries/Arduino_Low_Power-1.2.2.zip

Hello Everybody,

I have two portable installations of Arduino 1.8.19
I tried to download a library and get this bunch of error-messages

 Error downloading https://downloads.arduino.cc/libraries/github.com/arduino-libraries/Arduino_Low_Power-1.2.2.zip
java.lang.RuntimeException: java.lang.Exception: Error downloading https://downloads.arduino.cc/libraries/github.com/arduino-libraries/Arduino_Low_Power-1.2.2.zip
	at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:250)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Error downloading https://downloads.arduino.cc/libraries/github.com/arduino-libraries/Arduino_Low_Power-1.2.2.zip
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:145)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:79)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:56)
	at cc.arduino.contributions.libraries.LibraryInstaller.performInstall(LibraryInstaller.java:148)
	at cc.arduino.contributions.libraries.LibraryInstaller.install(LibraryInstaller.java:118)
	at cc.arduino.contributions.libraries.LibraryInstaller.install(LibraryInstaller.java:110)
	at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:242)
	... 1 more
Caused by: java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:210)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
	at sun.security.ssl.SSLSocketImpl.waitForClose(SSLSocketImpl.java:1761)
	at sun.security.ssl.HandshakeOutStream.flush(HandshakeOutStream.java:124)
	at sun.security.ssl.Handshaker.kickstart(Handshaker.java:1079)
	at sun.security.ssl.SSLSocketImpl.kickstartHandshake(SSLSocketImpl.java:1479)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1346)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:162)
	at cc.arduino.utils.network.HttpConnectionManager.makeConnection(HttpConnectionManager.java:138)
	at cc.arduino.utils.network.HttpConnectionManager.makeConnection(HttpConnectionManager.java:96)
	at cc.arduino.utils.network.FileDownloader.openConnectionAndFillTheFile(FileDownloader.java:217)
	at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:176)
	at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:125)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:143)
	... 7 more

What I have tried so far:

  • trying do download different libraries same error

  • restarting my computer (of course)

  • using the second portable installation of Arduino 1.8.19 which is able to install libraries with the library manager successfully

terminating Arduino-IDE

  • deleting the files
    F:\Portable-Gelb\arduino-1.8.19\portable\library_index.json
    and
    F:\Portable-Gelb\arduino-1.8.19\portable\library_index.json.sig

still the same error

Does somebody have an idea what is going wrong?
Somehow the urls where the IDE wants to download from seem to be strange to me

best regards Stefan

It is working fine for me.

Does the file download if you open the URL in your browser?

https://downloads.arduino.cc/libraries/github.com/arduino-libraries/Arduino_Low_Power-1.2.2.zip

They are correct.

They are based on the repository URL of the library, with this form:

https://downloads.arduino.cc/libraries/<repository host>/<repository owner>/<sanitized library name>-<release version>.zip

In this example, the repository URL is:

https://github.com/arduino-libraries/ArduinoLowPower

From this we get some of the path components of the download URL:

  • <repository host>: github.com
  • <repository owner>: arduino-libraries

Now the confusing thing is that the last part of the URL is not based on the repository URL, but rather the library name, which is defined by the name field of the library.properties metadata file:

https://github.com/arduino-libraries/ArduinoLowPower/blob/1.2.2/library.properties#L1

name=Arduino Low Power

This is "sanitized" by changing the spaces to _. Giving us Arduino_Low_Power for <sanitized library name>.

The <release version> component is defined by the version field of the metadata file:

https://github.com/arduino-libraries/ArduinoLowPower/blob/1.2.2/library.properties#L2

version=1.2.2

For even more boring details, see the source code of the tool that creates it all here:

I did a lot of experimenting.

right now I'm at the point that if I make a copy of a portable installation
source directory
E:\22_02_26-Kopie-Vorlage
the copy will have the name
E:\22_02_26-Kopie-Vorlage - Kopie

with this copy it is still working to donwload and install libraries
but as soon as I change the root-foldername to have no spaces
rename from

E:\22_02_26-Kopie-Vorlage - Kopie
to
E:\22_02_26-Kopie-Vorlage-Kopie

The download-error occurs

very strange so far.
So next thing I test is copying the working portable folder using a batchfile and the command xcopy....
best regards Stefan

Still working fine for me using a portable installation under a path without spaces. Also using Windows.

Note that the library will only be downloaded once. After that, it is stored under the portable IDE installation here:

portable\staging\libraries\Arduino_Low_Power-1.2.2.zip

So this staged copy can give you some false results while testing download problems if you are not careful.

did you explicitly do the steps

  1. create a copy of a working portable installation
    question after this step: does your copy have spaces inside the foldername??
  2. rename the copy so the spaces are no longer there
  3. start Arduino-IDE
  4. activate manage libraries
  5. really install a not yet installed library

The error occurs only with 5.

can you please explicitly confirm these steps in the exact same way

Yes.

Yes: arduino-1.8.19 - Copy

Yes

Yes

Yes

Yes

No error occurs for me.

Are you able to consistently reproduce this thing where it works with spaces in the path and doesn't work without spaces in the path. These sorts of network issues can sometimes be intermittent, and so it is possible that it happened to work by chance the time you tried it with spaces in the path. But if you can repeatedly reproduce the working state with spaces and the non-working state without spaces, this does indicate a true correlation.

What does it mean to not beeing careful in this case?

I can't confirm yet copied name with spaces works removed spaces works not.
beyond that I want to do some more:

I have three batch-files that change the splash.png, the arduino.png and the theme.txt
because for easier distuingishing which instance of arduino-IDE belongs to which microcontroller one is "normal green" one is red one is yellow
maling the button-background red/yellow requires a change in theme.txt

The error ocured before I applied the batch-file. So it shouldn't have to do with that

will do some more testing...

The first time you install a library, the procedure goes like this:

  1. Download library .zip file to the portable\staging\libraries folder.
    This is the step where your error is occurring.
  2. Unzip library to the portable\sketchbook\libraries folder

Now if you deleted the library from the portable\sketchbook\libraries folder and tried the installation again, the procedure would go like this:

  1. Unzip library to the portable\sketchbook\libraries folder

The IDE sees that it already has the library downloaded to the staging folder, so it skips the download, and thus skips the step that is causing the error. That is not going to give you valid results when you are trying to test the download step.

Ok I understand. Thank you very much for explaining it.

Would it be possible if I delete several files library-index.json
the staging/zip-files
the files where the Arduino-IDE remembers which library-zipfiles were already downloaded
or whatever
would it be possible to make it work again this way?
best regards Stefan

Well, if you only want to make it work, I think you already found a workaround of using a path with spaces and can leave it at that.

But if you are interested in finding out why it doesn't work under some conditions, deleting those files can definitely be a useful investigative and experimental technique.

The Arduino IDE will automatically attempt to download the files if they are missing, so deleting them avoids the possible false results I mentioned, caused by using staged files instead of downloading them.

If you want to force a new library_index.json download, you should also delete the portable/cache folder. The IDE caches that file there, only re-downloading it when it has been some time (I don't remember the exact duration) since the cache was updated.

Hello everybody,

I have trouble with a portable installation of the 1.8.19 Arduino--IDE.
This portable installation has the "portable"-folder and all required subfolders.

This portable IDE works on my computer "A".
So I tried to copy it to my computer "B"
first step I copied it on a external USB-HDD

I tested If I could run the copy stored on the external USB-HDD.
This worked. Inlcuding the library-manager and successfully downloading libraries with the library-manager.
Then I copied this portable-IDE to computer "B". IDE starts but I'm unable to install libraries with the library-manager.

So I tested the copy stored on the external USB-HHD again.
The copy of the portable IDE on the external USB-HDD has the same problem
it is working in general but fails to download libraries by using the library-manager

To narrow down th eproblem further I "ejected" the external USB-HDD from computer "B" and connected it again to computer "A" again testing the library-manager: does work!

Next step: ejecting from computer "A" connecting again to computer "B"
I get an error. Screenshot


And here is what the console printed about the error:

 Error downloading https://downloads.arduino.cc/libraries/github.com/sparkfun/SparkFun_High_Precision_Temperature_Sensor_TMP117_Qwiic-1.2.4.zip
java.lang.RuntimeException: java.lang.Exception: Error downloading https://downloads.arduino.cc/libraries/github.com/sparkfun/SparkFun_High_Precision_Temperature_Sensor_TMP117_Qwiic-1.2.4.zip
	at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:250)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Error downloading https://downloads.arduino.cc/libraries/github.com/sparkfun/SparkFun_High_Precision_Temperature_Sensor_TMP117_Qwiic-1.2.4.zip
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:145)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:79)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:56)
	at cc.arduino.contributions.libraries.LibraryInstaller.performInstall(LibraryInstaller.java:148)
	at cc.arduino.contributions.libraries.LibraryInstaller.install(LibraryInstaller.java:118)
	at cc.arduino.contributions.libraries.LibraryInstaller.install(LibraryInstaller.java:110)
	at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:242)
	... 1 more
Caused by: java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:210)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975)
	at sun.security.ssl.SSLSocketImpl.waitForClose(SSLSocketImpl.java:1761)
	at sun.security.ssl.HandshakeOutStream.flush(HandshakeOutStream.java:124)
	at sun.security.ssl.Handshaker.kickstart(Handshaker.java:1079)
	at sun.security.ssl.SSLSocketImpl.kickstartHandshake(SSLSocketImpl.java:1479)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1346)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:162)
	at cc.arduino.utils.network.HttpConnectionManager.makeConnection(HttpConnectionManager.java:138)
	at cc.arduino.utils.network.HttpConnectionManager.makeConnection(HttpConnectionManager.java:96)
	at cc.arduino.utils.network.FileDownloader.openConnectionAndFillTheFile(FileDownloader.java:217)
	at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:176)
	at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:125)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:143)
	... 7 more

So the problem seems related to computer "B". But I have no idea what could cause this
because I'm using this computer "B" all the time for surfing, thunderbird email, accessing network-drives all successfully

Does the Arduino-IDE have any logfiles that I could look into to narrow down the problem?
Does anybody know of a logging-software that is able to log all network-traffic?

any hints and tips greatly appreciated.
best regards Stefan

Isn't it the same problem as already discussed here?:

Topics merged as requested by @StefanL38

Regards, Per

Hi @in0

Yes still have this problem and did more testing.
Copying libraries manually to the folder to see if the error occurs if a certain library or with a bigger number of libraries.

The error is not reprpducable with this. Somehow intermittend.

Confirming that it does work for you does not really help.
Do you know of any logfiles I can look up?
Do you know of any software that is able to log the details of how java is doing this network communication?

best regards Stefan

Try logging filesystem operations with Process Monitor or a similar tool.

Also check with a simple folder name - just couple numbers or letters from the standard 26 latin characters.

I have made quite a bit of effort in hopes I might be of some help with your problem. It seems that is not welcome so I'll desist after this reply and leave you to it.

The logging capability was removed in Arduino IDE 1.8.19 due to the problems with the Log4j logging framework and due to the fact that there wasn't any evidence of it being used:

You can get pretty much all the information you could want by running the Arduino IDE from the command line. Use the executable arduino_debug.exe instead of the arduino.exe you use normally.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.