🎉 Node-RED 2.0.3 Released

Node-RED 2.0.3 is now available.

This sweeps up a number of fixes for the HTTP Request node:


My live server moved over from 1.3.5 to 2.0.3 and all seems well.

With version 2.0.2 everything worked perfectly for me. After updating to version 2.0.3, HTTP search queries via the Spotify API suddenly no longer returned any results: no error occurred (statusCode: 200), but there were never any search hits (tracks.total = 0). Therefore, I have now (successfully) rolled back to version 2.0.2.

@ohrenweide could you share some more specific details so we can investigate?

[{"id":"6eebf8b7e1230fe3","type":"function","z":"646f539c81d60090","name":"Suchbegriff ermitteln","func":"msg.url='https://api.spotify.com/v1/search?q=assassin%20john%20mayer%20NOT%20karaoke%20NOT%20arcade&type=track'\n\nmsg.headers = {\n    'Accept': 'application/json',\n    'Content-Type' : 'application/json',\n    'Authorization' : 'Bearer ' + global.get(\"spotify_access_token\")\n};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"he","module":"he"}],"x":510,"y":220,"wires":[["3baf8b9997ee57c5"]]},{"id":"3baf8b9997ee57c5","type":"http request","z":"646f539c81d60090","name":"Titelsuche ausführen (Spotify API)","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","credentials":{},"x":800,"y":220,"wires":[["c1b1d366e7af776c"]]},{"id":"f0f97fad1ab353c1","type":"inject","z":"646f539c81d60090","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":320,"y":220,"wires":[["6eebf8b7e1230fe3"]]},{"id":"c1b1d366e7af776c","type":"debug","z":"646f539c81d60090","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1070,"y":220,"wires":[]}]

This simplified flow works with 2.0.2 but doesn't work with 2.0.3
Please let me know what else would help you to investigate.

Hi @ohrenweide

the workaround for you is to change the url to:

msg.url='https://api.spotify.com/v1/search?q=assassin john mayer NOT karaoke NOT arcade&type=track'

An issue had been identified between 1.x and 2.x where a url with non-url safe characters in was now being rejected by the node. The fix for that in 2.0.2 meant we would url-encode the url to make sure it was safe.

However, you've highlighted this will break urls that already have escaped entities in (the %20 in place of ' ') - because the % will get doubly escaped.

Hence the workaround to change the %20 back to ' ' in the url you pass in.

Once we get the proper fix in 2.0.4, your code should continue unaffected with either format.

1 Like

Thanks for investigating and fixing this so fast. I will wait for 2.0.4 then.

This simple flow does not work for me in any 2.0.1, 2.0.2, 2.0.3 but it works in 1.3.5

[{"id":"6e52b77106dbf0a5","type":"postgres","z":"d053359ce32d4637","postgresdb":"52553d9bbf1a0ae3","name":"pg3","output":true,"perrow":false,"rowspermsg":"1","return_on_error":false,"limit_queries":"0","limit_by":"payload","limit_value":"1","limit_drop_intermediate":false,"limit_drop_if_in_queue":false,"outputs":true,"x":270,"y":100,"wires":[["d2aeca35f144cc15"]]},{"id":"d2aeca35f144cc15","type":"debug","z":"d053359ce32d4637","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":470,"y":100,"wires":[]},{"id":"714ae184092c9dc0","type":"inject","z":"d053359ce32d4637","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"select * from wind_speed order by dt desc limit 10","payloadType":"str","x":80,"y":100,"wires":[["6e52b77106dbf0a5"]]},{"id":"52553d9bbf1a0ae3","type":"postgresdb","cfgname":"pgsql3","hostname":"my.private.url","port":"5432","db":"weather_stations","ssl":false}]

I don't know if it is a bug in postgres node or in node-red > v2.x.x.

What if any errors are shown in the logs when you run it?

Nothing at all !!!

Which postgres node? there are several on flows. Also the problem is without a postgress database to test against, it's going to be hard to track this down.

I suggest you raise this against the node it's self first as hopefully they will be in a better place to debug this and then raise it against the core project if it is not a problem with the node it's self.

the node is "node-red-contrib-re-postgres".
I have tried also " node-red-contrib-mydb" and another one which I don't remember (I think "node-red-contrib-postgrestor-next"), with no results.
All the above worked perfecty in v1.3.5

Can you share more details on how you're running Node-RED? What version of nodejs etc?

I have installed it in docker in two systems. A raspberry pi and a hosted VPS. Both have the same results. The installation is fresh. No other nodes are installed. Only the node to access postgresql.
In docker container console:

bash-5.0$ npm --version
bash-5.0$ node --version

Can we get a better description of "doesn't work".

I've pulled a standard docker postgres image and used the command line tools to create a "weather_stations" database with a table called "wind_speed" with a column called "dt" and I get the following in the logs:

25 Jul 18:18:18 - [error] [postgres:pg3] error: relation "wind_speed" does not exist
error: relation "wind_speed" does not exist
    at Connection.parseE (/opt/share/playing/node-red/test/testUserDir/node_modules/pg/lib/connection.js:614:13)
    at Connection.parseMessage (/opt/share/playing/node-red/test/testUserDir/node_modules/pg/lib/connection.js:413:19)
    at Socket.<anonymous> (/opt/share/playing/node-red/test/testUserDir/node_modules/pg/lib/connection.js:129:22)
    at Socket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
  length: 109,
  severity: 'ERROR',
  code: '42P01',
  detail: undefined,
  hint: undefined,
  position: '15',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_relation.c',
  line: '1376',
  routine: 'parserOpenTable'
select * from wind_speed order by dt desc limit 10

Doesn't work means that there is nothing at the output of debug node. Not in nodered logs. Like nothing is happening when I click inject node.
If you want I can give you the credentials in a PM to access my postgres db.

Must admit when I tried the Postgres-re node recently and it failed I just moved on and used another. It was the digitaloak one I used I think

ok. I will try it and report back. Thank you!

Finally !!!! This node works. THANK YOU !!!

Inject Node : Pop down window does not match the injected value, when using the inject now.

Having deployed the inject node with one value, this is the value that appears on the pop down window, even if we changed it and use the inject now box.