Showing posts with label jenkins. Show all posts
Showing posts with label jenkins. Show all posts

Thursday, 5 May 2016

Failed to connect to repository : Error performing command: git ls-remote -h in jenkins

Failed to connect to repository : Error performing command: git ls-remote -h git@github.com:voice/voice_Java.git HEAD.

solution : problem might be due to you have not installed git repo on the machine.

install and try again in jenkins when creating a job configuration.

Thursday, 21 April 2016

step tp set up slave machines on jenkins


set up  slave machines on jenkins

solution :

1) go to jemkins homepage.
2) go to manage jenkins
3) see the messages
"Slave to master security subsystem is currently off. Please read the documentation and consider turning it on."
click on examine.
or
4) go to "Configure Global Security" at bottom of page "plugin manager"
click on enable slave.


add the modes in jenkins.

ref: jenkins
node name :
mySlave

1) go to jemkins homepage.
2) go to manage jenkins
3) add new node
4) define the name,
  # of executors,
Remote root directory(local folder where jenkins to resider),
5) and save.
6) go to jenkins homepage,newly created node and and click on local box

error : RequestAbortedException: java.io.IOException: Unexpected termination of the channel

Wednesday, 20 April 2016

Cannot allocate memory/insufficient memory for the Java Runtime Environment to continue.

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000f71a2000, 16084992, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 16084992 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /var/lib/jenkins/jobs/subcontract/workspace/hs_err_pid10731.log

ERROR: Maven JVM terminated unexpectedly with exit code 1
Finished: FAILURE

solution :

increase the java memory maximum heap and initial heap

You can do this to the JAVA_OPTS variable in the bin/catalina.sh startup script.

JAVA_OPTS="-Xms128m -Xmx256m"

jenkins,github Failed to connect to repository

Failed to connect to repository : Command "/usr/bin/git -c core.askpass=true ls-remote -h
...
stderr: remote: Invalid username or password

problem : jenkins is trying to handshake with git with the provided credentials. but unable to login.

solution :
1) Go to jenkins homepage.

2) Go to credentials, add git user name and password.

3) Go to jenkins project, select new added credentials from the dropdown.





Monday, 18 April 2016

jenkins tomcat 401 Unauthorized

jenkins tomcat 401 Unauthorized

org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username and password you provided are not correct (error 401)


tomcat 401 Unauthorized

You are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.

org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/lib/jenkins/jobs/../..SNAPSHOT.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:189)

solution : goto tomcat "conf " directory and open tomcat-user.xml.

check two things.

1) uncomment below code

<tomcat-users>
<role rolename="manager-gui"/>
<user name="tomcat" password="s3cret" roles="standard,manager-gui"/>
</tomcat-users>

2) or add "standard" in the roles.

Sunday, 17 April 2016

AWS jenkins tomcat "ConnectException: Connection timed out"


AWS jenkins tomcat "ConnectException: Connection timed out"

Error 1.
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy
Caused by: java.net.ConnectException: Connection timed out

error 2.
This site can’t be reached
xx.xxx.xx.xxx took too long to respond.
ERR_CONNECTION_TIMED_OUT

solution :

go to network and setting --> click on "deafault" name
edit indound rule.
add "cunstom tcp rule" add the custom port that you want to listen ex:8090 or 3000
save.

Maven fails to parse POMs jenkins

Maven Failed to parse POMs jenkins
hudson.maven.MavenEmbedderException: 1 problem was encountered while building the effective settings
[FATAL] Non-readable settings /usr/../apache-maven/apache-maven-3.2.1/conf: /usr/../apache-maven/apache-maven-3.2.1/conf (Is a directory) @ /usr/../apache-maven/apache-maven-3.2.1/conf

Solution :

Go to jenkins homepage.

Go the project/job which was deployed.

Go to configuration -> build - > advance-

From the setting file dropdown -- > choose default maven setting option and save.

And build the jenkins job.

Saturday, 16 April 2016

Jenkins GitHub Hooks Problems


GitHub Hooks Problems

1)
This page shows hooks problems and ignored projects. You can view detailed stacktrace of any problem in system log. For better debug in jenkins interface, enable this logs:

com.cloudbees.jenkins.GitHubWebHook - ALL
org.jenkinsci.plugins.github.webhook.WebhookManager - ALL
org.jenkinsci.plugins.github.admin.GitHubHookRegisterProblemMonitor - ALL
This table shows problems with registering/removing hooks for corresponding repo. Message will be dismissed if Jenkins will receive PING hook for repo, or if you add this repo to ignore list. This messages will not be saved to the disk, so all of them will be
cleared after jenkins restart

