簡介
本文檔介紹當使用者出現「Unable to access jar file cliqr-repository-client-*-jar-with-dependencies.jar」(無法訪問jar檔案cliqr-repository-client-*-jar-with-dependencies.jar)錯誤時,如何解決此問題。
必要條件
需求
本文件沒有特定需求。
採用元件
本文檔中的資訊基於Cloud Center 4.6及更高版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
問題
通常,當您嘗試使用外部生命週期操作部署應用程式時,Docker會嘗試執行由CCO啟動的指令碼。但是,它失敗是因為由於docker已損壞,它無法讀取指令碼本身。
錯誤消息:
2017-03-12 17:08:01,085 DEBUG service.LifecycleExternalServiceAction [nodeMessageTaskExecutor-12] - reading container
script timeout value from gateway configuration 10m
2017-03-12 17:08:05,181 DEBUG container.GatewayContainerService [nodeMessageTaskExecutor-12] - 306: Output
Error: Unable to access jarfile cliqr-repository-client-*-jar-with-dependencies.jar^M
CLIQR_EXTERNAL_SERVICE_ERR_MSG_START^M
Failed to download files specified in environment variables^M
CLIQR_EXTERNAL_SERVICE_ERR_MSG_END^M
2017-03-12 17:08:05,182 ERROR service.LifecycleExternalServiceAction [nodeMessageTaskExecutor-12] -
java.lang.ArrayIndexOutOfBoundsException: 4
java.lang.ArrayIndexOutOfBoundsException: 4
at com.osmosix.gateway.container.ContainerWorkerBuilder.build(ContainerWorkerBuilder.java:31)
at com.osmosix.gateway.container.GatewayContainerService.execute(GatewayContainerService.java:94)
at com.osmosix.gateway.lifecycle.action.orchestration.service.LifecycleExternalServiceAction.
executeContainerCommand(LifecycleExternalServiceAction.java:198)
附註:在GUI中,它只顯示錯誤4。
若要更正此問題,您需要執行以下步驟:
驗證
在CCO/Docker電腦(安裝了docker)中,運行以下命令:
#docker run 'cliqr/worker:latest' sleep 100000
Error: Unable to access jarfile cliqr-repository-client-*-jar-with-dependencies.jar^M
CLIQR_EXTERNAL_SERVICE_ERR_MSG_START^M
Failed to download files specified in environment variables^M
CLIQR_EXTERNAL_SERVICE_ERR_MSG_END^M
解決方案
1.登入CCO或docker電腦(如果獨立)。
2.儲存舊的Docker影象。
3.使用root@abc-cco ~]# docker save cliqr/worker:latest > oldimage.tar。
4.刪除Docker映像。
[root@abc-cco ~]# docker rmi -f a81630771eec
Untagged: cliqr/worker:latest
Deleted: sha256:a816567771eec9e8727162ab140b4e4a39fffwer43b3d403e56f2f12ed7c6d05f8
Deleted: sha256:167e65676beb12727aa74ddac2b7d87e113d1ee80cbecf93980595ca38cb92d37
Deleted: sha256:7f65225671815905d1b077b79c838f3fcff305a07dfg0129800605b104e7a71
Deleted: sha256:68f724567derd4031368a20e1ad72a15d0dfgdfg4ebf3dd5025932a2a625ee8a8c3
5.獲取新的docker檔案,然後下載。
root@abc-cco ~]#wget http://repo.cliqrtech.com/bin/docker/docker.tar
6.解開Docker影象。
[root@abc-cco ~]# tar -xvf docker.tar
cliqr-container-worker/
cliqr-container-worker/Dockerfile
cliqr-container-worker/utils.sh
cliqr-container-worker/worker.sh
cliqr-container-worker/cliqr-repository-client-4.7.0-jar-with-dependencies.jar
[root@abc-cco ~]# cd cliqr-container-worker
7.構建Docker映像。
[root@abc-cco cliqr-container-worker]# docker build -t 'cliqr/worker:latest' .
Sending build context to Docker daemon 73.26 MB
Step 1 : FROM centos:7
---> 0584b3d2cf6d
Step 2 : ENV JAVA_VERSION 1.7.0
---> Running in 5a30ce6e6e2f
---> ef6176cc1816
Removing intermediate container 5a30ce6e6e2f
Step 3 : RUN rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm && sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo && yum clean all && yum -y update && yum -y install python-pip wget unzip ssh vim && yum -y install java-${JAVA_VERSION}-openjdk-headless
---> Running in f20c66af5d98
.......
.....
... output shorted for space
8.重新構建docker後,運行此命令時,可以驗證它:
[root@abc-cco cliqr-container-worker]# docker run 'cliqr/worker:latest' sleep 100000
CLIQR_EXTERNAL_SERVICE_LOG_MSG_START
Download service bundle: success.
CLIQR_EXTERNAL_SERVICE_LOG_MSG_END
CLIQR_EXTERNAL_SERVICE_LOG_MSG_START
Executing service sleep action with command: "" from directory:
CLIQR_EXTERNAL_SERVICE_LOG_MSG_END
[root@abc-cco cliqr-container-worker]#
9.在CCO上部署具有外部生命週期操作的新應用程式。應用程式版本:?4.7.2