memgraph / memgraph-platform

Memgraph Platform is a multi-container application containing Memgraph+MAGE and Memgraph Lab.
Apache License 2.0
21 stars 1 forks source link

Starts but doesn't connect #60

Closed ctron closed 1 year ago

ctron commented 1 year ago

I am trying to try out memgraph, executing the provided command with podman starts up the container:

$ podman run --rm -it -p 7687:7687 -p 7444:7444 -p 3000:3000 docker.io/memgraph/memgraph-platform
Memgraph Lab is running at localhost:3000

mgconsole 1.3
Connected to 'memgraph://127.0.0.1:7687'
Type :help for shell usage
Quit the shell by typing Ctrl-D(eof) or :quit
memgraph>

But connecting to the frontend (http://localhost:3000) reports that the installation cannot be found ("Memgraph Not Detected").

I can see the frontend pinging the backend, receiving a status of:

{"data":{"isConnectionAlive":false}}

Other than that, I have no idea what is going on.

katarinasupe commented 1 year ago

Hi @ctron, the firewall of your desktop computer may block access to your Memgraph instance. To debug that, you could temporarily disable the firewall on the desktop with sudo ufw disable, then test the connection from your laptop, and afterward activate the firewall with sudo ufw enable. If the firewall is the cause, then you can modify the rules of the firewall. Let me know if that helps 🙏

ctron commented 1 year ago

Thanks for the help.

As I am using firewalld, I used sudo systemctl stop firewalld to stop the firewall. I did restart the pod afterwards, resulting in the same behavior.

Are there any logs to debug? Or ports to check?

tonilastre commented 1 year ago

Hi @ctron!

In this memgraph-platform container there are actually three processes running via supervisord: Lab, Memgraph, and mgconsole. I think the Memgraph failed to start. To check that can you just run any Cypher command (e.g. MATCH (n) RETURN n LIMIT 10;) in the mgconsole that opens up when you start a container:

mgconsole 1.3
Connected to 'memgraph://127.0.0.1:7687'
Type :help for shell usage
Quit the shell by typing Ctrl-D(eof) or :quit
...
memgraph> MATCH (n) RETURN n LIMIT 10;

I am curious to see if this works when the Lab shows that there is no connection.

Btw, regarding logs, you can find Memgraph logs in the container directory /var/log/memgraph/.... Feel free to send it out if you see any issues there.

ctron commented 1 year ago

That gives me:

memgraph> MATCH (n) RETURN n LIMIT 10;
Empty set (round trip in 0.000 sec)
memgraph> 

I will try to find the logs.

ctron commented 1 year ago

These are the logs:

root@45f8f3cb3c31:/var/log/memgraph# cat memgraph_2023-07-14.log 
[2023-07-14 15:22:07.847] [memgraph_log] [warning] Invalid license key string. To use Enterprise features please set it to a valid string using the following query:
SET DATABASE SETTING "enterprise.license" TO "your-license-key"
[2023-07-14 15:22:07.849] [memgraph_log] [warning] No snapshot or WAL file found. For more details, visit https://memgr.ph/durability.
[2023-07-14 15:22:09.945] [memgraph_log] [error] Unable to load module "/usr/lib/memgraph/query_modules/example_cpp.so"; /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/memgraph/query_modules/example_cpp.so). For more details, visit https://memgr.ph/modules.
[2023-07-14 15:22:09.946] [memgraph_log] [warning] Using non-secure Bolt connection (without SSL). For more details, visit https://memgr.ph/ssl.
tonilastre commented 1 year ago

Just want to update you that we replicated the same issue. The Lab just can't see Memgraph - it is something tied to a combination of libraries that the Lab uses and podman container environment. We are checking it and we will let you know how it goes!

tonilastre commented 1 year ago

Hi @ctron,

TLDR: Replace localhost with 127.0.0.1 and you will be able to connect to your Memgraph from within Lab. Check the screenshot below (this is the latest version of memgraph-platform):

Screenshot 2023-08-08 at 09 44 56


Issue: So, here is what happened. Lab "Quick connect" feature checks for Memgraph on localhost:7687. But the problem is that within the Podman container localhost resolves to IPv6 ::1 and Lab tries to connect to ::1:7687 and that is the reason why it doesn't see Memgraph. Memgraph is listening on IPv4 0.0.0.0 by default.

Mgconsole - the terminal input/output that you have when running memgraph-platform actually connects to 127.0.0.1, thus it is able to connect to Memgraph.

The fixes that we will work on are:

In the meantime, you can connect by replacing the localhost with 127.0.0.1. New Lab (2.8.0), also present in the latest memgraph-platform contains a feature to keep track of recent connections so you will need to type 127.0.0.1 only once and use the recent connection from that point on for the single click connect.

ctron commented 1 year ago

Thanks for the update. I can confirm that this indeed resolves the issue for me. Many thanks!