question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\home\site\wwwroot\runtimes\unix\'.

See original GitHub issue

Bug Description First of all, Thanks for the great application. Unfortunately I am unable to deploy successfully. The ARM template deployment step gives the following error.

.\Deploy.ps1 -WebAppNamePrefix “XXXXXXXX” -TenantID “XXXXXX” -ADApplicationID “XXXXX” -ADApplicationSecret “XXXXX” -SQLServerName “XXXXX” -SQLAdminLogin “XXXXXX” -SQLAdminLoginPassword “XXXXX” -PublisherAdminUsers “XXXXXXX” -BacpacUrl “someurl” -ResourceGroupForDeployment “XXXXX” -Location “East US” -AzureSubscriptionID “XXXXX” -PathToARMTemplate “\path\to\deploy.json”

(actual values masked for security)

Package deployment failed AppGallery Deploy Failed: 'System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\home\site\wwwroot\runtimes\unix\'. at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath) at Microsoft.Web.Deployment.FileStreamEx.CreateInstance(String path, FileMode fileMode, FileAccess fileAccess, FileShare fileShare, Nullable 1 fileLength) at Microsoft.Web.Deployment.FilePathProviderBase.Add(DeploymentObject source, Boolean whatIf) at Microsoft.Web.Deployment.DeploymentObject.AddChild(DeploymentObject source, Int32 position, DeploymentSyncContext syncContext) at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAddChild(DeploymentObject destParent, DeploymentObject sourceObject, Int32 position) at Microsoft.Web.Deployment.DeploymentSyncContext.SyncDirPathChildren(DeploymentObject destRoot, DeploymentObject sourceRoot) at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source) at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest, DeploymentObject source) at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source) at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source) at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildren(DeploymentObject dest, DeploymentObject source) at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject) at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable1 syncPassId, String syncSessionId) at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions) at Microsoft.Web.Deployment.DeploymentObject.SyncTo(String provider, String path, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions) at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentWellKnownProvider provider, String path, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions) at Microsoft.Web.Deployment.WebApi.AppGalleryPackage.Deploy(String deploymentSite, String siteSlotId, Boolean doNotDelete) at Microsoft.Web.Deployment.WebApi.DeploymentController.<DownloadAndDeployPackage>d__24.MoveNext()' Package deployment failed

To Reproduce Follow step by step the instructions provided. In the end, the deploy step always fails with the error above. I have tried removing the entire resource group and rerunning the whole script. The script fails at the point where it says “Deploying the ARM template to set up resources”

Expected behavior All resources should be deployed successfully without any errors.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Browser - Chrome
  • Version 83.0.4103.116 (Official Build) (64-bit)

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dev-kiranbandacommented, Jul 24, 2020

Hi all,

Sorry for the delay in getting to this.

I had faced this issue myself when I created the ARM template and the powershell script.

Please note the Note in the installation instructions:

Note: Make sure that you are using the latest Powershell to avoid issues in Compress-Archive in 5.1 that got resolved in latest version.

You need to have the right Powershell installed and make sure that you are opening the Powershell command window that corresponds to the latest version. This is a step that is commonly missed and this is the cause for the behavior that you have.

The issue is due to the difference in the path separator between Windows and Unix / Linux.

Please give it a try and keep me posted.

Regards, Kiran Banda

0reactions
yurychcommented, Jul 8, 2022

It turns out New-AzureServiceRollout is not an issue. Ev2 CLI and Ev2 SDK have the same problem in powershell 5.x because Compress-Archive in poweshell 5.x works differently than in poweshell 7.x. If I create a zip archive in powershell 7.x and then use New-AzureServiceRollout in powershell 5.x or simply use Ev2 SDK console app to start a rollout, the rollout succeeds.

P.S. Just noticed that Compress-Archive issue was already mentioned in an earlier comment

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting a "Could not find a part of the path ...
This may be because, you are not having the specified file in web server, or you may be used an incorrect path. Specify...
Read more >
System.IO.DirectoryNotFoundException Could Not Find A ...
Create a folder called 'Temp' under the communicator web service's publishing directory. The default location for the publishing directory is 'C ...
Read more >
'Could not find a part of the path '/C:\'.' in Xamarin
I keep gettin this error: System.IO.DirectoryNotFoundException: 'Could not find a part of the path '/C:\'.' not sure why. Here is the code
Read more >
Could not find a part of the path (System.IO. ...
When UiPath executes the Copy File activity, it throws an error saying that it couldn't find a part of the path specified.
Read more >
"System.IO.DirectoryNotFoundException: 'Could not find a ...
“Error: Could not find a part of the path” after update of .Net.Test.SDK from 16.6.1 to 16.7.0 version. I use “bin\Debug\netcoreapp3.1” project ...
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