Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run queries from files but can interactively #80

Closed
cmhac opened this issue Aug 19, 2024 · 2 comments
Closed

Unable to run queries from files but can interactively #80

cmhac opened this issue Aug 19, 2024 · 2 comments

Comments

@cmhac
Copy link

cmhac commented Aug 19, 2024

I'm Unable to run Memgraph queries using the mgconsole tool when executing queries from a file. The same queries work fine when run interactively through mgconsole.

Steps to Reproduce

  1. Create a file containing a valid Memgraph query.
  2. Run the query file using the mgconsole tool (e.g., mgconsole < query_file.mg).
  3. Observe that the queries do not execute, and no error messages are shown in the logs.

The following works fine:

  1. Copy the contents of the query from the file
  2. Paste it into mgconsole

Example logs:

[2024-08-19 18:49:13.574][Info]Accepted a connection from Bolt: 127.0.0.1:50490
[2024-08-19 18:49:13.615][Info]Using version 4.1 of protocol
[2024-08-19 18:49:13.616][Info]Client connected 'mg/1.4'
[2024-08-19 18:49:13.616][Warning]The client didn't supply the principal field! Trying with ""...
[2024-08-19 18:49:13.616][Warning]The client didn't supply the credentials field! Trying with ""...
[2024-08-19 18:49:13.781][Info]Starting snapshot creation to /var/lib/memgraph/snapshots/20240819184913781156_timestamp_1843
[2024-08-19 18:49:13.785][Trace]Storage GC on 'memgraph' started [periodic]
[2024-08-19 18:49:13.786][Trace]Storage GC on 'memgraph' finished [periodic]
[2024-08-19 18:49:13.881][Info]Snapshot creation successful!
[2024-08-19 18:49:15.798][Debug][Run - memgraph] 'SHOW REPLICATION ROLE'
[2024-08-19 18:49:15.801][Debug][Run - memgraph] 'SHOW REPLICAS'
[2024-08-19 18:49:15.807][Debug][Run - memgraph] 'SHOW INDEX INFO'
[2024-08-19 18:49:15.807][Debug][Run - memgraph] 'SHOW CONSTRAINT INFO'
[2024-08-19 18:49:15.807][Debug][Run - memgraph] 'SHOW TRIGGERS'
[2024-08-19 18:49:16.221][Debug][Run - memgraph] 'SHOW VERSION'
[2024-08-19 18:49:29.027][Info]Session closed by peer 127.0.0.1:50490

The only indication something is wrong is the message "Session closed by peer." The IP address appears to change every time the command is run.

Environment

  • OS: macOS 14.6.1 (23G93)
  • mgconsole version: 1.4
  • Memgraph version: 2.19.0
  • Docker version: 26.1.1, build 4cf5afa
  • Hardware: M3 MacBook Pro
@cmhac
Copy link
Author

cmhac commented Aug 19, 2024

Apologies, was not actually mgconsole related

@cmhac cmhac closed this as completed Aug 19, 2024
@gitbuda
Copy link
Member

gitbuda commented Aug 20, 2024

@cmhac Still, thanks a lot for reporting! If there is anything we could improve on the mgconsole side just create a new issue, e.g. we've recently created #79 -> any specific ideas there are extremely welcome! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants