Deploying to webserver with website physical path remote

So I am hoping someone might be able to help.

We are having an issue deploying an application to an IIS website, when the website physical path is \\remoteserver\website.

The error we get is: New-Item : A parameter cannot be found that matches parameter name ‘physicalPath’.

The issue seems to go away when we change the physical path of the website to the local server.

The reason the website points to a remote server is because there’s a lot of static data, and this way it only needs to be updated once. But when that is set up, the deployments from octopus fail.

If anyone has run into an issue like this, were you able to resolve it?

Hi Nate,

Thanks for getting in touch and I’m sorry to hear that you are having these issues.

What version of IIS are you deploying to?

Can you make sure that the account that the Tentacle service is running under has access to the UNC path, and can you also send through the raw log from the deployment that failed with that error as this might give us some further clues as to what is causing it.

Thank you and best regards,
Henrik

We are using IIS 10 and it looks like the user account has full access to that shared folder.

Here is the raw log
ServerTasks-57787.log.txt (19.2 KB)

Hi Nate,

Thanks for the extra information. For some reason it seems that loading the WebAdministration module (which adds the physicalPath parameter for New-Item didn’t work correctly (but it didn’t trigger our catch code which is odd as well).

Could you log on to the server (as the user the Tentacle is running as) that you are trying to deploy to and run the below:

try {
    Write-Host "Calling Add-PSSnapin WebAdministration"
	Add-PSSnapin WebAdministration -ErrorAction Stop
} catch {
    try {
        Write-Host "Calling Import-Module WebAdministration"
		Import-Module WebAdministration -ErrorAction Stop
	} catch {
		Write-Warning "We failed to load the WebAdministration module. This usually resolved by doing one of the following:"
		Write-Warning "1. Install IIS via Add Roles and Features, Web Server (IIS)"
		Write-Warning "2. Install .NET Framework 3.5.1"
		Write-Warning "3. Upgrade to PowerShell 3.0 (or greater)"
		Write-Warning "4. On Windows 2008 you might need to install PowerShell SnapIn for IIS from http://www.iis.net/downloads/microsoft/powershell#additionalDownloads"
		throw ($error | Select-Object -First 1)
    }
}
New-Item "IIS:\Sites\AgoLotteryBeta\Public" -Type Application -physicalPath "C:\Deploy\AgoLotteryBeta\Public"

Thank you and best regards,
Henrik

Henrik, thanks for the reply, sorry for not getting back sooner…
Anyway, i got this error when i ran that -

Import-Module : Process should have elevated status to access IIS configuration data.

So it would seem as if there’s a permissions issue somewhere. I added the account to the local admin group and that error goes away, but this one shows up:

New-Item : A parameter cannot be found that matches parameter name ‘physicalPath’.

Hi Nate,

Thanks for testing that. I’ve had a chat with the team and we think perhaps something has corrupted the IIS/PS install as -physicalPath should be available on the New-Item cmdlet after importing the WebAdministration module.

Can you reboot the server and see if it works, otherwise reinstalling/repairing the IIS feature on the server and then trying again?

Thank you and best regards,
Henrik

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