30

I have an Azure web app that I'm deploying from VSTS. This was working fine previously but is now returning with the following:

2018-08-07T14:24:57.1655319Z Info: Adding directory (dsadminportal-dev\wwwroot\assets\css\plugins\datapicker).

2018-08-07T14:24:58.2654020Z ##[error]Failed to deploy web package to App Service.

2018-08-07T14:24:58.2665943Z ##[error] Error: (8/7/2018 2:24:57 PM) An error occurred when the request was processed on the remote computer.

Error: An error was encountered when processing operation 'Create Directory' on 'D:\home\site\wwwroot\wwwroot\assets\css\plugins\datapicker'. Error: The error code was 0x800703E6. Error: Invalid access to memory location.

at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath) at Microsoft.Web.Deployment.FileSystemInfoEx.set_Attributes(FileAttributes value) at Microsoft.Web.Deployment.DirPathProviderBase.Add(DeploymentObject source, Boolean whatIf) Error count: 1.

This is to a slot. I deleted the slot and recreated it and it deployed fine first time but subsequent deploys fail with the above error.

Any ideas what this means?

Thanks

ADringer
  • 2,614
  • 36
  • 63
  • Strange. Probably some process run while you deploy there? Autoswap? Did you check Activity Log for that web site? Also you can skip dirs as per this https://stackoverflow.com/questions/12368655/msdeploy-and-skip-directories-not-named-x – Artyom Aug 08 '18 at 10:20
  • The site is currently stopped during the deploy (I run a VSTS task to stop the slot). Don't think it can log if the site isn't running? I don't want to start skipping dirs till I know what the issue is – ADringer Aug 08 '18 at 12:32
  • I am having a similar issue: `2018-08-20T09:18:17.2950455Z Info: Updating file (App\.vs10x). 2018-08-20T09:18:19.0855891Z ##[error]Failed to deploy web package to App Service. 2018-08-20T09:18:19.0868022Z ##[error]Error: (8/20/2018 10:18:17 AM) An error occurred when the request was processed on the remote computer.` – Vinyl Warmth Aug 20 '18 at 09:23
  • I ran into the exactly the same issue when publishing an Azure Function from within Visual Studio and the accepted answer solved it for me. – Josh Gallagher Oct 23 '18 at 17:25

3 Answers3

64

I found that as a workaround, publishing through the option "Run from ZIP" through the manual publishing dialog was working. But that option i think is not yet available from a VSTS task.

Solution: I finally found out, that the workaround was actually causing the issue! After deploying through ZIP, the function app setting WEBSITE_RUN_FROM_PACKAGE (formerly called WEBSITE_RUN_FROM_ZIP) was created. This was actually breaking deployment through web deploy! Deleting the setting was fixing the issue.

see: https://azureappservices.blogspot.com/2018/08/409-conflict-could-not-write-to-local.html

poke
  • 369,085
  • 72
  • 557
  • 602
Markus S.
  • 2,602
  • 13
  • 44
  • Thanks, it helped! In the Azure Functions v2 this setting is called: "WEBSITE_RUN_FROM_PACKAGE" – Pawel Maga Nov 07 '18 at 09:13
  • @PawelMaga Thanks for the hint. The name of the setting changed, so i updated the solution. – Markus S. Nov 07 '18 at 09:22
  • 2
    This only worked for me when I explicitly did not choose to deploy from package when clicking on Publish in VS in addition to deleting the WEBSITE_RUN_FROM_PACKAGE setting (from application settings in the Azure portal). – Sirar Salih Dec 27 '18 at 11:52
6

VSTS build is now with version 4 automatically "run from zip". Make sure you select web deploy in vsts, and remove any WEBSITE_RUN_FROM_ZIP in application settings. If it still doesn't work, recreate web service...

sensei
  • 7,044
  • 10
  • 57
  • 125
0

Fix option: Open the same project using VS 2022 and publish again.

Problem: I was trying to publish on Azure using 2019, I started seeing 'Invalid memory location' out of nowhere, I checked for length of folders like some suggested, cleaned bin and obj folders, closed and re-open VS, reset computer and I got the same errors. Opening the project in VS 2022 did it for me, good luck.