Trying to run a Powershell scirpt from package

The script is working now. I really appreciate your help.

PostDeply and ServerAppSQLs folder is on Script is stilling on my C:\NuGetPackages\ServersWebApplication

But when I run it from Octopus Deploy as a Script Step, received errors below.

Tentacle script execution
Error 12:24:09
cd : Cannot find path ‘C:\WINDOWS\system32\config\systemprofile\AppData\Local\T
Error 12:24:09
entacle\Temp\ServerAppSQLs’ because it does not exist.
Error 12:24:09
At C:\WINDOWS\system32\config\systemprofile\AppData\Local\Tentacle\Temp\b028bef
Error 12:24:09
7-1f9a-4b67-bd67-44e27e85267e.ps1:11 char:1
Error 12:24:09

  • cd $PSScriptRoot$folder
    Error 12:24:09

Error 12:24:09

  • CategoryInfo : ObjectNotFound: (C:\WINDOWS\syst…p\ServerAppSQ
    Error 12:24:09
    Ls:String) [Set-Location], ItemNotFoundException
    Error 12:24:09
  • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLo
    Error 12:24:09
    cationCommand
    Info 12:24:09
    ============================================== PowerShell exit code: 1 ==============================================
    Fatal 12:24:09
    PowerShell script returned a non-zero exit code: 1 Tentacle version 2.6.5.1010

Thank you
Mohammed

Can you please also show me how to run Power Shell script from Octopus Application ?

Thank you

Mohammed Mujeeb
Senior Test Engineer
Insurance Marketing Solutions
LexisNexis | Risk Solutions
3096896413 x 46244 Direct
mohammed.mujeeb@lexisnexis.commailto:mohammed.mujeeb@lexisnexis.com

