{"record":{"id":"a42ea6dde31f8f3f","repo":"arduino/Arduino","slug":"archive-format-not-supported","errorCode":null,"errorMessage":"Archive format not supported.","messagePattern":"Archive format not supported\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"arduino-core/src/cc/arduino/utils/ArchiveExtractor.java","lineNumber":107,"sourceCode":"    // (because creating a file in a folder alters the folder's timestamp)\n    Map<File, Long> foldersTimestamps = new HashMap<>();\n\n    ArchiveInputStream in = null;\n    try {\n\n      // Create an ArchiveInputStream with the correct archiving algorithm\n      if (archiveFile.getName().endsWith(\"tar.bz2\")) {\n        in = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(archiveFile)));\n      } else if (archiveFile.getName().endsWith(\"zip\")) {\n        in = new ZipArchiveInputStream(new FileInputStream(archiveFile));\n      } else if (archiveFile.getName().endsWith(\"tar.gz\")) {\n        in = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(archiveFile)));\n      } else if (archiveFile.getName().endsWith(\"tar.xz\")) {\n        in = new TarArchiveInputStream(new XZCompressorInputStream(new FileInputStream(archiveFile)));\n      } else if (archiveFile.getName().endsWith(\"tar\")) {\n        in = new TarArchiveInputStream(new FileInputStream(archiveFile));\n      } else {\n        throw new IOException(\"Archive format not supported.\");\n      }\n\n      String pathPrefix = \"\";\n\n      Map<File, File> hardLinks = new HashMap<>();\n      Map<File, Integer> hardLinksMode = new HashMap<>();\n      Map<File, String> symLinks = new HashMap<>();\n      Map<File, Long> symLinksModifiedTimes = new HashMap<>();\n\n      // Cycle through all the archive entries\n      while (true) {\n        ArchiveEntry entry = in.getNextEntry();\n        if (entry == null) {\n          break;\n        }\n\n        // Extract entry info\n        long size = entry.getSize();","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/arduino/Arduino/blob/a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee/arduino-core/src/cc/arduino/utils/ArchiveExtractor.java#L89-L125","documentation":"ArchiveExtractor.extract supports gzip-compressed tar (tar.gz/tgz), xz-compressed tar, and plain tar archives. If the archive file's name matches none of those suffixes, it throws this IOException. The format detection is purely filename-extension based; there is no content sniffing.","triggerScenarios":"extract() is called with a file whose name does not end in .tar.gz/.tgz, .tar.xz, or .tar — e.g. a .zip file, a .7z, or a tarball with an unusual/missing extension.","commonSituations":"Library Manager downloading an archive in an unsupported format (zip instead of tar.gz); a library author packaging releases as zip; an archive renamed so its extension no longer reflects its format.","solutions":["Repackage the library/archive as a .tar.gz (or .tar/.tar.xz) archive with the correct extension","Rename the file to match its actual format if it is truly a tar-family archive (e.g. add the missing .tar.gz suffix)","For zip archives, extract with an unzip tool first and install the folder manually into the libraries/ directory"],"exampleFix":"// before\nnew ArchiveExtractor().extract(tempFile, destDir, 1); // tempFile = mylib.zip\n// after\nnew ArchiveExtractor().extract(new File(\"mylib.tar.gz\"), destDir, 1);","handlingStrategy":"validation","validationCode":"String n = archiveFile.getName();\nboolean supported = n.endsWith(\".tar.gz\") || n.endsWith(\".tgz\") || n.endsWith(\".tar.xz\") || n.endsWith(\".tar\");\nif (!supported) throw new IllegalArgumentException(\"Repackage as tar.gz before extracting: \" + n);","typeGuard":null,"tryCatchPattern":"try { extractor.extract(archive, dest, 1); } catch (IOException e) { if (e.getMessage().contains(\"Archive format not supported\")) { convertOrUnzipManually(archive, dest); } else { throw e; } }","preventionTips":["Always publish libraries as .tar.gz with correct extension","Never rename archives without adjusting the extension","Pre-check archive format (e.g. `file archive.gz`) before extraction"],"tags":["archive","unsupported-format","io","arduino"],"backgroundTag":"unsupported-operation","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"}