Influx db Cloud 2.0

Hi

I am trying to send data to Influx DB Cloud with Node Red. The error I am getting is 405 Not Allowed. I have checked the token has all access and the read and write permissions. I have also checked the Organisation ID. The error is the same with both of the Node Red Influx db nodes.

Any advice appreciated

How have you configured the influx server node?

Are you able to connect using something like MQTT Explorer?

There is no server node, only in out and batch nodes. This is a cloud based Influx DB database, so not sure how MQTT Explorer will help?

Thanks

Sorry, I have been getting two threads mixed up, one MQTT and yours. MQTT Explorer will not help, as you say.

The server node is setup as part of the influx in/out/batch node. Where it says Server . What have you put in there?

I have put the url

"eu-central-1-1.aws.cloud2.influxdata.com/orgs/77777777777"

The 7777's are the organisation id which is replaced with the real one

The only other configurations are the Version which I have set to 2.0 and the Token. I have used the All Access token to avoid permissions issues during testing

Is there some other client s/w you can use to check access to the db from the machine running node-red?

Also can you stop node-red and restart it in a terminal, then try to access the db. Post the full terminal output here (copy/paste the text please, not screenshot).

Hi Colin

Thanks

Error is

ERROR: Write to InfluxDB failed. d [HttpError]: 405 Method Not Allowed : <html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.20.2</center>
</body>
</html>
    at IncomingMessage.<anonymous> (/home/pi/.node-red/node_modules/@influxdata/                                        influxdb-client/src/impl/node/NodeHttpTransport.ts:301:13)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  statusCode: 405,
  statusMessage: 'Method Not Allowed',
  body: '<html>\r\n' +
    '<head><title>405 Not Allowed</title></head>\r\n' +
    '<body>\r\n' +
    '<center><h1>405 Not Allowed</h1></center>\r\n' +
    '<hr><center>nginx/1.20.2</center>\r\n' +
    '</body>\r\n' +
    '</html>\r\n',
  contentType: 'text/html',
  _retryAfter: 0
}
9 Jan 12:00:23 - [error] [influxdb out:6a9057c4f7e147bd] HttpError: 405 Method N                                        ot Allowed : <html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.20.2</center>
</body>
</html>`Preformatted text`

That does not appear to be the output from stopping and starting node red. You should see the Welcome to node red messages.

Also tell us exactly where you are seeing that message?

What node are you using to access the database?

After I stop and restart Node Red the flows start normally. This error messages appears in the console when I sent the data to Influx db Cloud.

I am using the standard Influxdb node with the version set to 2.0

I have also used the Stack hero node which produces the same 405 error in the debug

Both of these nodes work fine with a local Influx db instance

As requested, please post the full startup log up to the error message. Copy/paste the text please, not screenshot. That may tell us something useful. When pasting the text in, use the </> button at the top of the forum entry window and paste it in.

pi@Pi4Neo:~ $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.75:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
10 Jan 16:01:09 - [info]
Welcome to Node-RED
===================
10 Jan 16:01:09 - [info] Node-RED version: v2.1.4
10 Jan 16:01:09 - [info] Node.js  version: v14.18.2
10 Jan 16:01:09 - [info] Linux 5.10.63-v8+ arm64 LE
10 Jan 16:01:09 - [info] Loading palette nodes
10 Jan 16:01:11 - [info] Settings file  : /home/pi/.node-red/settings.js
10 Jan 16:01:11 - [info] Context store  : 'default' [module=memory]
10 Jan 16:01:11 - [info] User directory : /home/pi/.node-red
10 Jan 16:01:11 - [warn] Projects disabled : editorTheme.projects.enabled=false
10 Jan 16:01:11 - [info] Flows file     : /home/pi/.node-red/flows.json
10 Jan 16:01:11 - [info] Server now running at http://127.0.0.1:1880/
10 Jan 16:01:11 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
10 Jan 16:01:11 - [info] Starting flows
10 Jan 16:01:11 - [info] Started flows
ERROR: Write to InfluxDB failed. d [HttpError]: 405 Method Not Allowed : <html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.20.2</center>
</body>
</html>
    at IncomingMessage.<anonymous> (/home/pi/.node-red/node_modules/@influxdata/influxdb-client/src/impl/node/NodeHttpTransport.ts:301:13)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  statusCode: 405,
  statusMessage: 'Method Not Allowed',
  body: '<html>\r\n' +
    '<head><title>405 Not Allowed</title></head>\r\n' +
    '<body>\r\n' +
    '<center><h1>405 Not Allowed</h1></center>\r\n' +
    '<hr><center>nginx/1.20.2</center>\r\n' +
    '</body>\r\n' +
    '</html>\r\n',
  contentType: 'text/html',
  _retryAfter: 0
}
10 Jan 16:01:33 - [error] [influxdb out:6a9057c4f7e147bd] HttpError: 405 Method Not Allowed : <html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.20.2</center>
</body>
</html>

I don't see anything wrong there (apart from the error of course).

Do db reads work?

As I asked previously, Is there some other client s/w you can use to check access to the db from the machine running node-red? That will show whether it is a node-red issue. For example, perhaps the influx docs show a sample curl command you can use to access the db.