From: Mujeeb, Mohammed (RIS-PEO)
Sent: Wednesday, June 24, 2015 11:29 AM
To: 'Dalmiro Grañas’
Subject: RE: Trying to run a Powershell scirpt from package [Problems #34671]

The script is working now. I really appreciate your help.

PostDeply and ServerAppSQLs folder is on Script is stilling on my C:\NuGetPackages\ServersWebApplication

But when I run it from Octopus Deploy as a Script Step, received errors below.

Tentacle script execution
Error 12:24:09
cd : Cannot find path ‘C:\WINDOWS\system32\config\systemprofile\AppData\Local\T
Error 12:24:09
entacle\Temp\ServerAppSQLs’ because it does not exist.
Error 12:24:09
At C:\WINDOWS\system32\config\systemprofile\AppData\Local\Tentacle\Temp\b028bef
Error 12:24:09
7-1f9a-4b67-bd67-44e27e85267e.ps1:11 char:1
Error 12:24:09

  • cd $PSScriptRoot$folder
    Error 12:24:09

Error 12:24:09

  • CategoryInfo : ObjectNotFound: (C:\WINDOWS\syst…p\ServerAppSQ
    Error 12:24:09
    Ls:String) [Set-Location], ItemNotFoundException
    Error 12:24:09
  • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLo
    Error 12:24:09
    cationCommand
    Info 12:24:09
    ============================================== PowerShell exit code: 1 ==============================================
    Fatal 12:24:09
    PowerShell script returned a non-zero exit code: 1 Tentacle version 2.6.5.1010

Thank you
Mohammed

Hi Mohamed,

The script we were working on was a predeploy.ps1 script included inside of your NuGet package. From what i understood from your previous comment, it is now working as expected when executed during the package deployment step.

Now you are trying to execute the same script, but this time from a Powershell step? That script was not meant to be executed in that context, reason why it fails.

I think you are gonna need to take a step back and analyze what your deployment process needs. Its not gonna be of much use of your time if we keep sending scripts back and forth. Perhaps there’s someone on your organization that knows Powershell and can give you a hand? I assure you its gonna be much more productive for you that way.

Best regards,

Dalmiro

The Powershell script is executing successfully from windows PowerShell ISE. But I am not sure how I should package this in Octopus Deploy and run it successfully.

Thank you,
Mohammed

Hi

How can I deploy code on cross domain servers using Octopus deploy?

Can I setup tentacles with different domain/service account and Octopus manager with different domain/service account.

Thank you

Mohammed Mujeeb
Senior Test Engineer
Insurance Marketing Solutions
LexisNexis | Risk Solutions
3096896413 x 46244 Direct
mohammed.mujeeb@lexisnexis.commailto:mohammed.mujeeb@lexisnexis.com

---------------------------------------- The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. This message may be an attorney-client communication and/or work product and as such is privileged and confidential. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message.

Hi Mohammed,

You should be able to connect a Tentacle on DomainA to an Octopus Server in domain B. Just keep in mind that all the deployment activities will be performed by the account running the Tentacle service.

Thanks,

Dalmiro

Hi Dalmiro

Received connectivity errors on Octopus server machine and one of the tentacle machine.

Not connected. The machine has not completed a post-configuration handshake, so communication is not yet established.
Squid: Unknown
The last recorded failure on the connection was:
Error 11:52:13
Pipefish.Errors.PipefishCommunicationException: An existing connection was forcibly closed by the remote host at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task) at Octopus.Server.Communications.Handshaking.BackgroundPassiveTentacleSquidFinder.d__a.MoveNext() in y:\work\refs\heads\master\source\Octopus.Server\Communications\Handshaking\BackgroundPassiveTentacleSquidFinder.cs:line 96 Pipefish.PipefishException: The remote host aborted the connection. This can happen when the remote server does not trust the certificate that we provided. —> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. —> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) — End of inner exception stack trace — at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Security._SslStream.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.IO.Stream.ReadByte() at Pipefish.Transport.SecureTcp.ProtocolParser.ReadPrelude(Stream clientStream) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\ProtocolParser.cs:line 106 at Pipefish.Transport.SecureTcp.ProtocolParser.ParseResponse(SslStream responseStream, StatusCode& statusCode, String& statusText, ResponseHeaders& headers, String& protocol) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\ProtocolParser.cs:line 165 at Pipefish.Transport.SecureTcp.Client.SecureTcpClient.Send(SecureTcpRequest request, Action1 response) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\Client\SecureTcpClient.cs:line 85 --- End of inner exception stack trace --- at Pipefish.Transport.SecureTcp.Client.SecureTcpClient.Send(SecureTcpRequest request, Action1 response) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\Client\SecureTcpClient.cs:line 105 at Octopus.Server.Communications.Handshaking.PassiveTentacleHandshaker.Receive(PassiveTentacleHandshakeRequest message) in y:\work\refs\heads\master\source\Octopus.Server\Communications\Handshaking\PassiveTentacleHandshaker.cs:line 56 at Pipefish.Actor.OnReceivingTyped[TBody](Message message) in y:\work\3cbe05672d69a231\source\Pipefish\Actor.cs:line 113

Can you please let me know how to resolve above connectivity issue.

See attached screen shot for more information.

Thank you

Mohammed Mujeeb
Senior Test Engineer
Insurance Marketing Solutions
LexisNexis | Risk Solutions
3096896413 x 46244 Direct
mohammed.mujeeb@lexisnexis.commailto:mohammed.mujeeb@lexisnexis.com

---------------------------------------- The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. This message may be an attorney-client communication and/or work product and as such is privileged and confidential. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message.

From Octopus Web Portal, Tentical Connectivity Failed with below errors.

Can you please let us know how to fix this issue ?

