Azure Devops SSH Deployment Task Inline Script Hang Problem - ssh

When I want to run a script in Inline Script mode on SSH Deployment Task on Azure Devops Version Dev17.M153.5, that one goes on hang as below. There is no problem that we have checked the authorizations of the user running the command. Operating system version on target Solaris 11.4.Is there a method to solve this problem?
##[debug]inline=cd /home/userstfs/workspaces/*****/src;pwd
##[debug]No script header detected. Adding: #!/bin/bash
##[debug]Agent.TempDirectory=D:****_temp
##[debug]failOnStdErr=true
Trying to establish an SSH connection to #...***:22
Successfully connected.
##[debug]remoteScriptPath = "./sshscript_1596017258623._unix"
##[debug]Copying script to remote machine

You have to update the agent in the deployment pools from:
Organization setting - Deployment pools - Update targets

Related

GPG Encryption failing in SSMS Job agent and successful in SSIS

I have a encryption job set, it executes just fine in Visual studio but give the following error in SSMS job agent-->
Error retrieving emailid#domain.com via WKD:No data gpg
skipped: No Data
Using SQL 2017. I tried using CMDEXEC instead of SSIS Package in job settings but it doesn't solve the problem
Arguments:
--quiet --yes --trust-model always --passphrase mypassphrase --recipient XXX#XXX.com --trust-model always --output D:\Folder\File.csv.gpg --encrypt D:\Folder\file.csv
So I was executing job from the proxy account and apparently proxy and own account is different when it comes to gpg key import. Meaning- I had imported keys using gpg/Kleopatra in my desktop using my windows credentials and was calling the job with my proxy account from job agent. Hence the proxy account was not able to access the keys. This is what solved my problem- https://superuser.com/questions/1176705/windows-account-cant-see-gpg-key#new-answer

Jenkins job on AWS server

I have a windows instance set up on AWS. I have Jmeter and Ant installed on that machine to run API test cases.So I can successfully run tests on remote server. I need to set up a job on corporate Jenkins to run those test cases on aws server. I have server's IP address and username and password to log in to aws server.
How do I set up a job on corporate Jenkins which will run my test cases on remoter aws server? (Execute windows command)
Thank you.
did you connect this AWS machine as a slave to the master ? or you can't do it ?
I think that the best is connect this machine as a slave and create a dedicated job to run on the windows machine
Setting up a new Ant task to run JMeter test in Jenkins is fairly easy, here is a simple Pipeline script which executes Ant task using build.xml file in the "extras" folder of JMeter installation and publishes resulting HTML report on the build artifacts page:
node {
ws('c:\\jmeter\\extras') {
stage 'Run JMeter Test with Apache Ant'
def antHome = tool 'ant'
bat "pushd c:\\jmeter\\extras && ${antHome}\\bin\\ant -f build.xml"
step([$class: 'ArtifactArchiver', artifacts: 'Test.html', fingerprint: true])
}
}
You will need to define ant tool so Jenkins would know what is "ant" and where it lives. See Running a JMeter Test via Jenkins Pipeline - A Tutorial article for details.
Alternative options are:
If you have Jenkins admin access or your user has "Job - Configure" role you have "Configure" button where you can see (and change) all the build steps
You can copy the whole Jenkins installation over to your corporate intranet (don't forget JENKINS_HOME folder)
Thank you both for your response. I have set it my windows AWS machine as Slave. And I was able to run the job on AWS server from corporate jenkins.

Command for automatic activate changes in Oracle Weblogic Server after deployment

Firstly connecting to the weblogic server using connect command then
I am deploying ears using the deploy command and i have many ears to be deployed so after every ear deployment i have to go to the console and click on activate changes
Is there any command for activate changes
connect(username, password, urladmin)
deploy(applName,deploymentFile,targets=deploymentTarget,appversion='v1',timeout=0)
There is an activate command.
activate([timeout], [block])
"Activates changes saved during the current editing session but not yet deployed. This command prints a message if a server restart is required for the changes that are being activated."
https://docs.oracle.com/middleware/1213/wls/WLSTC/reference.htm#WLSTC254

How to perform a command in a shell on remote server immediately after deploying some code from intellij idea?

I have a web server running on a virtual machine and I need some actions (e.g. "service apache2 reload") to be performed there automatically after I'll deploy my code from Idea
Automatically -- no way AFAIK.
https://youtrack.jetbrains.com/issue/WI-3344 -- watch this ticket (star/vote/comment) to get notified on any progress.
You may also watch related tickets:
https://youtrack.jetbrains.com/issue/WI-23938
https://youtrack.jetbrains.com/issue/WI-3239
The only manual solutions I may suggest right now are:
either keep SSH console opened (IDE has it built-in) and execute such command manually once deployed
or create "Remote SSH External Tools" entry that will do such job (connect and issue specified command) manually after deployment (once created you can assign custom shortcut to it so it can be run more easier).
In both cases -- check this manual.

Access Denied when executing through cygwin openssh

When I execute the command "iisreset" through an ssh terminal on a remote windows machine, I get the following error:
Attempting stop...
Restart attempt failed.
Access denied, you must be an administrator of the remote computer to use this
command. Either have your account added to the administrator local group of
the remote computer or to the domain administrator global group.
When I type whoami, it shows that I am the administrator. My cygwin ssh session is running as the "cyg_server" user who has admin privileges.
My ssh server is configured with privilege separation and allows me to login as administrator.
When I run the command locally, it works fine. The problem is execution through ssh.
I've also used process monitor to see what's going on, but it does not indicate the problem.
That is pretty strange because I am able to do admin-only operations in remote ssh such as:
echo "hi">/cygdrive/c/x.txt
rm /cygdrive/c/x.txt
Turning off UAC did not make a difference.
Any ideas?
I had a similar problem: unable to start/stop services using net start/net stop from a remote password-less (public/private key) SSH user. Attempting to start/stop the service was resulting in a "System Error 5 has occurred. Access is denied." error).
I had to install Cygwin's LSA authentication package (see http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview) in order for (I presume) setuid to work properly for password-less logins.
The problem should go away once LSA is installed on the Cygwin/SSH host and the machine has been rebooted.
I got scared of the LSA package mentioned in #user3609241's answer because of this sentence in the LSA docs:
as soon as the LSA encounters serious problems (for instance, one of
the protected LSA processes died), it triggers a system reboot.
But, those same docs point to a very easy way to "runas" SYSTEM - just use the at command:
$ date
Mon, Jan 12, 2015 8:17:35 PM
$ at 20:18 iisreset
Added a new job with job ID = 1
$ at
Status ID Day Time Command Line
-------------------------------------------------------------------------------
1 Today 8:18 PM iisreset
It works, at the cost of having to wait up to 59 seconds.
(wrapping the above sequence of commands in a simple-to-call script is left as an exercise to the reader; our management util is written in Perl so it was pretty straightforward).
Run the Cygwin terminal as administrator