{"record":{"id":"fda3eddc60fdd010","repo":"arduino/Arduino","slug":"error-downloading-0","errorCode":null,"errorMessage":"Error downloading {0}","messagePattern":"Error downloading (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"arduino-core/src/cc/arduino/contributions/DownloadableContributionsDownloader.java","lineNumber":145,"sourceCode":"  }\n\n  public void download(URL url, File tmpFile, Progress progress, String statusText, ProgressListener progressListener, boolean noResume, boolean allowCache) throws Exception {\n    final FileDownloader downloader = new FileDownloader(url, tmpFile, allowCache);\n    downloader.addObserver((o, arg) -> {\n      FileDownloader me = (FileDownloader) o;\n      String msg = \"\";\n      if (me.getDownloadSize() != null) {\n        long downloaded = (me.getInitialSize() + me.getDownloaded()) / 1000;\n        long total = (me.getInitialSize() + me.getDownloadSize()) / 1000;\n        msg = format(tr(\"Downloaded {0}kb of {1}kb.\"), downloaded, total);\n      }\n      progress.setStatus(statusText + \" \" + msg);\n      progress.setProgress(me.getProgress());\n      progressListener.onProgress(progress);\n    });\n    downloader.download(noResume);\n    if (!downloader.isCompleted()) {\n      throw new Exception(format(tr(\"Error downloading {0}\"), url), downloader.getError());\n    }\n  }\n\n  public void downloadIndexAndSignature(MultiStepProgress progress, URL packageIndexUrl, ProgressListener progressListener, SignatureVerifier signatureVerifier) throws Exception {\n    // Extract the file name from the url\n    final String indexFileName = FilenameUtils.getName(packageIndexUrl.getPath());\n    final File packageIndex = BaseNoGui.indexer.getIndexFile(indexFileName);\n\n    final String statusText = tr(\"Downloading platforms index...\");\n\n    // Create temp files\n    final File packageIndexTemp = File.createTempFile(indexFileName, \".tmp\");\n    try {\n      // Download package index\n      download(packageIndexUrl, packageIndexTemp, progress, statusText, progressListener, true, true);\n      final URL signatureUrl = new URL(packageIndexUrl.toString() + \".sig\");\n\n      if (verifyDomain(packageIndexUrl)) {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/arduino/Arduino/blob/a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee/arduino-core/src/cc/arduino/contributions/DownloadableContributionsDownloader.java#L127-L163","documentation":"download() wraps the underlying DownloadableContributionsAwareDownloader; after calling downloader.download(noResume) it checks isCompleted(). If the downloader did not finish successfully, it throws an Exception including the URL and the downloader's captured error as the cause.","triggerScenarios":"download() is called and the underlying HTTP downloader finishes without completing the transfer (connection dropped, server error, no resume possible), so downloader.isCompleted() returns false and downloader.getError() is non-null.","commonSituations":"Server returning 404/403 for an outdated package URL; TLS or proxy failures; network timeouts on large archives; a mirror that does not support HTTP range requests when resuming.","solutions":["Inspect the cause (downloader.getError()) to find the real network/HTTP failure and address it (fix URL, proxy, credentials).","Retry the download — transient network issues are the most common cause.","Update the package index so the contribution's URL points to a still-hosted archive.","Download the archive manually in a browser to confirm server availability, then clear staging and retry via the IDE."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { downloader.download(c, progress, status, listener, false, true); } catch (Exception e) { Throwable cause = e.getCause(); log(\"Download failed for \" + c.getUrl() + \": \" + cause); backoffAndRetry(); }","preventionTips":["Keep the package index updated so URLs are current.","Log and inspect the cause for the actual HTTP/network failure.","Check proxy/TLS configuration for corporate networks."],"tags":["arduino","download","network","http"],"backgroundTag":"http-request-failed","analyzedSha":"a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee","analyzedAt":"2026-09-06T10:13:38.901Z","contentChangedAt":"2026-09-06T10:13:38.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}