Deployment errorOperationStopped: Virtual path "IIS:\Sites..." does not exist

I’m getting an error when trying to deploy to an api as a web application with a virtual directory to our staging environment. Though I had no problem deploying to our development environment
Please help.
Below is the deployment log for the staging environment. I replace specific app and dir names with generic names

The step failed: Activity Deploy web app to IIS on non-local environments on i-066b63049405c9c8e failed with error ‘The remote script failed with exit code 1’.
i-066b63049405c9c8e
Ran for 7 seconds
August 4th 2020 10:45:08Info
Deploying package: D:\Octopus\Files\SomeAPI@S1.0.22@B66DEFD9ACB96B41B8269997C6ED289E.nupkg
August 4th 2020 10:45:11Info
No matching appSetting, applicationSetting, nor connectionString names were found in: D:\Octopus\Applications\Stage\SomeAPI\1.0.22_4\log4net.config
August 4th 2020 10:45:11Info
No matching appSetting, applicationSetting, nor connectionString names were found in: D:\Octopus\Applications\Stage\SomeAPI\1.0.22_4\web.config
August 4th 2020 10:45:11Info
Performing JSON variable replacement on ‘D:\Octopus\Applications\Stage\SomeAPI\1.0.22_4\appsettings.json’
August 4th 2020 10:45:11Info
Purging the directory ‘D:\wwwroot\someLocalDirectory\Some-API\2.0.0’
August 4th 2020 10:45:11Info
Leaving files and directories that match any of: ‘web.config’
August 4th 2020 10:45:11Info
Copying package contents to ‘D:\wwwroot\someLocalDirectory\Some-API\2.0.0’
August 4th 2020 10:45:11Info
Copied 140 files
August 4th 2020 10:45:13Info
Making sure a Web Application “/Some-API/2.0.0” is configured as a child of “some root directory” at “D:\wwwroot\someLocalDirectory\Some-API\2.0.0”…
August 4th 2020 10:45:14Error
OperationStopped: Virtual path “IIS:\Sites\some root directory\Some-API” does not exist. Please make sure all parent segments of IIS:\Sites\some root directory\Some-API\2.0.0 exist.
August 4th 2020 10:45:14Error
At D:\wwwroot\someLocalDirectory\Some-API\2.0.0\Octopus.Features.IISWebSite_BeforePostDeploy.ps1:247 char:4
August 4th 2020 10:45:14Error

  •         throw "Virtual path `"$fullPathToVirtualPathSegment`" doe ... 
    

August 4th 2020 10:45:14Error

  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    

August 4th 2020 10:45:14Error
at Assert-ParentSegmentsExist, D:\wwwroot\someLocalDirectory\Some-API\2.0.0\Octopus.Features.IISWebSite_BeforePostDeploy.ps1: line 247
August 4th 2020 10:45:14Error
at , D:\wwwroot\someLocalDirectory\Some-API\2.0.0\Octopus.Features.IISWebSite_BeforePostDeploy.ps1: line 352
August 4th 2020 10:45:14Error
at , D:\wwwroot\someLocalDirectory\Some-API\2.0.0\Bootstrap.Octopus.Features.IISWebSite_BeforePostDeploy.ps1: line 1960
August 4th 2020 10:45:14Error
at , : line 1
August 4th 2020 10:45:14Error
at , : line 1
August 4th 2020 10:45:14Error
Running rollback conventions…
August 4th 2020 10:45:14Error
Script ‘D:\wwwroot\someLocalDirectory\Some-API\2.0.0\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ returned non-zero exit code: 1
August 4th 2020 10:45:14Fatal
The remote script failed with exit code 1
August 4th 2020 10:45:14Fatal
The action Deploy web app to IIS on non-local environments on i-066b63049405c9c8e failed

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.