Azure-functions-core-tools: Unable to publish function: "There is not enough space on the disk"

Created on 13 May 2020  路  3Comments  路  Source: Azure/azure-functions-core-tools

I've successfully published my functionapp to Azure Functions. I modified the AuthorizationLevel property, and attempted to deploy again with the following command:

func azure functionapp publish myfunctionapp

The deployment failed, with the following output:

Microsoft (R) Build Engine version 16.6.0-preview-20222-04+b4f75bf75 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
  MyFunctionApp-> C:\Users\Dylan\Desktop\myfunctionapp\bin\publish\bin\MyFunctionApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.54


Getting site publishing info...
Creating archive for current directory...
Uploading 373.95 MB [#############################################################################]
Creating archive for current directory...
Uploading 373.95 MB [#############################################################################]
Creating archive for current directory...
Uploading 373.95 MB [#############################################################################]
Error uploading archive (InternalServerError).
Server Response: {"Message":"An error has occurred.","ExceptionMessage":"There is not enough space on the disk.\r\n[...snip...]


Full error message


Error uploading archive (InternalServerError).
Server Response: {"Message":"An error has occurred.","ExceptionMessage":"There is not enough space on the disk.\r\n","ExceptionType":"System.IO.IOException","StackTrace":"   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)\r\n   at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()\r\n   at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile)\r\n   at System.Web.HttpRawUploadedContent.TempFile..ctor()\r\n   at System.Web.HttpRawUploadedContent.AddBytes(Byte[] data, Int32 offset, Int32 length)\r\n   at System.Web.HttpBufferlessInputStream.EndRead(IAsyncResult asyncResult)\r\n   at System.IO.Stream.<>c.b__43_1(Stream stream, IAsyncResult asyncResult)\r\n   at System.Threading.Tasks.TaskFactory`1.FromAsyncTrimPromise`1.Complete(TInstance thisRef, Func`3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.WebHost.SeekableBufferedRequestStream.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Services.ByteRanges.HttpRequestMessageExtensions.d__1.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Services\\ByteRanges\\HttpRequestMessageExtensions.cs:line 55\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Services.Deployment.PushDeploymentController.d__19.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Services\\Deployment\\PushDeploymentController.cs:line 446\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at Kudu.Services.Deployment.PushDeploymentController.d__12.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Services\\Deployment\\PushDeploymentController.cs:line 203\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kudu.Services.Deployment.PushDeploymentController.d__8.MoveNext() in C:\\Kudu Files\\Private\\src\\master\\Kudu.Services\\Deployment\\PushDeploymentController.cs:line 95\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Threading.Tasks.TaskHelpersExtensions.d__3`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack 
trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"}

This function is on a consumption plan, and it's my understanding that I have 5TB of available storage to use, so 373 MB shouldn't be triggering an out-of-space error.

Trying to manually deploy a zip file also fails:

PS > az functionapp deployment source config-zip -g nameof-rg -n appname --src .\bin\publish\publish.zip
Setting SCM_DO_BUILD_DURING_DEPLOYMENT to false
Waiting SCM site to be updated with the latest app settings
Getting scm site credentials for zip deployment
Starting zip deployment. This operation can take a while to complete ...
Deployment endpoint responded with status code 500

I think this has something to do with the size of the deployment. My publish folder contains a folder with about 1 GB of binary assets. If I delete the folder, reducing the publish folder to about 2 MB, the function publishes without any issue.

Needs

Most helpful comment

Ah, I definitely saw that, but the footnote really confused me.

The storage limit is the total content size in temporary storage across all apps in the same App Service plan. Consumption plan uses Azure Files for temporary storage.

I guess I got confused thinking that the available storage in my storage account is what mattered. Furthermore, the portal says the following:

This App Service Plan (ASP) contains a Function app running on Consumption plan. Azure files are used for storage, please navigate to the Function app storage account to view usage.

This made me think even more that it was the storage of my storage account that really mattered.

As a potential action item, I think it'd be great if the CLI detected when the publish directory exceeds the maximum storage space for a given plan, and prints a nice, helpful error message along the line of:

Deployment failed: Project directory is 1.2 GB which exceeds the maximum allowed storage for the consumption plan.

All 3 comments

@dstaley The storage capacity for consumption plan is 1GB. Looks like you might be hitting that. https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits

Ah, I definitely saw that, but the footnote really confused me.

The storage limit is the total content size in temporary storage across all apps in the same App Service plan. Consumption plan uses Azure Files for temporary storage.

I guess I got confused thinking that the available storage in my storage account is what mattered. Furthermore, the portal says the following:

This App Service Plan (ASP) contains a Function app running on Consumption plan. Azure files are used for storage, please navigate to the Function app storage account to view usage.

This made me think even more that it was the storage of my storage account that really mattered.

As a potential action item, I think it'd be great if the CLI detected when the publish directory exceeds the maximum storage space for a given plan, and prints a nice, helpful error message along the line of:

Deployment failed: Project directory is 1.2 GB which exceeds the maximum allowed storage for the consumption plan.

I got the same issue, while deploying Azure function (~250Mb zip) from the release pipeline. Some nicely formatted message would be good. Deployment just returns:

Error: Failed to deploy web package to App Service. Internal Server Error (CODE: 500)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MattHoneycutt picture MattHoneycutt  路  4Comments

brandonh-msft picture brandonh-msft  路  4Comments

buragc picture buragc  路  6Comments

nebosite picture nebosite  路  3Comments

AssassinTee picture AssassinTee  路  3Comments