mage
mage copied to clipboard
[BUG] `periodic.iterate` does not use authentication even when environmental variables are set
Describe the bug
While having authentication enabled in Memgraph, query modules such as periodic.iterate
return a connection error upon trying to be used.
To Reproduce Steps to reproduce the behavior:
- Enable authentication in memgraph
- Attempt to run a module such as
periodic.iterate
- See error returned
Expected behavior Query modules should pass authentication username and password respectively when connecting to memgraph via their respective client libraries.
Screenshots
[2023-11-01 16:33:13.617][Info]Accepted a connection from Bolt: 127.0.0.1:50844
[2023-11-01 16:33:13.617][Info]Using version 4.1 of protocol
[2023-11-01 16:33:13.618][Info]Client connected 'mgclient++/1.4.1'
[2023-11-01 16:33:13.618][Warning]Couldn't authenticate user '' because the user doesn't exist. For more details, visit https://memgr.ph/auth.
[2023-11-01 16:33:13.618][Info]Bolt client 127.0.0.1:50844 closed the connection.
[2023-11-01 16:33:14.001][Error]Session error: Connection reset by peer
[2023-11-01 16:33:14.001][Error]Session shutdown failed: Transport endpoint is not connected [system:107]
[2023-11-01 16:33:14.001][Trace]Error message: periodic.iterate: Unable to connect to client!
[2023-11-01 16:33:14.002][Trace]Reset received
Additional context
Upon seeing the ExecuteRunningQuery
method in periodic_iterate.cpp
module file, no authentication parameters are passed to the connection:
mg::Client::Params session_params{.host = "localhost", .port = 7687};
auto client = mg::Client::Connect(session_params);
@ccueto36 added a PR which should fix this https://github.com/memgraph/mage/pull/407
I have provided a prebuilt version of the module based on this PR to @ccueto36 on Discord.
Hi @ccueto36! Did PR #407 succeed in resolving this issue?
@Josipmrden can this be closed now?
I tested periodic.iterate() with auth on and it works as expected. I am closing this issue and adding it to MAGE 1.16 milestone. @ccueto36 please report if the latest release did not resolve your issue.