Trying to deploy web application

I have been trying for the last day and a half to deploy my web site as a web application under a parent site. I have tried three different types of processes and I get the same error for all of them. Here is the error:

Making sure a Virtual Directory "DirectorySearch_Test" is configured as a child of "staging.uwlax.edu" at "E:\DirectorySearch_Test"...
April 3rd 2017 14:51:23Error
"DirectorySearch_Test" already exists in IIS and points to a Web Application. 
April 3rd 2017 14:51:23Error
We cannot automatically change this to a Virtual Directory on your behalf. 
April 3rd 2017 14:51:23Error
Please delete it and then re-deploy the project.
April 3rd 2017 14:51:23Error
At 
April 3rd 2017 14:51:23Error
E:\DirectorySearch_Test\Octopus.Features.IISWebSite_BeforePostDeploy.ps1:261 
April 3rd 2017 14:51:23Error
char:4
April 3rd 2017 14:51:23Error
+             throw "`"$virtualPath`" already exists in IIS and points to a 
April 3rd 2017 14:51:23Error
Web Application ...
April 3rd 2017 14:51:23Error
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
April 3rd 2017 14:51:23Error
~~~~~~~~~~~~
April 3rd 2017 14:51:23Error
    + CategoryInfo          : OperationStopped: ("DirectorySearc...oy the proj 
April 3rd 2017 14:51:23Error
   ect.:String) [], RuntimeException
April 3rd 2017 14:51:23Error
    + FullyQualifiedErrorId : "DirectorySearch_Test" already exists in IIS and 
April 3rd 2017 14:51:23Error
    points to a Web Application. We cannot automatically change this to a Vir  
April 3rd 2017 14:51:23Error
  tual Directory on your behalf. Please delete it and then re-deploy the pro   
April 3rd 2017 14:51:23Error
 ject.
April 3rd 2017 14:51:23Error
April 3rd 2017 14:51:23Error
Script 'E:\DirectorySearch_Test\Octopus.Features.IISWebSite_BeforePostDeploy.ps1' returned non-zero exit code: 1
April 3rd 2017 14:51:23Error
Running rollback conventions...
April 3rd 2017 14:51:23Error
Script 'E:\DirectorySearch_Test\Octopus.Features.IISWebSite_BeforePostDeploy.ps1' returned non-zero exit code: 1
April 3rd 2017 14:51:23Fatal
The remote script failed with exit code 1
April 3rd 2017 14:51:23Fatal
Directory Website on staging

I know this can be done and it has to be a pretty common thing to deploy a site as a sub application so I am sure I am just missing something. I really don’t know why Octopus is trying to create a virtual directory when it should be an application. Is this a bug or something I am missing?
I have attached a pic of my settings inside the process.

Thanks for any help you can give me.

Hi,

Thanks for getting in touch.

That is very strange, I’m not sure why Octopus is trying to create a virtual directory instead of an application. Could you please configure Octopus to output variables to the deployment (https://octopus.com/docs/how-to/debug-problems-with-octopus-variables#DebugproblemswithOctopusvariables-Writethevariablestothedeploymentlog), create and deploy a new release and then send the raw task log for that deployment (https://octopus.com/docs/how-to/get-the-raw-output-from-a-task).

Cheers,
Shane

Shane,
I set the variables and re-deployed. The log is attached. It seems as if it wants to create a virtual directory no matter what the setting is in the process. If I delete the site in IIS and try again no matter the setting in the process it creates a virtual directory. Which doesn’t seem correct to me.

ServerTasks-478.log.txt (29 KB)

Hi,

The step is always being set to deploy as a virtual directory:
[Octopus.Action.IISWebSite.DeploymentType] = ‘virtualDirectory’

I have tried reproducing in 3.11.13 without luck. Do you notice any javascript errors when editing or saving that page? What browser and version you are using to edit the page?

If you delete and re-create the step do you have any luck deploying?

Cheers,
Shane

Shane,
I think I figured it out. I am using TeamCity to build the project and then Octopus to deploy it. I think a setting was messed up in TeamCity that seemed to be causing the issue on Octopus. I have a few other issues with TeamCity I am trying to resolve.

Thanks for the help
Andy

Hi Andy,

Glad to hear you have figured it out. Let me know if you run into any other issues.

Cheers,
Shane