Search code examples
dockerwso2jwtwso2-iotwso2-identity-server

WSO2 IOT APIMClientOAuthException whene logged in device management in Docker containers


I am trying to install WSO2 IoT server (version 3.3.0) on an instance of AWS (Ubuntu 18.04.1 LTS) using docker (https://github.com/wso2-attic/docker-iot) , Then I have run change-ip.sh script in order to change ip addresses for redirections. I have changed localhost to my own static ip address.

After changing complete I have tried to login to device management console. However it throws me this error but in publisher i can Access

 ERROR {auth-module} -  org.wso2.carbon.apimgt.integration.client.exception.APIMClientOAuthException: failed to retrieve oauth token using jwt

i activeted debug logs. in IOT_HOME/conf/log4j.properties file

Uncomment the following log4j.logger.org.apache.synapse.transport.http.wire=DEBUG

log4j.logger.feign=DEBUG

Comment the following

log4j.category.org.apache.synapse=WARN

the results in attached file

https://github.com/wso2/product-iots/files/2977974/wso2carbon.log

my hosts file

127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

the hosts of dokcer container

127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.18.0.4      wso2iot-server

it is connected to this issuses

WSO2 IoTS APIMClientOAuthException: failed to retrieve oauth token using jwt

https://github.com/wso2/product-iots/issues/1396

any suggestion please?


Solution

  • the problem is related to the HTTPS gateway port: 8243, when starting container according to the file docker-compose.yml it only exposes the port 9443 so you have to add the port 8243 to be able to access from the outside, that's why it works with localhost and after the change with the ip address it generates the error.

    So I saved a new container image after changing the ip address with this commande

    docker commit a69f82f5eb71 wso2iot-server: 3.3.1
    

    and I started the image with the addition of port 8243

    docker run -p 8243: 8243 -p 8280: 8280 -p 9443: 9443 wso2iot-server: 3.3.1 
    

    thank you @Geeth Munasinghe for your help