Cant create NodeRed: No agentdriver is loaded

Hi,

I am trying to setup OpenFlow on my Raspberry pi 5 64bit
I encountered errors when trying to run the normal-up.sh due to architecture incompatibilities with the api so i build an image for the arm from the git repo openflow
i then reconfigured the docker compose file as follow

version: '3.8'

services:
  traefik:
    image: traefik:v2.10.6
    platform: linux/arm64
    command:
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "80:80"
    restart: always
    networks:
      - traefik
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

  mongodb:
    image: arm64v8/mongo
    platform: linux/arm64
    restart: always
    command: "--bind_ip_all --replSet rs0"
    environment:
      - MONGO_REPLICA_SET_NAME=rs0
    volumes:
      - mongodb_data:/data/db
    networks:
      - traefik

  rabbitmq:
    image: arm64v8/rabbitmq
    platform: linux/arm64
    restart: always
    networks:
      - traefik

  api:
    image: openiap/openflow:arm64
    platform: linux/arm64
    networks:
      - traefik
    ports:
      - "5858:5858"
    labels:
      - traefik.enable=true
      - traefik.http.routers.http-router.entrypoints=web
      - traefik.http.routers.http-router.rule=Host(`localhost.openiap.io`)
      - traefik.http.services.http-service.loadbalancer.server.port=3000
    environment:
      - auto_create_users=true
      - auto_create_domains=
      - domain=localhost.openiap.io
      - agent_oidc_userinfo_endpoint=http://api:3000/oidc/me
      - agent_oidc_issuer=http://localhost.openiap.io/oidc
      - agent_oidc_authorization_endpoint=http://localhost.openiap.io/oidc/auth
      - agent_oidc_token_endpoint=http://api:3000/oidc/token
      - amqp_url=amqp://guest:guest@rabbitmq
      - mongodb_url=mongodb://mongodb:27017/?replicaSet=rs0
      - mongodb_db=openflow
      - aes_secret=O1itlrmA47WzxPj95YHD2sZs7IchYaQI25mQ
    depends_on:
      - rabbitmq
      - mongodb
    restart: always

volumes:
  mongodb_data:
    driver: local

networks:
  traefik:
    name: traefik

and added the modified docker compose file to the normal-up.sh script

and the containers now looks to be up and running

I am also able to access OpenFlow locally
but if I navigate to Agents and try to create a NodeRed instance I get this error: No agentdriver is loaded

Can any of you tell me what I am doing wrong?

from your description it sounds like a bug in my code, but is going to be a little time consuming for me to try and replicate, so not sure when i can try it.

agentdriver is my weir name for a nodejs module that can talk to whatever openflow is installed on. Right now it can detect docker, kubernetes and openshift. If you look at the logs for api, do you see any errors on one of the first 10-20 lines about docker/agentdriver ?
( if you look in Logger.ts you can see the code that loads the agentdriver )

This peaked my interested in why, my old multi build stopped working.
Turns out there is a bug with npm on alpine …
So i updated my Dockerfile to use debian instead, so now there are arm images as well ( not for latest, i need to do more testing, but that will be updated soon too )
https://hub.docker.com/r/openiap/openflow/tags

Hi Allan,
Thank you for the quick reply.

so I am quite new to docker. but if I navigate to the container GUI on the portainer and I inspect the logs of the container demo-api-1 I do see these errors reappearing:

Error: No agentdriver is loaded
    at Message.CustomCommand (/data/Messages/Message.js:5929:27)
    at /data/Messages/Message.js:687:40