Task progress
Check Tentacle health in UAT
Fatal 11:15:07
The health check failed. One or more machines were not available.
Check machine: alawucpm005 at https://alawucpm005:10933/
Fatal 11:15:07
The remote host aborted the connection. This can happen when the remote server does not trust the certificate that we provided. Pipefish.PipefishException: The remote host aborted the connection. This can happen when the remote server does not trust the certificate that we provided. —> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. —> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) — End of inner exception stack trace — at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Security._SslStream.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.IO.Stream.ReadByte() at Pipefish.Transport.SecureTcp.ProtocolParser.ReadPrelude(Stream clientStream) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\ProtocolParser.cs:line 106 at Pipefish.Transport.SecureTcp.ProtocolParser.ParseResponse(SslStream responseStream, StatusCode& statusCode, String& statusText, ResponseHeaders& headers, String& protocol) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\ProtocolParser.cs:line 165 at Pipefish.Transport.SecureTcp.Client.SecureTcpClient.Send(SecureTcpRequest request, Action1 response) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\Client\SecureTcpClient.cs:line 85 --- End of inner exception stack trace --- at Pipefish.Transport.SecureTcp.Client.SecureTcpClient.Send(SecureTcpRequest request, Action1 response) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\Client\SecureTcpClient.cs:line 105 at Octopus.Server.Communications.Handshaking.PassiveTentacleHandshaker.Receive(PassiveTentacleHandshakeRequest message) in y:\work\refs\heads\master\source\Octopus.Server\Communications\Handshaking\PassiveTentacleHandshaker.cs:line 56 at Pipefish.Actor.OnReceivingTyped[TBody](Message message) in y:\work\3cbe05672d69a231\source\Pipefish\Actor.cs:line 113 Octopus.Server version 2.6.5.1010
Fatal 11:15:07
An existing connection was forcibly closed by the remote host Pipefish.PipefishException: The remote host aborted the connection. This can happen when the remote server does not trust the certificate that we provided. —> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. —> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) — End of inner exception stack trace — at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Security._SslStream.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.IO.Stream.ReadByte() at Pipefish.Transport.SecureTcp.ProtocolParser.ReadPrelude(Stream clientStream) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\ProtocolParser.cs:line 106 at Pipefish.Transport.SecureTcp.ProtocolParser.ParseResponse(SslStream responseStream, StatusCode& statusCode, String& statusText, ResponseHeaders& headers, String& protocol) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\ProtocolParser.cs:line 165 at Pipefish.Transport.SecureTcp.Client.SecureTcpClient.Send(SecureTcpRequest request, Action1 response) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\Client\SecureTcpClient.cs:line 85 --- End of inner exception stack trace --- at Pipefish.Transport.SecureTcp.Client.SecureTcpClient.Send(SecureTcpRequest request, Action1 response) in y:\work\3cbe05672d69a231\source\Pipefish.Transport.SecureTcp\Client\SecureTcpClient.cs:line 105 at Octopus.Server.Communications.Handshaking.PassiveTentacleHandshaker.Receive(PassiveTentacleHandshakeRequest message) in y:\work\refs\heads\master\source\Octopus.Server\Communications\Handshaking\PassiveTentacleHandshaker.cs:line 56 at Pipefish.Actor.OnReceivingTyped[TBody](Message message) in y:\work\3cbe05672d69a231\source\Pipefish\Actor.cs:line 113
Octopus.Server version 2.6.5.1010

Thank you,

Mohammed Mujeeb
Senior Test Engineer
Insurance Marketing Solutions
LexisNexis | Risk Solutions
3096896413 x 46244 Direct
mohammed.mujeeb@lexisnexis.commailto:mohammed.mujeeb@lexisnexis.com

---------------------------------------- The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. This message may be an attorney-client communication and/or work product and as such is privileged and confidential. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message.

Hi,

Have you verified that the Tentacle and Server thumbprints are correct? Please also take a look at our troubleshooting guide for listening tentacles http://docs.octopusdeploy.com/display/OD/Troubleshoot+Listening+Tentacles

Thanks

Dalmiro

Powershell script to open browser runs properly on ISE, but does not open when run in Octopus deployment.

Attached ps1 has two steps associated.

  1. Moving files
  2. Opening Browser.

Step 1 is executed successfully in both environment. While step 1 executes only in step 1. Please guide.

PowerShellScript.ps1 (547 Bytes)

Powershell script to open browser runs properly on ISE, but does not open when run in Octopus deployment.

Attached ps1 has two steps associated.

  1. Moving files
  2. Opening Browser.

Step 1 is executed successfully in both environment. While step 2 executes only on ISE. Please guide.

PowerShellScript.ps1 (547 Bytes)

@Paresh I’ve split your question on a separate ticket, as this ticket already has too many replies of another topic that even though it seems similar, its quite different.

Closing the thread as well.