{"record":{"id":"b54ad8bca00bd7e0","repo":"oraios/serena","slug":"unknown-archive-type-archive-type","errorCode":null,"errorMessage":"Unknown archive type '{archive_type}'","messagePattern":"Unknown archive type '(.+?)'","errorType":"exception","errorClass":"SolidLSPException","httpStatus":null,"severity":"error","filePath":"src/solidlsp/ls_utils.py","lineNumber":537,"sourceCode":"                tmp_file_name_ungzipped = tmp_file_name + \".zip\"\n                with gzip.open(tmp_file_name, \"rb\") as f_in, open(tmp_file_name_ungzipped, \"wb\") as f_out:\n                    shutil.copyfileobj(f_in, f_out)\n                FileUtils._extract_zip_archive(tmp_file_name_ungzipped, target_path)\n            elif archive_type == \"gz\":\n                target_directory = os.path.dirname(target_path) or \".\"\n                os.makedirs(target_directory, exist_ok=True)\n                temp_output_path = str(PurePath(target_directory, f\".{Path(target_path).name}.{uuid.uuid4().hex}.extract\"))\n                external_tmp_files.append(temp_output_path)\n                with gzip.open(tmp_file_name, \"rb\") as f_in, open(temp_output_path, \"wb\") as f_out:\n                    shutil.copyfileobj(f_in, f_out)\n                os.replace(temp_output_path, target_path)\n            elif archive_type == \"binary\":\n                target_directory = os.path.dirname(target_path) or \".\"\n                os.makedirs(target_directory, exist_ok=True)\n                shutil.move(tmp_file_name, target_path)\n            else:\n                log.error(f\"Unknown archive type '{archive_type}' for extraction\")\n                raise SolidLSPException(f\"Unknown archive type '{archive_type}'\")\n        except Exception as exc:\n            log.error(f\"Error extracting archive obtained from '{url}': {exc}\")\n            raise SolidLSPException(\"Error extracting archive.\") from exc\n        finally:\n            # cleaning up any temporary files outside the temporary directory\n            for tmp_file in external_tmp_files:\n                if os.path.exists(tmp_file):\n                    Path.unlink(Path(tmp_file))\n\n            # removing the temporary directory\n            if tmp_dir is not None:\n                shutil.rmtree(tmp_dir, ignore_errors=True)\n\n    @staticmethod\n    def calculate_sha256(file_path: str) -> str:\n        \"\"\"\n        Calculates the SHA256 checksum of a file.\n        \"\"\"","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/ls_utils.py#L519-L555","documentation":"Raised by download_and_extract_archive_verified when the archive_type argument is neither a recognized archive format (zip, tar.*) nor \"binary\". The library cannot know how to extract an unclassified file, so it aborts the whole download/extract operation and wraps this in a generic SolidLSPException(\"Error extracting archive.\") which is what callers usually see.","triggerScenarios":"Calling download_and_extract_archive_verified (directly or via download_to, _install_from_url, _download_nuget_package, _setup_runtime_dependencies, etc.) with archive_type set to a value other than \"binary\" or a supported archive extension, e.g. a typo like \"zip\" vs an unrecognized extension or an empty string.","commonSituations":"Configuring a custom language-server download URL whose file extension is not in the extractor's mapping (e.g. .tgz spelled oddly, .pkg, no extension at all); a server redirects to an HTML error page saved with an unknown name.","solutions":["Check the archive_type value passed by the code path you control; use \"binary\" if the file is not an archive, or a supported archive type string","Verify the downloaded file actually has the expected extension/format; a failed download often yields a non-archive file","If you own the download URL, rename the artifact to use a recognized extension (.zip, .tar.gz)"],"exampleFix":"// before\ndownload_and_extract_archive_verified(url, target, archive_type=\"zipfile\")\n// after\ndownload_and_extract_archive_verified(url, target, archive_type=\"zip\")","handlingStrategy":"validation","validationCode":"SUPPORTED = {\"zip\", \"tar\", \"tar.gz\", \"tar.bz2\", \"binary\"}\nif archive_type not in SUPPORTED:\n    raise ValueError(f\"archive_type must be one of {SUPPORTED}, got {archive_type!r}\")","typeGuard":"def is_valid_archive_type(t: str) -> bool:\n    return t in {\"zip\", \"tar\", \"tar.gz\", \"tar.bz2\", \"binary\"}","tryCatchPattern":"try:\n    download_and_extract_archive_verified(url, target, archive_type=archive_type)\nexcept SolidLSPException as e:\n    logger.error(\"download/extract failed: %s\", e.__cause__)\n    raise","preventionTips":["Pass archive_type literally as \"binary\" for non-archive files","Use file extensions from the library's recognized set","Log the URL and final filename to spot unexpected artifacts"],"tags":["download","archive","configuration"],"backgroundTag":"unknown-archive-type","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}