"FlowService.getFlow is not a function" - Error while adding a microservice in Controller


(Josemaria Thomas) #1

Downloaded an ioFog setup in Ubuntu 18.04.1 following the QuickStart guide
Downloaded the ioFog Quick Start project using the below curl command

curl -L -o quick-start.tar.gz https://github.com/ioFog/demo/archive/blank-environment.tar.gz

After running docker-compose up --detach I could see three containers running namely iofog-agent, iofog-controller and iofog-connector.

executing iofog-agent status command in the agent container gives the below output

ioFog daemon : RUNNING
Memory Usage : about 142.16 MiB
Disk Usage : about 0.00 MiB
CPU Usage : about 0.00%
Running Microservices : 0
Connection to Controller : ok
Messages Processed : about 0
System Time : 16/11/2018 05:39 PM

I pushed a sample microservice docker image to the local docker registry and tried adding the same to iofog-controller registry (registry-id = 2) using iofog-controller catalog add. It returned a catalog ID.
Since the iofog enviroment didn’t have a default flow setup, I created one using iofog-controller flow add -n “flow_1” -d “flow_iofog” -a -u 1.
And then tried adding the microservice to the iofog-controller using iofog-controller microservice add
This returned me FlowService.getFlow is not a function error. Kindly help me resolve this.


(Kilton Hopkins) #2

We will have a look and post a response here shortly. Thanks for your patience!


#3

We fixed this issue here https://github.com/ioFog/Controller/pull/294 and we’ll be releasing a patch within a few days.


(Josemaria Thomas) #4

When exactly we can expect the release?


(Josemaria Thomas) #5

Tried setting up the fixed version iofogcontroller@1.0.15 but getting SQLITE_ERROR: no such table: for all the CLI commands


#6

It was some intermediate version, we’ve just released a new one (1.0.19) with this fix, try it out.


(Josemaria Thomas) #7

Couldn’t find 1.0.19. Installed 1.0.18 but got the same error SQLITE_ERROR: no such table

Release version says v1.0.19 (11/21/2018) but package.json has version 1.0.18


#8

Are you still trying to install quickstart script or just controller from npm package?
This error appears when controller wasn’t started yet and database isn’t created.

For quick start script - controller is started automatically.
For package install - you need to manually start controller using ‘iofog-controller start’ command and then all CLI commands will work.


(Josemaria Thomas) #9

Quickstart script gave an older version of iofogcontroller v1.0.14. And got a different error.

internal/modules/cjs/loader.js:589
throw err;
^

Error: Cannot find module '../config'

So tried installing the latest controller from npm package. But didn’t start the controller manually.
iofog-controller controller status resulted in

 {
  "status": "ok",
  "timestamp": 1542906880172
}

So assumed controller is up and running.

Tried iofog-controller start and SQLITE_ERROR: no such table is not seen anymore. Will update the thread with more info soon


(Josemaria Thomas) #10

The issue is not seen anymore in v1.0.19


(Alexander) #11

About quickstart script - there was an issue with previously installed docker images, you can try it once more and it should work.
Or just clean previous images using
docker-compose down --rmi all
and re-run docker-compose up


(Josemaria Thomas) #13

Thank you. Its working now. I was able to deploy a sample microservice in the ioFog.