SonarQubeAnalyze Task Download Failure on Azure Pipelines Hosted Agent
Issue Summary
Following the SonarQube extension update to version 8.2.1, the Azure Pipelines job initialization process encounters a critical failure during task download. The specific error encountered is:
##[error]Offset to Central Directory cannot be held in an Int64.
Problem Description
The pipeline’s “Initialize job” step, responsible for downloading required tasks, experiences a failure with the SonarQubeAnalyze task. Other tasks (PowerShell, UseNode, Cache, CmdLine, SonarQubePrepare, PublishTestResults) download successfully without error.
Environment Details
- Agent Type: Azure Pipelines Hosted Agent
- Image: windows-2025
- Extension for Azure DevOps Version: 8.2.1
- Affected Task: SonarQubeAnalyze
Root Cause Analysis
The error manifests during the extraction phase of the downloaded SonarQubeAnalyze task zip archive. This indicates a potential issue with either:
- Archive corruption during the download process
- Archive size exceeding the capacity limits of the .NET ZipArchive class implementation
- Incompatibility between the task archive format and the extraction mechanism
The error stack trace points to the System.IO.Compression.ZipArchive class, which is responsible for handling zip file operations. The specific exception suggests that the archive’s central directory offset exceeds the maximum value that can be represented by an Int64, which may indicate a malformed or excessively large archive. As SonarQube Extension for Azure DevOps was recently updated, it’s possible that the new version of the SonarQubeAnalyze task has introduced changes that affect the archive structure or size, leading to this extraction failure, hence I reach out to you instead of Microsoft support. The Task SonarQubeAnalyze@7 does not have this error.
Starting: Initialize job
...
Current agent version: '4.271.0'
Runner Image Provisioner
Hosted Compute Agent
Version: 20260213.493
Commit: 5c115507f6dd24b8de37d8bbe0bb4509d0cc0fa3
Build Date: 2026-02-13T00:28:41Z
Worker ID: {d98664cb-0d1a-4c1c-ab1f-549398f8eeb2}
Azure Region: westeurope
_internal_runner_telemetry
ProcessLifetimeId: f043ec5f-779e-48a0-8bca-7b6de1963b5c
Azure Region: westeurope
Operating System
Microsoft Windows Server 2025
10.0.26100
Datacenter
Runner Image
Image: windows-2025
Version: 20260405.77.1
Included Software: https://github.com/actions/runner-images/blob/win25/20260405.77/images/windows/Windows2025-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/win25%2F20260405.77
Current image version: '20260405.77.1'
Agent running as: 'VssAdministrator'
...
Prepare build directory.
...
Set build variables.
Download all required tasks.
Downloading task: PowerShell (2.268.1)
##[debug]Task 'PowerShell' has been downloaded into 'D:\a\_tasks\PowerShell_e213ff0f-5d5c-4791-802d-52ea3e7be1f1\2.268.1'.
Downloading task: UseNode (1.268.0)
##[debug]Task 'UseNode' has been downloaded into 'D:\a\_tasks\UseNode_31c75bbb-bcdf-4706-8d7c-4da6a1959bc2\1.268.0'.
Downloading task: Cache (2.198.0)
##[debug]Task 'Cache' has been downloaded into 'D:\a\_tasks\Cache_d53ccab4-555e-4494-9d06-11db043fb4a9\2.198.0'.
Downloading task: CmdLine (2.268.0)
##[debug]Task 'CmdLine' has been downloaded into 'D:\a\_tasks\CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9\2.268.0'.
Downloading task: SonarQubePrepare (8.2.1)
##[debug]Task 'SonarQubePrepare' has been downloaded into 'D:\a\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\8.2.1'.
Downloading task: PublishTestResults (2.270.0)
##[debug]Task 'PublishTestResults' has been downloaded into 'D:\a\_tasks\PublishTestResults_0b0f01ed-7dde-43ff-9cbb-e48954daf9b1\2.270.0'.
Downloading task: SonarQubeAnalyze (8.2.1)
##[error]Offset to Central Directory cannot be held in an Int64.
##[debug]System.IO.InvalidDataException: Offset to Central Directory cannot be held in an Int64.
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)
at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding)
at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Encoding entryNameEncoding, Boolean overwriteFiles)
at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.ExtractZip(String zipFile, String destinationDirectory) in D:\a\_work\1\s\src\Agent.Worker\TaskManager.cs:line 464
at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, TaskStepDefinitionReference task) in D:\a\_work\1\s\src\Agent.Worker\TaskManager.cs:line 307
at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, IEnumerable`1 steps) in D:\a\_work\1\s\src\Agent.Worker\TaskManager.cs:line 90
at Microsoft.VisualStudio.Services.Agent.Worker.JobExtension.InitializeJob(IExecutionContext jobContext, AgentJobRequestMessage message) in D:\a\_work\1\s\src\Agent.Worker\JobExtension.cs:line 173
Finishing: Initialize job