IIS Deploy , setting up both virtual and phisycal path (Possible bug)

Hi , I think i found small bug in the latest OctopusDeploy
I am trying to set up IIS WebAPplication and in the step i provide it both : a new virtual path and a new Physical path. However I get this error when doing so
"Property physicalPath is not found on "

To walk around this solution , separate assigning both paths into two steps:

  1. Deploy IIS web application and just set the virtual path : this would extract the nuget packet in a “default” Physical path
  2. Deploy IIS web application and set the virtual Physical path: by having the same virtual path and the application is already installed we just change the physical path by using “Custom install directory”

So can you guys verify it please ?

Hi Ahmad,

Thanks for getting in touch! We have seen a few cases like this in the last few days where Custom Installation Directory causes a collision.


We are working through this issue right now. Our recommendation is to remove the Custom Installation Directory feature: Let Octopus choose a unique physical path to extract and configure your package, and then point the virtual path in IIS to this physical path. We describe it in more detail here: http://docs.octopusdeploy.com/display/OD/IIS+Websites+and+Application+Pools#IISWebsitesandApplicationPools-HowOctopusDeploysyourWebSite

What do you think about this recommendation?

I would really like to understand why you want the physical path to be in a static/constant location, and why you want that location to have the exact same physical and virtual path? Perhaps it’s to make it easier for a human to find the files on disk? Perhaps it’s just a habit from how we used to manage IIS, by dropping folders/files and upgrading them to a Web Application/Virtual Directory?

This will help us decide whether we should try a lot harder to support a single step deployment with colliding physical/virtual paths, or actively steer people towards using Octopus’ default conventions.

Looking forward to hearing back from you!
Mike

Hello there , and thanks for responding ,
well as i said, I fixed the problem by separating both assignments into two steps the first one is by assigning the virtual path (which would put the physical path automatically in a unique place as you mentioned). The second step is exactly as the first step but to change the physical path by using the Custom Installation Directory.
This works fine , yet might take few seconds longer and might have duplication in files in the harddisk .

So why would people put their files in a certain place ?
Well I think it depends on needs, it might not be very important where are the real files located since after all what we want is the virtual ones.
However, Octopus sits the files under Octopus directory. If someone want to clean up the server , and for some reason wanted to reinstall octopus , then a small mistake can happen by removing important files without knowing it. If Octopus stores these files in more common place , let’s say for example in www folder, then it might be better and makes more sense for many people who are kind of old school .
In addition to that is exactly as you said, which is the habbit of mapping the virtual and physical map if it is possible. Consider this scenario, what if IIS broke , and you do not know where are your physical path for the applications ?
I know that every problem has a solution but i just was trying to give you some arguments :slight_smile:

Anyway my suggestion if it counts, to start with changing the default directroy instead of having it inside Octopus folder , you guys can put it somewhere else more common.

Hi Ahmad,

Just wanted to give you a quick update! We’ve opened and fixed a few GitHub Issues related to our conversation. Thanks for helping us improve the new IIS Step. :slight_smile:



You can watch these issues to see which version of Octopus contains the fixes.

Hope that helps!
Mike

Hello there
Thanks for sharing the issues with me, I have found that there is a new release of OctopusDeploy which includes the Phisical Path when deploying a webapplication which is great .
However it does not work well , or rather it does not create the folder/path if it does not exist .
And it gives me the error

resolve-path : Cannot find path ‘C:\local-af\test\Data\v3’ because it does not exist.

The idea is that we need it to create the folder since we reslease different versions and we need it to create a folder for each version.

UPDATE: I have added the Custom Installation Directory feature to the step and made the feild Phisical Path empty and that worked as expected. It would be nice though to use the PhisycalPath field for that step

Hi Ahmad,

Thanks or getting back to me! I can understand the potential for frustration here… If you leave the Physical Path empty, Octopus will set it for you based on where the Package is extracted on disk. This is our recommended way of deploying web applications: http://docs.octopusdeploy.com/display/OD/IIS+Websites+and+Application+Pools#IISWebsitesandApplicationPools-HowOctopusDeploysyourWebSite

If the IIS step created the Physical Path folder for you, but the package files were not in that path, I fear it would be more confusing for people than helpful.

Let me know what you think!
Mike

Hi,

There is still a problem for me deploying a web application underneath an existing site. With a blank physical path it all works an updates this to the installation directory if the application already exists. If it doesn’t and it needs to be created I get the error.

A parameter cannot be found that matches parameter name ‘physicalPath’

The full log of the error step is below.

Thanks, Simon

Retrying…
December 7th 2016 16:05:06Error
New-Item : A parameter cannot be found that matches parameter name ‘physicalPat
December 7th 2016 16:05:06Error
h’.
December 7th 2016 16:05:06Error
At C:\OctopusDeploy\Applications\CLIENT\Production\CLIENT_SITE\2016.12.11
December 7th 2016 16:05:06Error
\Octopus.Features.IISWebSite_BeforePostDeploy.ps1:297 char:78
December 7th 2016 16:05:06Error

  •         New-Item $fullPathToLastVirtualPathSegment -type Application -phy
    

December 7th 2016 16:05:06Error
sicalPath <<<< $physicalPath
December 7th 2016 16:05:06Error
+ CategoryInfo : InvalidArgument: (:slight_smile: [New-Item], ParentContainsE
December 7th 2016 16:05:06Error
rrorRecordException
December 7th 2016 16:05:06Error
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Comm
December 7th 2016 16:05:06Error
ands.NewItemCommand
December 7th 2016 16:05:06Error
December 7th 2016 16:05:06Error
Script ‘C:\OctopusDeploy\Applications\CLIENT\Production\CLIENT_SITE\2016.12.11\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ returned non-zero exit code: 1
December 7th 2016 16:05:06Error
Running rollback conventions…
December 7th 2016 16:05:07Error
Script ‘C:\OctopusDeploy\Applications\CLIENT\Production\CLIENT_SITE\2016.12.11\Octopus.Features.IISWebSite_BeforePostDeploy.ps1’ returned non-zero exit code: 1
December 7th 2016 16:05:08Error
The remote script failed with exit code 1

Hi,

I have narrowed this down to a problem with one of my environments so my comment above isn’t relevant here.

Apologies… I will open another thread or ticket to discuss.

Thanks, Simon