typesafehub / conductr-cli

CLI for Lightbend ConductR
Other
16 stars 21 forks source link

Error when loading a bundle #509

Closed ashutoshraina closed 7 years ago

ashutoshraina commented 7 years ago

Repro Steps : We have a running instance of conductr with loaded bundles.

$ conduct info

ID               NAME                            TAG  #REP  #STR  #RUN  ROLES
b532472-92feca5  conductr-haproxy              2.1.0     1     0     1  haproxy
cabaae7          visualizer                    2.1.0     1     0     0  web
57e432d          eslite                        2.1.0     1     0     1  elasticsearch
6273d7a          reactive-maps-backend-region            1     0     1  intranet
870ee7d          continuous-delivery           2.1.0     1     0     1  continuous-delivery

1) Download the bundle from the bundles endpoint and unzip it. 2) Try to load the bundle again

$ conduct load continuous-delivery-2.1.0/
Retrieving bundle..
Error: bndl: bundle.conf validation errors:
  The following properties are not allowed to be empty: components.continuous-delivery.endpoints.akka-remote.services
$ bndl continuous-delivery-2.1.0 -o output.txt
Error: bndl: bundle.conf validation errors:
  The following properties are not allowed to be empty: components.continuous-delivery.endpoints.akka-remote.services

The conf file

$ cat continuous-delivery-2.1.0/bundle.conf

version              = "1"
name                 = "continuous-delivery"
compatibilityVersion = "3"
tags                 = ["2.1.0"]
annotations          = {}
system               = "continuous-delivery"
systemVersion        = "3"
nrOfCpus             = 0.1
memory               = 402653184
diskSpace            = 200000000
roles                = ["continuous-delivery"]
components = {
  continuous-delivery = {
    description      = "continuous-delivery"
    file-system-type = "universal"
    start-command    = ["continuous-delivery/bin/continuous-delivery", "-J-Xms134217728", "-J-Xmx134217728", "-Dhttp.address=$DEPLOYMENTS_BIND_IP", "-Dhttp.port=$DEPLOYMENTS_BIND_PORT", "-Dplay.crypto.secret=636f6e74696e756f75732d64656c6976657279"]
    endpoints = {
      "deployments" = {
        bind-protocol = "http"
        bind-port     = 0
        service-name  = "deployments"
        acls          = [
          {
            http = {
              requests = [
                {
                  path-beg = "/deployments/events"
                },
                {
                  path-beg = "/deployments"
                },
                {
                  path-beg = "/deployments/batches"
                },
                {
                  path-beg = "/deployments/artefacts"
                }
              ]
            }
          }
        ]
      },
      "akka-remote" = {
        bind-protocol = "tcp"
        bind-port     = 0
        services      = []
      }
    }
  }
}
huntc commented 7 years ago

@markusjura - are you able to look at this?

markusjura commented 7 years ago

@ashutoshraina In the latest conductr-cli version we are now performing a validation of the bundle.conf file when producing a bundle. The bundle cannot be created in your case because of the validation error that the services field in the akka-remote endpoint is empty.

However, having empty acls and services is actually valid, so the validation is too strict here. I've created the PR https://github.com/typesafehub/conductr-cli/pull/511 that allows empty acls and services. Once the PR is merged and a new conductr-cli version is released, the validation will pass for your bundle.

In the meantime, you could remove the services field from the akka-remote endpoint in the bundle.conf entirely, to let the validation pass. services is an optional field.

markusjura commented 7 years ago

@ashutoshraina PR https://github.com/typesafehub/conductr-cli/pull/511 has been merged. We aim for a new conductr-cli release tomorrow.

fsat commented 7 years ago

CLI 1.2.16 is now released which contains #511:

https://github.com/typesafehub/conductr-cli/releases/tag/1.2.16