1.a)
github.com:username/repo There is no credentials with admin acces
s to manage hooks on GitHubRepositoryName[host=github.com,username=username,repository=repo]

solution :
1) go to jenkins homepage.
2) click on manage jenkins
3) click on configure system
4) go to
GitHub -> GitHub Servers
uncheck "manage hooks"
5) restart the jenkins


Ref : stackoverflow 

Friday, 15 April 2016

Failed to connect to repository : Could not init /tmp/hudson

Failed to connect to repository : Could not init /tmp/hudson

1) There's no such executable git in PATH: /sbin, /usr/sbin, /bin, /usr/bin.
In the jenkins job section.
Advanced...
Source Code Management.
got git.
2) Failed to connect to repository : Could not init /tmp/hudson

solution : please install git(as below ) or provide the git exe file path (/usr/bin/git).  

Install git on linux.

command : sudo yum install git-all

ref : https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

now check the git version.
cmd : git --version

Create job in jenkins

Create job in jenkins

1) Go to jenkins homepage
2) create job/New item.
3)Create a item name an choose type of project you want it can be.
a) Freestyle project
b) Maven project
c) External Job
d) Multi-configuration project
e) Copy existing Item
we are using option b.
3) In the configuration page fill following
a) Maven project name
since we are using github repository as CVS. Install the plugin if not avaialble.
to install github plugin
a.1) go to jenkins->manage plugin->manage plugin->search from "github plugin" from available plugin. check and install.
b)  click on "GitHub project" provide project URL. and description.
c) Source Code Management.
c.1) choose project URL of the github
c.2) and enter the username and pwassoer of the repositroy (define it global/system)
d)Build Triggers choose
d.1)Build whenever a SNAPSHOT dependency is built
d.2) Build when a change is pushed to GitHub
e) Build
e.1) root pom.xml
e.2) Goals and options (clean and install)
f) Intall tomcat plugin for Capitomcat plugin deploy the WAR file to multiple remote Tomcat servers.
g) install “Deploy to container Plugin" to deplloy the war file in tomcat container.
This plugin takes a war/ear file and deploys that to a running remote application server at the end of a build
h) In the post build action choose "Deploy to container Plugin"

JDK installations in jenkins


error : /usr/java/jdk1.8.0_45 is not a directory on the Jenkins master (but perhaps it exists on some slaves)


Set the path JAVA_HOME : /usr/java/jdk1.8.0_45




Thursday, 14 April 2016

Manage the users in jenkins

Manage  users in jenkins :

1) go to jenkins page
2) go to "configure global security"
3) go to authorization select the option "Matrix-based security"
if no user is added, add the user/group and define access level of user/group like
a) be admin
b)  manage domains
c) slave
d) jobs
e) run and view
4) to check if new user is added or not
a) go to jenkins home page.
b) click on people
c) see the user.



Wednesday, 13 April 2016

security configuraton in jenkins

security configuraton in jenkins

1) click on manage jenkins

2) From the list of option choose "Configure Global Security".
this will allow user Secure "Jenkins" and  define who is allowed to access/use the system.

3) Click on Enable security
(If enabled, you have to login with a username and a password that has the "admin" role before changing the configuration)
options :
a) TCP port for JNLP slave agents
a.1) Jenkins uses a TCP port to communicate with slave agents launched via JNLP
a.2) Alternatively, you can specify the fixed port number so that you can configure your firewall accordingly.
a.3) Disable remember me : Select this option to remove the “Remember me on this computer” checkbox from the login screen.

4) Access Control
4.1) Security Realm
options :
a) Delegate to servlet container :  Use the servlet container to authenticate users, as per defined by the servlet spec.
b)  Jenkins’ own user database : Use Jenkins's own user list for authentication, instead of delegating that to an external system. for small system .
c)  LDAP :

5) Authorization
a) Anyone can do anything :
b) legacy mode
c) Logged-in users can do anything
d) Matrix-based security : In this scheme, you can configure who can do what by using a big table.
e) Project-based Matrix Authorization Strategy
(This allows you to say things like "Joe can access project A, B, and C but he can't see D." See the help of "Matrix-based security" for the concept of matrix-based security in general. ACLs are additive, so the access rights granted below will be effective for all the projects.)

6)
click on save  and will be redirected to signup page, provide the details and login