0

I have a project with a profobuf services, which works fine:

jamie@machine:~/imp/lb$ lb delete imp && lb services restart
...
jamie@machine:~/imp/lb$ lb create imp && lb compile project ~/imp/lb/imp.project && lb addproject imp ~/imp/lb
created workspace 'imp'
jamie@machine:~/imp/lb$ echo '{}' | lb web-client call http://127.0.0.1:8080/ui
{}

But when I add branch services from the docs, the protobuf service stops working:

jamie@machine:~/imp/lb$ lb web-server load --config ~/imp/lb/branch-services.config
loaded static workspace imp
jamie@machine:~/imp/lb$ echo '{}' | lb web-client call http://127.0.0.1:8080/ui
<3>2017-01-18 04:28:26,72400+00:00 ERROR BatchDriver        - Server Error from service: http://127.0.0.1:8080/ui (HTTP Status 404)
error: stm {
  simple {
    call_proto {
      service: "http://127.0.0.1:8080/ui"
      encoding: JSON
      gzip: true
      input {
        binary: "{}\n"
      }
      output_file: "-"
      format: false
      method: POST
    }
  }
  status: ERROR
  exception: "Server Error from service: http://127.0.0.1:8080/ui (HTTP Status 404)"
  end_time: "2017-01-18 12:28:26,72500+08:00"
  start_time: "2017-01-18 12:28:26,56300+08:00"
}

Do I need to combine the configurations somehow? Do they need to live in different workspaces?

2 Answers2

0

You are probably declaring multiple services with the same prefix (e.g. /ui). The server will unload all of those when this happens.

You can check what the server did in $LB_DEPLOYMENT_HOME/logs/current/lb-web-server.log (or in systemd's journal if deployed).

You can also list the currently running services with:

lb web-server list -s
ttonelli
  • 28
  • 2
  • 2
  • 4
0

You use the same name for the workspace where you deploy your protobuf services and the static workspace you attach the branch services too. renaming the static workspace to something else should fix your issue.

Alternatively you could declare the branch services in the workspace where you serve the protobuf service using logiQL instead of json. something like:

service_by_prefix_and_method[["/imp/get-branch-names", "POST"]=x,
  protobuf_service(x) {
  custom_handler[] = "lb:web:connectblox:get_branch_names",
  protobuf_protocol[] = "bloxweb_connectblox",
  protobuf_request_message[] = "GetBranchNames",
  protobuf_response_message[] = "GetBranchNamesResponse",
  group("lb:web:internal")
}.