Deploying a Function App from Azure Devops results in Offset to Central Directory cannot be held in an Int64.

See original GitHub issue

Repro steps.

We have an Azure DevOps CICD pipeline that deploys a function app to an elastic windows app service plan with 10 instances. From time to time, we get this error message : Offset to Central Directory cannot be held in an Int64. Bellow are the details of the error log as obtained from azure.

The log/error given by the failure.

<step title="BackgroundTrace" date="2021-12-21T14:27:07.673" instance="5b00b5" url="/api/zipdeploy" method="POST">
<step title="Updating shutdown sentinel last write time" date="2021-12-21T14:27:07.720" SemaphoreCount="7"/>
<!--  duration: 16ms  -->
<step title="LockFile 'C:\home\site\locks\deployments.lock' acquired" date="2021-12-21T14:27:07.751"/>
<!--  duration: 31ms  -->
<step title="Creating temporary deployment" date="2021-12-21T14:27:07.798"/>
<!--  duration: 156ms  -->
<step title="Performing fetch based deployment" date="2021-12-21T14:27:07.985"/>
<!--  duration: 719ms  -->
<step title="LockFile 'C:\home\site\locks\deployments.lock' released" date="2021-12-21T14:27:08.735"/>
<!--  duration: 16ms  -->
<step title="Deleting shutdown sentinel file" date="2021-12-21T14:27:08.782" SemaphoreCount="8"/>
<!--  duration: 31ms  -->
<step title="Error occurred" date="2021-12-21T14:27:08.860" type="error" text="One or more errors occurred." stackTrace=" at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Kudu.Core.Deployment.FetchDeploymentManager.<>c__DisplayClass11_1.<PerformBackgroundDeployment>b__3() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 399 at Kudu.Contracts.Infrastructure.LockExtensions.TryLockOperation(IOperationLock lockObj, Action operation, String operationName, TimeSpan timeout) in C:\Kudu Files\Private\src\master\Kudu.Contracts\Infrastructure\LockExtensions.cs:line 34 at Kudu.Contracts.Infrastructure.LockExtensions.LockOperation(IOperationLock lockObj, Action operation, String operationName, TimeSpan timeout) in C:\Kudu Files\Private\src\master\Kudu.Contracts\Infrastructure\LockExtensions.cs:line 46 at Kudu.Core.Deployment.FetchDeploymentManager.<>c__DisplayClass11_0.<PerformBackgroundDeployment>b__1() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 383" innerText="Offset to Central Directory cannot be held in an Int64." innerStackTrace=" at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen) 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 Kudu.Services.Deployment.PushDeploymentController.ExtractTriggers(IRepository repository, ArtifactDeploymentInfo deploymentInfo) in C:\Kudu Files\Private\src\master\Kudu.Services\Deployment\PushDeploymentController.cs:line 553 at Kudu.Services.Deployment.PushDeploymentController.<LocalZipHandler>d__14.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Services\Deployment\PushDeploymentController.cs:line 539 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Kudu.Core.Deployment.FetchDeploymentManager.<PerformDeployment>d__9.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 181 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Kudu.Core.Deployment.FetchDeploymentManager.<PerformDeployment>d__9.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 295"/>
<!--  duration: 16ms  -->
</step>
<!--  duration: 1219ms  -->

Debug your Azure website remotely.

App name: func-acq…ite-qa-01 We can provide more details if needed.

Mention any other details that might be useful.

Seems like a random error that happens often when the approval on the deployment stage is performed hours after the build was initially kicked.

Azure Devops Task Details: `

          - task: AzureFunctionApp@1
            displayName: 'Deploy function app'
            inputs:
              appType: functionApp
              appName: $(tfOut.function_name)
              azureSubscription: ${{ variables.subscription }}
              package:  ${{ variables.artifactPath }}
              deploymentMethod: runFromPackage

`

Tried also using deploymentMethod auto and runFromZip but nothing changed.

The generated package size does not exceed 20mb.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:12

github_iconTop GitHub Comments

3reactions
John-Boschcommented, May 12, 2022

This issue is making me seriously consider other technologies for our integration services. 5 out of 6 attempts at deployment have failed this morning because of this exact problem.

Disconnecting via the deployment centre hasn’t helped. Nor did completely deleting and recreating the function. Eventually, it just worked … randomly.

2reactions
jwidmercommented, Apr 29, 2022

Check in Azure if your App Service or Function App is set up under Deployment Center. We had originally set up the build pipeline and release pipeline through the Azure Deployment Center. Then when we tried to create a new release pipeline to the same app service we ended up with the error:

Offset to Central Directory cannot be held in an Int64.
Error: Failed to deploy web package to App Service.
Error: To debug further please check Kudu stack trace URL
Error: Package deployment using ZIP Deploy failed. Refer logs for more details.

The solution is to go into Azure Portal > App Service (or deployment slot) > Deployment Center and then Disconnect your app.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code deployment error: "Offset to Central Directory ...
When the web app is running I get the following error: "Offset to Central Directory cannot be held in an Int64", but if...
Read more >
Offset to Central Directory cannot be held in an Int64
Open started to generate "Offset to Central Directory cannot be held in an Int64". The zip file is valid and the code used...
Read more >
Azure App Service Web App Deploy from VScode &quot
Then when we tried to create a new release pipeline to the same app service we ended up with the error: Offset to...
Read more >
Troubleshooting Node.js deployments on App Service Linux -
Offset to Central Directory cannot be held in an Int64. The zip file received by deployment engine was corrupt because of the stream...
Read more >
Untitled
Deploying a Function App from Azure Devops results in Offset to Central ... Central Directory Corrupt deploying Python Azure function ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found