Jenkins问题集

来源:互联网 发布:潇洒的句子知乎 编辑:程序博客网 时间:2024/05/11 16:56

 

 

Error1: Hostname error

Nov 03, 2016 11:19:15 AMjavax.jmdns.impl.HostInfo newHostInfo

WARNING: Could not intialize the hostnetwork interface on nullbecause of an error:test212vm22:test212vm22

java.net.UnknownHostException: test212vm22:test212vm22

       at java.net.InetAddress.getLocalHost(InetAddress.java:1473)

       at javax.jmdns.impl.HostInfo.newHostInfo(HostInfo.java:75)

       at javax.jmdns.impl.JmDNSImpl.<init>(JmDNSImpl.java:407)

       at javax.jmdns.JmDNS.create(JmDNS.java:60)

       at hudson.DNSMultiCast$1.call(DNSMultiCast.java:32)

       atjenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)

       at java.util.concurrent.FutureTask.run(FutureTask.java:262)

       atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

       atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

       at java.lang.Thread.run(Thread.java:744)

Caused by: java.net.UnknownHostException:test212vm22

       at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)

       at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)

       at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)

       at java.net.InetAddress.getLocalHost(InetAddress.java:1469)

       ... 9 more

 

Nov 03, 2016 11:19:20 AMhudson.model.UpdateSite updateData

 

solution:

在/etc/hosts文件中添加test212vm22

 

Error2: email send error

Sending email for trigger: Always

Sending email to: zengliang@xunlei.com

Error sending to the following INVALIDaddresses: zengliang@xunlei.com

 

solution:

系统设置-> Extended E-mail Notification -> 高级 -> UseSMTP Authentication中添加邮件及其密码

 

 

Error3: browser can’t open published html report

 

Opening Robot Framework report failed

 

Verify that you have JavaScript enabled inyour browser.

Make sure you are using a modern enoughbrowser. Firefox 3.5, IE 8, or equivalent is required, newer browsers arerecommended.

Check are there messages in your browser'sJavaScript error log. Please report the problem if you suspect you haveencountered a bug.

 

solution:

 java-Dhudson.model.DirectoryBrowserSupport.CSP= -jar jenkins.war

 

 

Error4:ssh-credentials plugin doesn’t work in source code management plugin

配置项目时,设置“源码管理"时,设置完”   Repository URL“之后,发现”Credentials“无法选择,下拉菜单无响应

 

solution:

git plugin版本为3.0.0版本,依赖的ssh-credentials(version:1.12) ,而Jenkins1.651.3版本默认的ssh-credentials插件版本较低,下载最新ssh-credentials版本,并安装

 

 

Error5:install plugin failed

手动安装插件时,出现如下错误

Solution:

尝试手动解压hpi插件,如果失败,说明hpi文件异常,需重新下载再安装

 

Error5:Submit code to Gitlab, but doesn’t trigger to build

Solution:

除了在git plugin中配置触发器,还需做如下动作:

1.      安装Gitlab Hook Plugin

2.      在Gitlab上配置web hook (Project –> Settings --> WebHooks), webhook格式如下:

http://your-jenkins-server/git/notifyCommit?url=<URLof the Git repositoryfor the Gitlabproject>

例如:

http://10.10.50.122:8080/git/notifyCommit?url=git@wx-gitlab.xunlei.cn:autotest/autotest.git

3.      还需打开如下Poll SCM配置,但不需填写任何内容

 

 

Error6: Jenkins kill spawned process

在Jenkins中使用脚本启动OSS,发现过很短时间,所有的worker都已停止,研究了一下发现,jenkins会杀死脚本的衍生进程。

Solution:

在脚本前面添加上BUILD_ID=XXXXX,即可如下:

BUILD_ID=demo

runPath=/usr/local/sandai

backPath=/home/backup

 

verStr=$(ls |grep tgz|awk -F "_" '{print $3}'|sort -t. -k1n -k2n -k3n|tail -1)

latestPkg=$(ls |grep $verStr)

echo "latestpkg: $latestPkg"

 

if [ ! -d $runPath ]; then

    mkdir -p $runPath

fi

 

if [ -d $runPath/oss ]; then

    $runPath/oss/batch.push.sh stop

    sleep 10

    isExisted=$(ps -ef|grep /bin/oss_ |grep -v grep|awk '{print $2}'|tr -s '\n' ' ')

    echo "isExisted: |$isExisted|"

    if [ -n "$isExisted" ]; then

        kill -9 $isExisted

        sleep 1

    fi

    mv $runPath/oss $backPath/oss_$(date +%Y%m%d_%H%M%S)

fi

 

tar zxf $latestPkg -C $runPath

 

cd $runPath/oss

./deploy.sh all

./batch.push.sh restart

./batch.push.sh status

 

ps -ef|grep /bin/oss_

 

sleep 3

processCnt=$(ps -ef|grep /bin/oss_ |grep -v grep |wc -l)

echo $processCnt

if [ $processCnt -ne 16 ]; then

   exit -1

else

   exit 0

fi

 

 

Error7: any commad in shell failed, the script failed

例如:grep失败了,整个脚本就失败了,根本无法运行到if语句,很坑爹

       pkgmd5=$(md5sum -b $pkg|awk '{print $1}')$pkg

       isEmpty=$(grep "$pkgmd5" at_done.txt)

       if [ -n “isEmpty” ] ; then

           echo $pkgmd5 >> donepkg.txt

       else

           latestPkg=$pkg

       fi

 

Solution

       pkgmd5=$(md5sum -b $pkg|awk '{print $1}')$pkg

       #isEmpty=$(grep "$pkgmd5" at_done.txt)

       if grep "$pkgmd5" at_done.txt; then

           echo $pkgmd5 >> donepkg.txt

       else

           latestPkg=$pkg

       fi

 

 

Error8: git clone timeout after 10 minutes

Solution

“源码管理” –> “git” à “Add” à”Advanced clone behaviours”

0 0
原创粉丝点击