OS: Ubuntu 14.04
Jenkins version: 1.642
어느순간부터 다음과 같은 오류가 발생하며 빌드가 정상적으로 되지 않는 증상이 발생했다.
증상
프로젝트의 빌드 구성을 다음과 같은 순서로 변경을 했었다.
1. 하나의 Tomcat 에 빌드 및 배포
2. 두개의 Tomcat 에 빌드 및 배포 (Tomcat 로드밸런싱)
3. 하나의 Tomcat 에 빌드 및 배포 (다시 1번의 상태로 되돌림)
3번의 설정을 하고나서부터 갑자기 빌드가 되지 않았던 것으로 기억한다.
Log (Console Output)
Building in workspace /var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace
Updating svn://127.0.0.1/repo/{_PROJECT_NAME_} at revision '2016-01-12T18:59:37.290 +0900'
At revision 138
no change for svn://127.0.0.1/repo/{_PROJECT_NAME_} since the previous build
Parsing POMs
[workspace] $ /usr/lib/jvm/jdk1.7.0_79/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/usr/lib/mvn/apache-maven-3.3.9/boot/plexus-classworlds-2.5.2.jar:/usr/lib/mvn/apache-maven-3.3.9/conf/logging jenkins.maven3.agent.Maven31Main /usr/lib/mvn/apache-maven-3.3.9 /var/cache/jenkins/war/WEB-INF/lib/remoting-2.53.2.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 47861
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/pom.xml install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.{_PROJECT_}:ms:war:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for oracle:oracle:jar should not point at files within the project directory, ${project.basedir}/src/main/webapp/WEB-INF/lib/ojdbc14-10.2.0.4.0.jar will be unresolvable by dependent projects @ line 159, column 16
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: commons-io:commons-io:jar -> duplicate declaration of version 2.4 @ line 293, column 15
[WARNING] 'dependencies.dependency.systemPath' for com.oracle:ojdbc14:jar should not point at files within the project directory, ${basedir}/src/main/webapp/WEB-INF/lib/ojdbc14-10.2.0.4.0.jar will be unresolvable by dependent projects @ line 345, column 16
[WARNING] 'dependencies.dependency.systemPath' for com.nice:NiceID:jar should not point at files within the project directory, ${basedir}/src/main/webapp/WEB-INF/lib/NiceID.jar will be unresolvable by dependent projects @ line 354, column 16
[WARNING] 'dependencies.dependency.systemPath' for com.ipin:client:jar should not point at files within the project directory, ${basedir}/src/main/webapp/WEB-INF/lib/IPINClient.jar will be unresolvable by dependent projects @ line 363, column 16
[WARNING] 'dependencies.dependency.systemPath' for nicepay:nicepay_tx:jar should not point at files within the project directory, ${basedir}/src/main/webapp/WEB-INF/lib/nicepay_tx-0.9.8.15.jar will be unresolvable by dependent projects @ line 372, column 16
[WARNING] 'dependencies.dependency.systemPath' for nicepay:nicepay_lite:jar should not point at files within the project directory, ${basedir}/src/main/webapp/WEB-INF/lib/nicepay-lite-0.9.19.jar will be unresolvable by dependent projects @ line 379, column 16
[WARNING] 'dependencies.dependency.systemPath' for com.tagfree.util:tagfree_mime:jar should not point at files within the project directory, ${basedir}/src/main/webapp/WEB-INF/lib/tagfree_mime_v7.jar will be unresolvable by dependent projects @ line 399, column 16
[WARNING] 'dependencies.dependency.systemPath' for tidy:tidy:jar should not point at files within the project directory, ${basedir}/src/main/webapp/WEB-INF/lib/tidy.jar will be unresolvable by dependent projects @ line 407, column 16
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ms 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ms ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 91 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ ms ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ms ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ ms ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ ms ---
[INFO] No tests to run.
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ ms ---
[INFO] Packaging webapp
[INFO] Assembling webapp [ms] in [/var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/target/ms-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/src/main/webapp]
[INFO] Webapp assembled in [355 msecs]
[INFO] Building war: /var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/target/ms-0.0.1-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ ms ---
[INFO] Installing /var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/target/ms-0.0.1-SNAPSHOT.war to /var/lib/jenkins/.m2/repository/org/{_PROJECT_}/ms/0.0.1-SNAPSHOT/ms-0.0.1-SNAPSHOT.war
[INFO] Installing /var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/pom.xml to /var/lib/jenkins/.m2/repository/org/{_PROJECT_}/ms/0.0.1-SNAPSHOT/ms-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.575 s
[INFO] Finished at: 2016-01-12T18:59:45+09:00
[INFO] Final Memory: 16M/478M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/pom.xml to org.{_PROJECT_}/ms/0.0.1-SNAPSHOT/ms-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/target/ms-0.0.1-SNAPSHOT.war to org.{_PROJECT_}/ms/0.0.1-SNAPSHOT/ms-0.0.1-SNAPSHOT.war
channel stopped
Deploying /var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/target/ms-0.0.1-SNAPSHOT.war to container Tomcat 7.x Remote
Redeploying [/var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/target/ms-0.0.1-SNAPSHOT.war]
Undeploying [/var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/target/ms-0.0.1-SNAPSHOT.war]
Deploying [/var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/target/ms-0.0.1-SNAPSHOT.war]
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [/var/lib/jenkins/jobs/{_PROJECT_NAME_}/workspace/target/ms-0.0.1-SNAPSHOT.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:107)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:185)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1037)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Deployed application at context path /{_PROJECT_NAME_} but context failed to start
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:611)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:291)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:102)
... 17 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Deployed application at context path /{_PROJECT_NAME_} but context failed to start
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:611)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:291)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:102)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:185)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1037)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE
인터넷을 찾아보았지만 해결할 수 있는 글은 없었다.
문제
그나마 Jenkins Issue 에 올라온 글(Link)을보고 여러개의 서버에 war 배포시 문제가 발생 할 수 있다는 이슈로 인해 다음과 같이 작업을 했다.
해결
1004lucifer
1. Jenkins 에 등록된 프로젝트의 설정을 따로 기록한뒤 프로젝트 삭제
2. Jenkins 에 새로운 프로젝트를 등록 후 기존의 설정과 동일하게 입력
PS.
거짓말처럼 동일한 설정인데도 증상이 사라지고 문제없이 빌드가 되었다.
동료에게 말을하니 내부적으로 설정이 꼬여서 그러는 경우가 있을 수 있다는 답변을 받았다.
참조: https://issues.jenkins-ci.org/browse/JENKINS-14949
댓글
댓글 쓰기