Posts

Git Repository Corruption - Part1

Git Repo Corruption recovery The biggest fear of any administrator is the Data corruption. As a Git administrator we do take regular backup, We keep our system HA, We even do disk replication. In short we try every thing to keep data safe and secure. But still there are chances for the git repository corruption and you have to deal with it in real world. Here are few repo corruption scenarios and solutions. Note-> Please make sure you backup everything before touching the repo. There are instruction to fix some of the error. It is always suggested to backup your data before trying to perform any action.

Git authentication for automation script

Git authentication When you write some kind of automation (script) which needs to interact with git and clone/pull data and perform some action. And if its behind authentication layer then you need a way to automate the authentication that can let you pass credentials and automation can run without any interruption. Either you can use ssh keys to authentication and use git@ URL to access your git repo. But if you want to access (or force to) git via https URL you need to pass credential explicitly. There are 2 ways to achieve this task for http protocol.

Logrotate setup

How to setup logrotate There are several applications which do not have in build capability to rotate the logs and purge the old logs. Lets take example of apache, You may need to rotate its log and purge old one and zip the current one. It's not possible to truncate the apache log when its running, You will need to handle in via logotate command. Here is the way you can setup logrotate for an application. Here I am taking example of apache, You can change it as per your need

Maven Findbugs error

Maven Findbugs error When you update your java version from 1.7 to 1.8 and if you are using findbugs in your pom You may see following error while running the build. [ERROR] Failed to execute goal org.codehaus.mojo:findbugs-maven-plugin:2.5.3:findbugs (findbugs) on project : Execution findbugs of goal org.codehaus.mojo:findbugs-maven-plugin::findbugs failed: Java returned: 1 -> [Help 1] This is due to the mismatch of recent upgrade to java (1.8) and findbugs version. You will have to upgrade (start using) FindBugs verion 3.0.0 and above. Any findbugs version below 3.0.0 will not work with java 1.8.

Maven compiler error for invalid target java

Maven compiler error for invalid target java Some time you may see following error during maven compilation  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:compile (default-compile) on project metamarket: Fatal error compiling: invalid target release: 1.8 or 1.7 or 1.6 -> [Help 1] This error is because, you system is set to use different version as default and source and target configuration is also set accordingly.

Jenkins Plugin Tips and Tricks - Part 1

Image
In this section I will talk about Tips, Tricks, Troubleshooting of jenkins plugins. Role strategy Plugin This plugin adds a new role-based strategy to ease and fasten users management. You can even define pattern for the job and assign access for those jobs to users. Tip - > While specifying the pattern add the "." before "*", Otherwise pattern will not work. Ex-               test* will not match the job name which starts with test , You will need to add "." like test.* to match the job name starts with test.

Jenkins slave is not showing any log

Some time Jenkins Slaves are neither showing any log nor getting connected and you may feel that its stuck somewhere. Problem – The main problem could be the last connection was not cleaned up properly and its hung that is why nothing is shown in UI log. Solution – Try to disconnect and kill the process in slave if any and then try to reconnect again . Another option is that try to reconfigure slave with wrong config (say wrong port) are relaunch again, It will fail and cleanup connection, again configure back and relaunch, this should work.