mblackstock / node-red-contrib-influxdb

Node-RED nodes to save and query data from an influxdb time series database
Other
63 stars 42 forks source link

Unexplainable: "Configuration missing" in the influxdb out node #146

Open JorisBloemenIXON opened 1 month ago

JorisBloemenIXON commented 1 month ago

Does anyone have any idea why I get "Configuration missing" when everything is configured? image image I did notice the Token to be shorter after deployment then the one I pasted from InfluxDB. ` I can write to InfluxDB via CURL so the issue seems to be in the influxdb node

simonbuehler commented 3 weeks ago

hi, I have the same issue after a fresh install with a influxdbV2, did you manage to fix this?

JorisBloemenIXON commented 3 weeks ago

For some reason manually setting up everything works, meaning with my docker compose file:

services:
  nodered:
    platform: linux/arm64/v8
    image: nodered/node-red:latest
    volumes:
      - ./nodered/data:/data
    depends_on:
      - influxdb
    links:
      - influxdb
    ports:
      - '127.0.0.1:1880:1880'
    env_file:
      - configuration.env

  influxdb:
    platform: linux/arm64/v8
    image: influxdb:2.7.5-alpine
    env_file: .env
    ports:
      - '127.0.0.1:8086:8086'
    volumes:
      - ./:/imports
      - influxdb_data:/var/lib/influxdb

  grafana:
    image: grafana/grafana:latest
    depends_on:
      - influxdb
    links:
      - influxdb
    ports:
      - '127.0.0.1:3000:3000'
    env_file: .env
    volumes:
      - grafana-data:/var/lib/grafana
      - ./grafana/provisioning:/etc/grafana/provisioning
      - ./grafana/dashboards:/var/lib/grafana/dashboards

volumes:
  influxdb_data:
  nodered-data:
  grafana-data:

and then installing node-red-contrib-influxdb via localhost:1880 and setting up my flows manually

but when you create a custom Dockerfile for nodered, like:

FROM nodered/node-red:latest

# Switch back to node-red user
USER node-red

# Install Node-RED InfluxDB nodes
RUN npm install node-red-contrib-influxdb

# Copy the flow configuration
COPY flows.json /data/flows.json

# Expose Node-RED's default port
EXPOSE 1880

# Set the default command
CMD ["npm", "start"]

This results in the Configuration missing errors, even if you fill in all the required fields manually afterwards

JorisBloemenIXON commented 3 weeks ago

updating my dockerfile to do npm install as root seems to help

FROM nodered/node-red:latest

# Switch to root user
USER root

# Install Node-RED InfluxDB nodes
RUN npm install node-red-contrib-influxdb

# Switch back to node-red user
USER node-red

# Copy the flow configuration
COPY flows.json /data/flows.json

# Expose Node-RED's default port
EXPOSE 1880

# Set the default command with a wait script
# CMD ["sh", "-c", "while ! nc -z influxdb 8086; do sleep 1; done; npm start"]
CMD ["npm", "start"]

now only the Token has to be filled in manually

simonbuehler commented 3 weeks ago

@JorisBloemenIXON thanks for your input, i'm running it on a raspi zero w without docker and the behavior is quite strange, i managed to get it working when first configuring the config node and the out node afterwards , ... quite fishy :grimacing: