Basedir in custom powershell scripts seems wrong

Hi

In the latest version I am experiencing various problems with the basedir/location.

Now, custom powershell scripts are executed using the basedir/location of the powershell installation. So when I now write “Write-Host $(get-location)” in a custom script I get the following location:
“C:\Windows\System32\WindowsPowerShell\v1.0”
Previously I would get the path to which the package had been deployed. So now I have to write the following to execute stuff in the deployment dir: $OctopusParameters[‘OctopusOriginalPackageDirectoryPath’] + "\sample.exe’. Previously I could just write “sample.exe”.

The same goes for the physical path of IIS deployments. Previously that would be set to the path to which the package had been deployed. Now it is also set to “C:\Windows\System32\WindowsPowerShell\v1.0” (see attached screenshot). The only way to avoid this seems to be to assign a custom installation directory. When I do that the path is set correctly.

I am running v2.3.3.1369 on the server and all tentacles. The tentacle is a Windows Server 2012 DataCenter edition.

Regards
Lars

IISSettingsAfterOctopusDeploy.jpg

Hi Lars, this sounds like a bug - the working directory for a script inside a package should always be the package directory.

Just to clarify, you’re using Deploy.ps1 scripts embedded in your package?

I’ve created an issue here to track this:

Paul

No, i am entering it directly in the web UI using the new custom PowerShell script feature.

Regards
Lars

Hi Lars,

We made some significant changes here in 2.3 so I’m confident you’ve found a blind-spot of ours, but I’m having a lot of trouble replicating it (I’m concentrating on the first item, the incorrect working directory observation).

Is it possible you could attach or send to our support@ address the “Raw” task log for a broken deployment?

If you can create a fresh deployment log with the OctopusPrintEvaluatedVariables variable set to True that might give us some extra info, but either that or an existing log would be a big help.

Regards,
Nick

One other thought Lars - is the behaviour consistent on multiple Tentacles? A corrupted DeploymentJournal.xml file could explain this somehow, but if so I’d expect the behaviour to be specific to a single machine.

Yes, the behaviour consistent on all Tentacles?. But they have all gone through the same tentacle upgrade process so maybe that is what has caused it. I have sent the logs along with the DeploymentJournal.xml file to your support mail.

Thanks for sending those through, unfortunately we haven’t turned anything up. Can you please increase the logging level on Tentacle to Trace: info is at http://docs.octopusdeploy.com/display/OD/Log+files

I’m sorry about the time this is taking - thanks for your patience.

Cheers,
Nick

Hi

I have been away for the last week so sorry for the delay. I have just retried the issue and can now for the life of me not reproduce it. I have gone through the update log on the servers and no patches has been deployed since we encountered the issue…

However I was able to reproduce the second (WebSite) issue. I have attached the log.

Med venlig hilsen / Best regards
[cid:imageb18bd9.JPG@2e7dc6a7.48974342]
Lars Riis Olsen
Senior Software Developer
Neas Energy A/S
Skelagervej 1, DK-9000 Aalborg
Tel +45 99 39 58 73
Mob +45 31 50 68 28
Fax +45 99 39 59 99
Aalborg | London | Stockholm | Hamburg
lro@neasenergy.commailto:lro@neasenergy.com%20| | www.neasenergy.comhttp://www.neasenergy.com
[LinkedIn]https://www.linkedin.com/company/neas-energy-a-s[Twitter]https://twitter.com/neasenergy

OctopusTentacle.txt (131 KB)

image79796d.PNG

image99fdf9.PNG

imageb18bd9.JPG

Hi Lars - thanks for getting back to us. I’m investigating the log now.

Nick

Ok, not much to go on from the log unfortunately. There is an issue in 2.3.3 that can mask earlier failures, causing them to show as warnings rather than errors. If this is triggered, the affected nodes will be shown in orange; I don’t suppose there are any of these in this case?

We may need to create a specially-instrumented version of the code to track this down. I’ll keep at it for now and let you know.

Regards,
Nick

Hi Lars,

Can you add me to Skype (paulstovell) or let me know another screen-sharing technology that works for you? I’d like to track this down - being able to see your screen might help to uncover what is going on.

Paul

Sure, which timezone are you in?.


Fra: Paul Stovellmailto:tender2+d99b197d02d5a2f44e2a1ddda842288c56c2c8004@tenderapp.com
Sendt: ‎05-‎04-‎2014 02:28
Til: Lars Riis Olsenmailto:lro@neasenergy.com
Emne: Re: Basedir in custom powershell scripts seems wrong [Problems #16998]

image79796d.PNG

image99fdf9.PNG

imageb18bd9.JPG

Right now the US west coast, but on Monday I’ll be in QLD, Australia time. If you like you can add me to Skype and just say Hi when you’re available and we’ll see if it overlaps. Otherwise email me some times/days that work for you and I’ll make myself available (paul at octopusdeploy.com)

Paul