mage
mage copied to clipboard
do.when procedure fails with authentication on
Steps to reproduce: Run Memgraph & create user. Log in with the user. Run
CALL do.when(true,
"return true as a",
"return false as a")
YIELD value
RETURN *
Expected behavior - result is the same as without the user created:
{
"a": true
}
Actual behavior:
Query failed - do.when: Unable to connect to client!
Logs:
[2023-11-30 08:14:18.096][Info]Bolt client 127.0.0.1:35404 closed the connection.
[2023-11-30 08:14:18.097][Trace]Error message: do.when: Unable to connect to client!
[2023-11-30 08:14:18.098][Trace]Reset received
Because of the bug with authentication, this happens on Memgraph Cloud as a default behavior. The user also reported experiencing this on his private VPS without authentication. I'll need to learn more about that.
I reproduced it on Cloud too. Logs from the Cloud:
[2023-11-28 16:16:34.458][Debug][Run - memgraph] 'CALL do.when(true, "return true as a", "return false as a") YIELD value RETURN *'
[2023-11-28 16:16:34.485][Info]Accepted a connection from BoltS: 127.0.0.1:42050
[2023-11-28 16:16:34.485][Error]Session error: wrong version number (SSL routines, ssl3_get_record)
[2023-11-28 16:16:34.485][Trace]Error message: do.when: Unable to connect to client!
[2023-11-28 16:16:34.511][Trace]Reset received
Toni mentioned this:
As far as I can see it is not checking if SSL is on/off - which is a difference from the Cloud deployment vs local deployment. The issue is around authentication, but I think it is SSL (isEncrypted connection) because the MAGE code picks up username/password - I am not 100% sure if that even works but in general it is auth + SSL.
Conclusion: module should inherit Memgraph config set in any way (env or config or via query).
Related to #406
I3 - We didn't have a lot of reports for this; that is, there were not a lot of users for this module. S2 - Whoever uses this module with auth and Cloud users can't use it. Some users might have a workaround.
Thanks for reporting the issue! Since this is related to #406, I’ve asked the user who opened that issue if PR #407 has succeeded in resolving the issue.
Related to https://github.com/memgraph/mage/issues/214
@Josipmrden can this be closed now?
Should be resolved but I didn't test this behaviour
Works both locally with the user created and on Cloud by default. Adding this to milestone 1.16 and closing the issue.