Getting error in SCP plugin in jenkins - jenkins

I want to deploy my created war automatically to /tomcat/webapps from jenkins scp plugin.
In jenkins ->Manage Jenkins ->configure system
Hostname-deploy port-22 repository- "ipaddress:8080"/usr/bin/scp
Username-jenkins
Error here "Cant connect to server"
password-jenkins
In jenkins->new job ->configure
scp site - deploy
file to upload
source - http://"ip:8080"/var/lib/jenkins/workspace/WebWarDemo/source/**
destination - http://"ip:8080"/usr/share/tomcat6/webapps/
above is my configuration for scp plugin but i am getting error in first configuration as shown.
but when i tried to run the another error is "jenkins scp com.jcraft.jsch.jschexception auth cancel" i tried so many times changing user name no effect plz suggest anything
I am entering username and password of jenkins server user.

Make sure of the following things:
The user with which you are trying to connect to Repository server has "WRITE" access.
SSH connection has been established between the twos servers with public keys of the respective users
Login to jenkins as jenkins user and run the following
ssh repouser#repository server
What do you get?
Let me know if you have ensured these. Will take it ahead from there

Related

Jenkins can not connect to git repository over ssh

I'm very new with Jenkins, and I'm trying to learn how to use it. I have setup the Jenkins on my small Windows-based server, and I have another server (raspberry) where I have initialized a small git project. When I try to add this git repository to the Jenkins, it can not connect to it no matter what. Here's what I have tried so far.
I can check, that the connection is working to the git server by using git ls-remote -h ssh://gitserver#192.168.50.152:22/home/gitserver/GitProject/.git command from any computer within the network, and I get a response after giving my password. I have saved this password as a "Username with password" -kind to Jenkins > Manage Jenkins > Credentials. Then, I have selected this from the Credentials drop down, but all I get is this error: "Failed to connect to repository : Error performing git command: git.exe ls-remote -h ssh://gitserver#192.168.50.152:22/home/gitserver/GitProject/.git HEAD"
Interesting part is, that if I try that command given with the "HEAD" at the end, I get just empty line, but no errors. Could this be an indicator to some kind of an issue? Here's a picture of the configuration. Am I doing something wrong? I have SSH authentication right now via password and ssh-public key. I have tried the SSH-public key as a credential, but no luck.
I'm very new to Jenkins, and just starting to learn, but I could not find an answer to this. Many articles were just pointing out how to connect to GitHub project, but I want to connect to this local project sitting on a raspberry pi, as an exercise.
Ok, the issue was with Jenkins and specifically with the SSH plugin it is using to connect. After updating everything, and Jenkins restarted, the connection is now working, and I can confirm this by clicking the "Build Now", and checking the Build log, Jenkins did fetch the info from the Raspberry server, and it is now sitting at the data-folder of this server!
So, for the rest of the people having this issue, try to update all plugins and then restart the Jenkins.

Unable to add Gerrit server to Jenkins, With the Gerrit Trigger plugin, "Connection error : com.jcraft.jsch.JSchException: Auth fail"

I want to add my Gerrit Server to Jenkins by using the Gerrit Trigger plugin. However, When i click the "Test Connection" button i get the error "Connection error : com.jcraft.jsch.JSchException: Auth fail"
I have verified that the Jenkins account can SSH into the Gerrit server without specifying a password, I have also verified that i can open my Gerrit Website from my Jenkins Server.
I dont know why the connection fails, And i haven't been able to find a start to finish guide for adding Gerrit servers in Jenkins.
Solved. It took me a while to find a guide that included this step. But i solved it by adding the public ssh key in the Gerrit interface. Now the connection succeeds on this step.

gitlab plugin test connection issue on jenkins

Im having issue with gitlab plugin test connection on jenkins. it gives error when I hit the "test connection" button with the given values.
GitLab user is maintainer and has full access on it. GitLab API token belongs to this user.
unfortunately it seems no way to track this error. I checked the logs files in jenkins machine as well.
GitLab Plugin Version is -> 1.5.27
you may see screenshot of the page here
alternative link:
https://gyazo.com/2b81c4310c7a144651fda54c6b1462c1

Jenkins says: Error: connect ECONNREFUSED 127.0.0.1:80 while trying to list jenkins jobs on slack using hubot

I wanted to have a bot integrated with slack, using which my team can run Jenkins builds. I tried doing it using hubot, following the steps here: https://slack.dev/hubot-slack/
I mentioned all the variables (jenkins_url, jenkins auth -username:password, slack token) in .bashrc and sourced it. The bot connected to slack and when run #hunot help, it will list all the options. So far so good.
I also included jenkins.coffee script in hubot-scripts.json, to reach jenkins however, I'm unable to connect to jenkins. When I run #hubot help, it lists jenkins commands as well. The problem arises when I actually run one of those jenkins commands. When I run #hubot jenkins list, it returns Jenkins says: Error: connect ECONNREFUSED 127.0.0.1:80
I'm not sure what the issue is. On my jenkins host, I'm using nginx, reverse proxy (so that I don't have to use 8080 in url while accessing jenkins). Is there something obvious I'm missing?
Also, how can I access jenkins without user and password?

Deploy to container Plugin (1.13) doesn't give manager username & password under Post Build Actions

I'm not able to deploy war files on Tomcat 7 via Jenkins. I've installed the Deploy to container Plugin (1.13) in Jenkins.
However, when I created a job to deploy war file, on selecting Tomcat 7.x as the container through Post Build Action step, I'm not getting the manager username & password fields. I'm just getting the Jenkins Credentials Provider option which doesn't work for container manager login.
screenshot of the Post Build Action section for my Jenkins job.
This change in the user interface is done to implements a security fix. You can get more details here
https://issues.jenkins-ci.org/projects/JENKINS/issues/JENKINS-52504?filter=allopenissues
You can now use the Credentials plugin. Use the new interface through the credentials plugin. There is an "Add Credentials" button next to it (as shown in your image) to do that, and it seems like you have added credentials.

Resources