Bug report - PostgreSQL connector is not taking into account password coming from flow variable

In KNIME AP 5.4.0 (same issue in Knime AP 5.3.2), I am getting an error in PostgreSQL node when loading password in Authentication > Username & Password > Password from a flow variable. It looks like default value in Connection Setting tab is not getting updated by the flow variable.


I know it is unsafe to pass passwords as string to a node but, as the option is available, I expect it to work.
Is there something else I am missing here?

Thanks for the report - moved this to Feedback section so the KNIME team can pick it up.

Hi @szawadski , I haven’t tried this with postgres and I don’t have it installed to see if it works for me but I have a couple of questions which may assist others in helping.

What error are you actually getting? Apologies if I am being blind and just haven’t seen where you wrote it.

Also, if you do pass the username and password as a credentials object instead, does it then connect? (Just checking for any other config issue)
e.g.

or alternatively, as you already have variables
image

2 Likes

The error I get is “wrong username/password”.
I have actually built a custom component with a table with various host/db/user/password for various environments that allows me to switch easily between environments.
I also observed that, when I switch between different environments where the password is the same as in default config, it works. It’s only when I switch to an environment wjth a different password that I observe that the flow variable is not overwriting the default value while the other variables seems overwritten.


image
image
@takbb : Tried your approach using var to credentials node and it works fine. It also allows to hide the password outside of the component.

But the bug in PostgreSQL connector node remains…

Hello @szawadski ,
you cannot directly control the password field via a flow variable. Instead you have to select a credentials flow variable in the Credentials option of the Authentication section as described by @takbb above. If you have the password as string please use the Variable to Credentials node as explained above.

The reason is that the password is stored encrypted in the node settings but your flow variable is not encrypted but contains the plain text string which the node will try to decode and thus changing it prior sending it to Postgres.

Bye
Tobias

6 Likes

Thanks for the clarification. Solution proposed by @takbb works.

1 Like