and here is a snippet of the entire log:

    at listOnTimeout (node:internal/timers:594:17)
    at process.processTimers (node:internal/timers:529:7) {
  reason: TopologyDescription {
    type: 'ReplicaSetNoPrimary',
    servers: Map(1) { 'mongodb:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: 'rs0',
    maxElectionId: new ObjectId("7fffffff0000000000000007"),
    maxSetVersion: 1,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined,
  [Symbol(errorLabels)]: Set(0) {}
}
MongoServerSelectionError: getaddrinfo ENOTFOUND mongodb
    at Timeout._onTimeout (/data/node_modules/mongodb/lib/sdam/topology.js:292:38)
    at listOnTimeout (node:internal/timers:594:17)
    at process.processTimers (node:internal/timers:529:7) {
  reason: TopologyDescription {
    type: 'ReplicaSetNoPrimary',
    servers: Map(1) { 'mongodb:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: 'rs0',
    maxElectionId: new ObjectId("7fffffff0000000000000007"),
    maxSetVersion: 1,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined,
  [Symbol(errorLabels)]: Set(0) {}
}
MongoServerSelectionError: getaddrinfo ENOTFOUND mongodb
    at Timeout._onTimeout (/data/node_modules/mongodb/lib/sdam/topology.js:292:38)
    at listOnTimeout (node:internal/timers:594:17)
    at process.processTimers (node:internal/timers:529:7) {
  reason: TopologyDescription {
    type: 'ReplicaSetNoPrimary',
    servers: Map(1) { 'mongodb:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: 'rs0',
    maxElectionId: new ObjectId("7fffffff0000000000000007"),
    maxSetVersion: 1,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined,
  [Symbol(errorLabels)]: Set(0) {}
}
MongoServerSelectionError: getaddrinfo ENOTFOUND mongodb
    at Timeout._onTimeout (/data/node_modules/mongodb/lib/sdam/topology.js:292:38)
    at listOnTimeout (node:internal/timers:594:17)
    at process.processTimers (node:internal/timers:529:7) {
  reason: TopologyDescription {
    type: 'ReplicaSetNoPrimary',
    servers: Map(1) { 'mongodb:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    setName: 'rs0',
    maxElectionId: new ObjectId("7fffffff0000000000000007"),
    maxSetVersion: 1,
    commonWireVersion: 0,
    logicalSessionTimeoutMinutes: null
  },
  code: undefined,
  [Symbol(errorLabels)]: Set(0) {}
}
11:47:42.922 [Message              ][]                      Not signed in, and missing jwt
11:47:42.923 [Message              ][]                      Not signed in, and missing jwt
11:47:42.923 [Message              ][]                      Not signed in, and missing jwt
11:47:42.923 [Message              ][]                      Not signed in, and missing jwt
11:47:42.924 [Message              ][]                      Not signed in, and missing jwt
11:47:42.924 [Message              ][]                      Not signed in, and missing jwt
11:47:42.924 [Message              ][]                      Not signed in, and missing jwt
11:47:42.925 [Message              ][]                      Not signed in, and missing jwt
11:47:42.925 [Message              ][]                      Not signed in, and missing jwt
11:47:42.925 [Message              ][]                      Not signed in, and missing jwt
11:47:42.926 [Message              ][]                      Not signed in, and missing jwt
11:47:42.926 [Message              ][]                      Not signed in, and missing jwt
11:47:42.926 [Message              ][]                      Not signed in, and missing jwt
11:47:42.927 [Message              ][]                      Not signed in, and missing jwt
11:47:42.927 [Message              ][]                      Not signed in, and missing jwt
11:47:42.927 [Message              ][]                      Not signed in, and missing jwt
11:47:44.8   [process              ][processTicksAndRejections] Not signed in, and missing jwt
11:47:46.9   [process              ][processTicksAndRejections] Not signed in, and missing jwt
11:47:48.10  [process              ][processTicksAndRejections] Not signed in, and missing jwt
11:47:50.10  [process              ][processTicksAndRejections] Not signed in, and missing jwt
11:47:52.11  [process              ][processTicksAndRejections] Not signed in, and missing jwt
11:47:54.11  [process              ][processTicksAndRejections] Not signed in, and missing jwt

I am not sure where the Logger.ts is located.

Let me know if you need more information

That is awesome so if I just rerun the default normal-up.sh it should fetch the ARM image, right? I will try that and keep you updated :slight_smile:

So it fixed the agendriver error. However when I am trying to create the NodeRED instance in openflow it keeps restarting and my log for the node red instance will look like this.
is this because the nodredagent here:

also needs an image for the arm arcitechture?
when I create a NodeRED instance it shows up in my portainer, but it keeps restartig and spitting this error:
image

I suspect this is architecture incompatibilities as well

That is odd, why would it refuse to load the OpenFlow image for amd64 but allow it for the Node-RED image?

Anyway, it will take some time for me to prepare the Node-RED image for ARM as well, since I will need to also update the NodeAgent image.

I thought it made sense as it spins up a NodeRED instance based on the noderedagent image it has in the container which is not compatible with the ARM? im not sure if my understanding is correct but I

ran this modified script of the normal-up.sh:

#!/bin/sh
docker pull --platform linux/arm64 openiap/noderedagent:latest
docker pull --platform linux/arm64 openiap/nodeagent:latest
docker compose -f docker-compose.yml -p demo up -d

and since there is no image for the ARM it will just get the AMD one instead.

the openflow image is also explicitly referred to in the yml maybe that is why.

But im quite new to docker so this is unknown territory to me

when will there be an ARM version of both the nodeagent and noderedagent-image available? :slight_smile:

I think it should be possible to create the images myself, so i will try that :slight_smile:

This is going to be a little more tricky than I had hoped.
I installed micromamba using the Dockerfile, and since that is architecture-specific, it gets tricky.

I tried to work around that in openiap/nodeagent:0.0.111-4 (hub) and then used that to build openiap/noderedagent:1.5.9-2 (hub).

I have not tested any of those, so you will be my beta tester on those now. Please let me know if they work.

P.S.: you can test them by going to config, then “all,” go to the agent images section, copy the current value into Notepad, then copy or add a new agent that uses the above image tags, then paste that into the image field… if it saves successfully, then reload the browser, you can now select the new agent image under agents

so I now have the image for arm64 for both nodeagent and noderedagent but when I try to create a nodeRED in openflow it keeps saying missing and then it gets the image for the incorrect architecture (amd) and then it repeats the error message.

what Í am noticing in the image tab on my portainer is that the images are stated as unused:


which from my understanding would suggest that openflow is not referencing the correct images. is this why you mention the manual configurations within openflow?

is this what you are refering to:

I am not quite sure what to do from here

Yes, copy the default value into Notepad. Edit the image for Node-RED to include a tag (openiap/noderedagent:1.5.9-2) and then insert the JSON into the agent_images field.

Aah makes sense, thank you. I will try that and give you an update when i get on my pc.
Is it possible to reconfigure the default it self

Then it’s not really a default anymore :smiley:
The setting you are changing here, is for everyone.

Oh, I didn’t mean for everyone—I was referring specifically to my OpenFlow Docker instance. Or perhaps I’m misunderstanding something, but I thought the defaults were reflected from a specific configuration file within my Docker container. Could you clarify if that’s the case?

No, the default is what I decided is the default; this is hardcoded into OpenFlow and the website.
I often make small adjustments to those; therefore, you should only change things that you know do not need to be the default (like the list of agent images).

aah i see that makes sense. Thank you clarifying this :slight_smile:

so this text field:

is meant to override the defualt list of images displayed when creating a new agent?

I accidentally added a json object to the text field and now i think i have broken my openflow it will not boot up correctly. it is not a big problem i can just recreate it. Just asking out of curiousity :slight_smile:

I am not really sure what I am doing wrong.

I have created this list of agents:

[
  {
    "name": "Agent_amd",
    "image": "openiap/nodeagent",
    "languages": ["nodejs", "python"]
  },
  {
    "name": "Agent_arm",
    "image": "openiap/nodeagent:0.0.111-4",
    "languages": ["nodejs", "python"]
  },
  {
    "name": "Agent+Chromium",
    "image": "openiap/nodechromiumagent",
    "chromium": true,
    "languages": ["nodejs", "python"]
  },
  {
    "name": "NodeRED_amd",
    "image": "openiap/noderedagent",
    "port": 3000
  },
  {
    "name": "NodeRED_arm",
    "image": "openiap/noderedagent:1.5.9-2",
    "port": 3000
  },
  {
    "name": "DotNet 6",
    "image": "openiap/dotnetagent",
    "languages": ["dotnet"]
  },
  {
    "name": "PowerShell 7.3",
    "image": "openiap/nodeagent:pwsh",
    "languages": ["powershell"]
  }
]

I also tried without any formatting, without luck

but in the agent tab the images show as undefined, and there are way more in the list to choose from than there should be I believe:

it looks like it counts each element from every single ‘,

if I insert the list of images I want to choose from I get this:

[{"name":"Agent_amd","image":"openiap/nodeagent","languages":["nodejs","python"]},{"name":"Agent_arm","image":"openiap/nodeagent:0.0.111-4","languages":["nodejs","python"]},{"name":"Agent+Chromium","image":"openiap/nodechromiumagent","chromium":true,"languages":["nodejs","python"]},{"name":"NodeRED_amd","image":"openiap/noderedagent","port":3000},{"name":"NodeRED_arm","image":"openiap/noderedagent:1.5.9-2","port":3000},{"name":"DotNet 6","image":"openiap/dotnetagent","languages":["dotnet"]},{"name":"PowerShell 7.3","image":"openiap/nodeagent:pwsh","languages":["powershell"]}]

My images:

Can you see anything i am doing wrong or do you need me to try out something else to provide you more relevant info if this is issues territory @Allan_Zimmermann

Try opening the config object inside the config collections
entities → select “config” collection → find the object with the name " Base configuration", edit it, and go to “json view” and make sure the agent_images is part of the json object ( and not a string with json )