Introduction
Este documento descreve como resolver o problema quando um usuário recebe o erro "Unable to access jar file clqr-repositório-client-*-jar-with-dependdentions.jar".
Prerequisites
Requirements
Não existem requisitos específicos para este documento.
Componentes Utilizados
As informações neste documento são baseadas no Cloud Center versão 4.6 e superior.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Problema
Geralmente, quando você tenta implantar um aplicativo com o uso da ação de ciclo de vida externo, o Docker tenta executar os scripts iniciados pelo CCO. No entanto, ele falha porque não pode ler o próprio script devido ao docker estar corrompido.
Mensagem de Erro:
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)
Note: Na GUI, ele só é exibido com o Erro 4.
Para corrigir esse problema, siga estas etapas:
Verificar
Na máquina CCO/Docker (onde o docker está instalado), execute este comando:
#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
Solução
1. Faça login no CCO ou no docker machine (se independente).
2. Salve a imagem antiga do Docker.
3. Use root@abc-cco ~]# docker save cliqr/worker:latest > oldimage.tar.
4. Remova a imagem do 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. obtenha o novo arquivo docker que é baixado.
root@abc-cco ~]#wget http://repo.cliqrtech.com/bin/docker/docker.tar
6. Desmarque a imagem do 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. Crie a imagem do 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. Depois que o docker for reconstruído e você executar esse comando, poderá verificá-lo:
[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. Implante um novo aplicativo com a ação de ciclo de vida externo executada no CCO. Versão do aplicativo:? 4.7.2