node-red: "http request" node "RequestError: connect ECONNREFUSED 127.0.0.1:443"

Current Behavior

With latest image pushed today http request node functionality in Docker seems to break.

I have two scenarios which now have stopped working:

  1. A function node which formats the URL and passes it as msg.url, e.g.
msg.url = "https://api.octopus.energy/v1/gas-meter-points/9999999999/meters/E6E00000000000/consumption/?period_from=2023-08-30T00:00:00.000Z&period_to=2023-09-08T00:00:00.000Z&page_size=1000&group_by=day"
  1. A node which passed msg.payload as {"username":"user@email.com","password":"secretPassw0rd"} and the http request node containing the url as a POST https://api.pod-point.com/v5/auth

both scenarios return RequestError: connect ECONNREFUSED 127.0.0.1:443

I have rolled-back to 3.0.2-14 and the functions work again.

I do have a custom dockerfile as I need fabric installing also.

I notice in the logs for latest

6 Sep 17:36:03 - [info] Node-RED version: v3.1.0
6 Sep 17:36:03 - [info] Node.js  version: v16.20.2
6 Sep 17:36:03 - [info] Linux 6.4.0-0.deb12.2-amd64 x64 LE
6 Sep 17:36:03 - [info] Loading palette nodes
6 Sep 17:36:05 - [info] Dashboard version 3.4.0 started at /ui
(node:7) V8: /data/node_modules/@throneless/libsignal-protocol/build/curve25519_concat.js:20225 Invalid asm.js: Expected shift of word size

which doesn’t get logged when I use 3.0.2-14. however 3.0.2-14 shows the following which latest doesn’t:

Patched https.request function detected. This will break the
HTTP Request node. The original code has now been restored.
This is likely caused by a contrib node including an old version of
the 'agent-base@<5.0.0' module.

which is ironic as 3.0.2-14 http works and latest doesn’t!

Expected Behavior

http request nodes correctly route the http request to the specified service.

Steps To Reproduce

  1. Build node-red with following dockerfile
FROM nodered/node-red
USER root
RUN apk add py3-pip curl busybox-extras
RUN pip3 install fabric
  1. Create a http request node for an API service, either passing msg.url or passing msg.payload credentials, and deploy the flow

Example flow

[
    {
        "id": "2e6a4fbc7fefd8de",
        "type": "http request",
        "z": "04d310a7ec5c4cb0",
        "name": "",
        "method": "GET",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 930,
        "y": 220,
        "wires": [
            [
                "fbba3e72e87b0d51"
            ]
        ]
    },
    {
        "id": "62517e98fb262d7d",
        "type": "inject",
        "z": "04d310a7ec5c4cb0",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 500,
        "y": 220,
        "wires": [
            [
                "8d6cc960f014c193"
            ]
        ]
    },
    {
        "id": "fbba3e72e87b0d51",
        "type": "debug",
        "z": "04d310a7ec5c4cb0",
        "name": "debug 115",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1150,
        "y": 220,
        "wires": []
    },
    {
        "id": "8d6cc960f014c193",
        "type": "function",
        "z": "04d310a7ec5c4cb0",
        "name": "get_price_data",
        "func": "var oct_url = \"https://api.octopus.energy/v1/products/SILVER-2017-1/gas-tariffs/G-1R-SILVER-2017-1-H/standard-unit-rates/?period_from=2023-09-03T00:00:00Z&period_to=2023-09-08T00:00:00Z\"\n\nmsg.url = oct_url;\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 720,
        "y": 220,
        "wires": [
            [
                "2e6a4fbc7fefd8de"
            ]
        ]
    }
]

Environment

  • Node-RED version: v3.1.0
  • Node.js version: v16.20.2
  • npm version:
  • Platform/OS: Linux 6.4.0-0.deb12.2-amd64 x64 LE ( = latest linux/amd64 dockerfile image)
  • Browser: Firefox 116.0.3 (64-bit) Windows 11

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 3
  • Comments: 40 (16 by maintainers)

Most upvoted comments

Now we know which packages we can look for common dependencies and see if we can get them fixed.

node-red-contrib-mqtt-dynamicsub deleted from my prod Node-red, and now everything is working fine.

I have same problem. Is there a workaround for it? here are my packages { “name”: “node-red-project”, “description”: “A Node-RED Project”, “version”: “0.0.1”, “private”: true, “dependencies”: { “node-red-contrib-fitbit”: “~1.0.5”, “node-red-contrib-google-oauth2”: “~0.3.1”, “node-red-contrib-mssql”: “0.0.7”, “node-red-contrib-openai-ubos”: “~1.0.3”, “node-red-contrib-simplepush”: “~1.2.2”, “node-red-contrib-spotify”: “~0.1.3”, “node-red-contrib-string”: “~0.2.2”, “node-red-contrib-tableify”: “0.0.2”, “node-red-contrib-telegrambot”: “~5.2.1”, “node-red-dashboard”: “~2.14.0”, “node-red-node-mysql”: “0.0.19”, “node-red-node-pushover”: “~0.1.1” }, “resolutions”: { “superagent-proxy”: “^2.1.0” } }

I upgraded from nodered/node-red:3.0.0 to nodered/node-red:3.1.0 today on x86_64 and am having the same issues with dynamic URLs presented with .msg. Reverting to 3.0.0 works just fine.

docker image inspect gives the following reduced output. “Id”: “sha256:aad8a8d13b50d89c06f1cf544013ef05e2d5c14b56a0552cb66e3d62f2d6ecc1”, “RepoTags”: [ “nodered/node-red:3.1.0” ],

Default logs show RequestError: connect ECONNREFUSED 127.0.0.1:443, but those URLs don’t point to localhost.