AnsweredAssumed Answered

Passing Gateway License as an environment variable to the Docker Gateway

Question asked by andch13 Employee on May 4, 2018
Latest reply on Jun 12, 2018 by MarijaOmniSecure

Greetings Community,

 

So I am in the process of setting up my first instance of a docker gateway, I have everything installed and ready including the docker-compose.yml file. 

 

I am changing to the directory containing the compose file and running: 

 

docker-compose up 

 

The problem I am having is passing in the license to the gateway. I get the following error: 

 

INFO: Installing license from SSG_LICENSE environment variable

api-gateway_1   | May 04, 2018 8:00:44 AM com.l7tech.server.boot.GatewayMain main

api-gateway_1   | WARNING: Error starting server : Lifecycle error: Fail to install license: Not in GZIP format

api-gateway_1   | com.l7tech.server.LifecycleException: Lifecycle error: Fail to install license: Not in GZIP format

api-gateway_1   | at com.l7tech.server.BootProcess.start(Unknown Source)

api-gateway_1   | at com.l7tech.server.boot.GatewayBoot.f(Unknown Source)

api-gateway_1   | at com.l7tech.server.boot.GatewayBoot.start(Unknown Source)

api-gateway_1   | at com.l7tech.server.boot.GatewayBoot.runUntilShutdown(Unknown Source)

api-gateway_1   | at com.l7tech.server.boot.GatewayMain.main(Unknown Source)

api-gateway_1   | Caused by: java.lang.IllegalStateException: Fail to install license: Not in GZIP format

api-gateway_1   | at com.l7tech.server.licensing.BootstrapLicenseService.a(Unknown Source)

api-gateway_1   | at com.l7tech.server.licensing.BootstrapLicenseService.onApplicationEvent(Unknown Source)

api-gateway_1   | at com.l7tech.server.util.r.onApplicationEvent(Unknown Source)

api-gateway_1   | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)

api-gateway_1   | at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)

api-gateway_1   | at com.l7tech.server.BootProcess.a(Unknown Source)

api-gateway_1   | ... 5 more

api-gateway_1   | Caused by: java.util.zip.ZipException: Not in GZIP format

api-gateway_1   | at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:165)

api-gateway_1   | at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:79)

api-gateway_1   | at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:91)

api-gateway_1   | ... 11 more

api-gateway_1   |

api-gateway_1   | com.l7tech.server.LifecycleException: Lifecycle error: Fail to install license: Not in GZIP format

api-gateway_1   | at com.l7tech.server.BootProcess.start(Unknown Source)

api-gateway_1   | at com.l7tech.server.boot.GatewayBoot.f(Unknown Source)

api-gateway_1   | at com.l7tech.server.boot.GatewayBoot.start(Unknown Source)

api-gateway_1   | at com.l7tech.server.boot.GatewayBoot.runUntilShutdown(Unknown Source)

api-gateway_1   | at com.l7tech.server.boot.GatewayMain.main(Unknown Source)

api-gateway_1   | Caused by: java.lang.IllegalStateException: Fail to install license: Not in GZIP format

api-gateway_1   | at com.l7tech.server.licensing.BootstrapLicenseService.a(Unknown Source)

api-gateway_1   | at com.l7tech.server.licensing.BootstrapLicenseService.onApplicationEvent(Unknown Source)

api-gateway_1   | at com.l7tech.server.util.r.onApplicationEvent(Unknown Source)

api-gateway_1   | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)

api-gateway_1   | at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)

api-gateway_1   | at com.l7tech.server.BootProcess.a(Unknown Source)

api-gateway_1   | ... 5 more

api-gateway_1   | Caused by: java.util.zip.ZipException: Not in GZIP format

api-gateway_1   | at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:165)

api-gateway_1   | at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:79)

api-gateway_1   | at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:91)

api-gateway_1   | ... 11 more

api-gateway_1   |

api-gateway_1   |

api-gateway_1   |

api-gateway_1   | **** Unable to start the server: Error starting server : Lifecycle error: Fail to install license: Not in GZIP format

 

So the steps I have tried to fix this issue are: 

  • Specify the absolute path to the xml.gz license in the docker-compose.yml as SSG_LICENSE under the environment branch. 
  • Specify a base64 encoded string representation of the xml file as SSG_LICENSE under the environment branch. 
  • Used
    export SSG_LICENSE=/absolute/path/to/license
    in the bash terminal. 

 

Here is my docker-compose.yml file: 

 

version: '2'
services:
   api-gateway:
      image: caapim/gateway
      #cpus: 0.5
      mem_limit: 2g
      memswap_limit: 2g
      mem_swappiness: 0
      ports:
         - "8080"
         - "8443"
         - "9443"
      volumes:

         - /opt/SecureSpan/Gateway/node/default/etc/bootstrap/services/restman
      environment:
         ACCEPT_LICENSE: "true"
         SSG_ADMIN_USERNAME: "admin"
         SSG_ADMIN_PASSWORD: "7LayerS"
         SSG_DATABASE_JDBC_URL: "jdbc:mysql://mysql-server:3306/ssg"
         SSG_DATABASE_USER: "admin"
         SSG_DATABASE_PASSWORD: "7LayerS"
         SSG_CLUSTER_HOST: "130.119.133.107"
         SSG_CLUSTER_PASSWORD: "7LayerS"
         SSG_JVM_HEAP: "4g"
         EXTRA_JAVA_ARGS: "-XX:ParallelGCThreads=4 -                Dcom.l7tech.bootstrap.autoTrustSslKey=trustAnchor,TrustedFor.SSL,TrustedFor.SAML_ISSUER                          Dcom.l7tech.bootstrap.env.license.enable=true"
         SSG_LICENSE:    /path/to/file/license_file.xml.gz

 mysql-server:
    image: mysql:5.7
    mem_limit: 512m
    environment:
       - MYSQL_RANDOM_ROOT_PASSWORD=true
       - MYSQL_USER=admin
       - MYSQL_PASSWORD=7LayerS
       - MYSQL_DATABASE=ssg
    command:
       - "--character-set-server=utf8"
       - "--innodb_log_buffer_size=32M"
       - "--innodb_log_file_size=80M"
       - "--max_allowed_packet=8M"

 

In the docs it specifies that it must be a base64 encoded gzip file, does that mean I have to convert the file to base64 from the gzipped file? 

 

Any help would be appreciated. 

Outcomes