When running the IIS AppPool - Create template (coming from the step template libarary) is used, we get the following error. This used to work until recently, we aren’t sure what changed exactly:
Exception calling “LoadFrom” with “1” argument(s): "Could not load file or assembly
15:00:10Error
’file:///C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll’ or one of its dependencies. The system cannot
15:00:10Error
find the file specified."
15:00:10Error
At C:\Octopus\Work\20160412130008-30\Script.ps1:95 char:1
15:00:10Error
I’ve tested this step template on one of my instances and it is working as expected. Looking at the error message it seems that the Microsoft.Web.Administration.dll file no longer exist in C:\Windows\system32\inetsrv…not sure why that would have been removed…
Could you logon to the Tentacle and run the below in a PowerShell window:
Sorry to be a pain, but could I get you to try and run that line of PowerShell in the script console as well…I’m really not sure why you would be getting that error as it should work as the dll is there…
That is very strange indeed as I’m pretty sure we invoke the scripts all the same in Calamari. I’ve put it to the team to see if we can figure out why the step template is invoked using PS3.0 instead of PS4.0.
In the meantime, could I get you to test one more thing, if you comment out the [System.Reflection.Assembly]::LoadFrom statement in the step template (it shouldn’t actually be needed, we load the Web Administration module in our IIS feature script and we don’t load the specific dll) and see if that works.
Sorry for the inconvenience caused by this, but I hope we can get it all sorted soon.
We’re scratching our heads here as to why this would be happening, so I think it’d be best if we scheduled a support call to see if we can figure out what is going on here.
If you could also try another thing for me, create a new step template (could just be Write-Host "Hello World") and run that through that same Tentacle and see if that also runs under PowerShell 3.0 instead of 4.0.
Task ID: ServerTasks-14710
Task status: Success
Task queued: Thursday, April 21, 2016 8:44 AM
Task started: Thursday, April 21, 2016 8:44 AM
Task duration: 33 seconds
Server version: 3.3.6+Branch.master.Sha.ef711d651c56c0d0097bfecf797bb02a0abb1d00
| == Success: Deploy <package> release 225.2016.420.28013 to QAT ==
08:44:58 Info | Step 3: Deploy <package> Database Changes was manually skipped, and will not be executed
08:44:58 Info | Step 4: IIS AppPool - Create was manually skipped, and will not be executed
08:44:58 Info | Step 5: IIS Application - Create was manually skipped, and will not be executed
08:44:58 Info | Step 6: Deploy Website was manually skipped, and will not be executed
08:44:58 Verbose | Step 1: eMail Users does not apply to the current environment, and will not be executed
08:44:58 Verbose | Step 2: Wait for scheduled deployment date does not apply to the current environment, and will not be executed
08:44:58 Verbose | Guided failure is not enabled for this task
08:45:31 Info | The deployment completed successfully.
|
| == Success: Step 7: Debug Step ==
08:45:31 Verbose | Debug Step completed
|
| Success: <servername>
08:44:58 Verbose | Octopus Server version: 3.3.6+Branch.master.Sha.ef711d651c56c0d0097bfecf797bb02a0abb1d00
08:44:58 Info | Executing script on '<servername>'
08:45:29 Verbose | Octopus Deploy: Calamari version 3.3.5+Branch.master.Sha.755501eda21d63861022f1a2d87c98d5e7f9f23b
08:45:30 Verbose | Name Value
08:45:30 Verbose | ---- -----
08:45:30 Verbose | PSVersion 4.0
08:45:30 Verbose | WSManStackVersion 3.0
08:45:30 Verbose | SerializationVersion 1.1.0.1
08:45:30 Verbose | CLRVersion 4.0.30319.42000
08:45:30 Verbose | BuildVersion 6.3.9600.17400
08:45:30 Verbose | PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
08:45:30 Verbose | PSRemotingProtocolVersion 2.2
08:45:30 Info | Hello World
|
| Success: <servername2>
08:44:58 Verbose | Octopus Server version: 3.3.6+Branch.master.Sha.ef711d651c56c0d0097bfecf797bb02a0abb1d00
08:44:58 Info | Executing script on '<servername2>'
08:45:29 Verbose | Octopus Deploy: Calamari version 3.3.5+Branch.master.Sha.755501eda21d63861022f1a2d87c98d5e7f9f23b
08:45:30 Verbose | Name Value
08:45:30 Verbose | ---- -----
08:45:30 Verbose | PSVersion 4.0
08:45:30 Verbose | WSManStackVersion 3.0
08:45:30 Verbose | SerializationVersion 1.1.0.1
08:45:30 Verbose | CLRVersion 4.0.30319.42000
08:45:30 Verbose | BuildVersion 6.3.9600.17400
08:45:30 Verbose | PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
08:45:30 Verbose | PSRemotingProtocolVersion 2.2
08:45:31 Info | Hello World
Thanks for testing that for me, at least it means that we don’t have a bug in how we run step templates, but it doesn’t explain why the other step template isn’t working.
To make sure there isn’t anything wrong with the step template itself, could you setup a new project with just that step template in it, and run that on the Tentacle where it fails, and configure a temporary (dummy) IIS app pool? I’m wondering if something with the step might have become corrupted and is causing it to run under PS3.0 instead of 4.0 as all the other steps do.
I’ll send through the meeting details closer to the scheduled time.
I’ll speak to you then, thank you and best regards,
Henrik
Yes, that is a mystery. We have had other scenarios where a step have become corrupted (somehow) and removing it/adding it back makes it work again. If you that in your existing project, does it work?
Argh - found the issue. I went to go copy the task into a new one as you suggest, and immediately noticed that it was set to run on Octopus Server instead of on the Tentacle! Not sure how that got changed, but setting it back fixed it. Maybe it would be a good idea to add that radio button selection into the log output? Sorry for wasting your time with such a silly thing, but thank you for the help!