IISWebSite_BeforePostDeploy: cannot create a file when that file already exists

Hi - I have a ‘hello world’ site .Net 4.5. I packaged it using OctoPack. When I try and deploy it, I get this error. Interestingly, the only part of the path that exists:
C:\Program Files\Octopus Deploy\Tentacle\Scripts\Octopus.Features.IISWebSite_BeforePostDeploy.ps1
is:
c:\Program Files\

start-webitem : Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)

At C:\Program Files\Octopus Deploy\Tentacle\Scripts\Octopus.Features.IISWebSite_BeforePostDeploy.ps1:233 char:3

  •     Start-Website $WebSiteName
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~
    
  • CategoryInfo : InvalidOperation: (:slight_smile: [Start-WebItem], COMException
  • FullyQualifiedErrorId : InvalidOperation,Microsoft.IIs.PowerShell.Provider.StartItemCommand

PowerShell script returned a non-zero exit code: 1

Hi Jon,

Thanks for getting in touch, this error:

start-webitem : Cannot create a file when that file already exists

Is actually an error from IIS. What they mean by “file” is actually “port” - i.e., Octopus has created a website and is trying to start it, but something else is already listening on that port. Chances are there is another web site in IIS using the same binding.

Hope that helps!

Paul

4 Likes

Oh sorry - but thanks you guys rock.