aws / graph-explorer

React-based web application that enables users to visualize both property graph and RDF data and explore connections between data without having to write graph queries.
https://github.com/aws/graph-explorer
Apache License 2.0
299 stars 46 forks source link

Can't synchronize graph database #408

Open lingvisa opened 1 month ago

lingvisa commented 1 month ago

Description

I deployed graph-explorer on my local Mac computer following the instruction. After I start the docker container with "docker run -p 80:80 -p 443:443 --env HOST=localhost graph-explorer", the messages seem to be wrong:

docker run -p 80:80 -p 443:443 --env HOST=localhost graph-explorer
Generating new self-signed SSL cert using localhost...
..+...+...........+......+...+.+.....+......+......+.........+.+...+..+.........+...+.+...........+....+......+........+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+.........+.+.....+.......+..+.......+...+........+...+..........+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.........+...+...+..+.......+..+....+...............+..........................+.+..+......+.+...........+...+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+..........+.....+.......+..+............+.+.....+.......+...........+......+.+...+.....+....+..+..........+...+.....+.+.....+.........+.+.....+....+...........+.+........+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+...+......+.+.................+...+.........+......+...+............+.........+.............+.....+...+....+...........+...+...............+.......+..............+...+......+....+...+........+........................+......+...............+.+......+..+.+.....+.+......+..+...+...+.+........+.....................+............+....+.........+..+.......+.....+.+......+...+.....+.+..............+...+.........+...+...+....+...+...............+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
Certificate request self-signature ok
subject=C = US, ST = Washington, L = Seattle, O = Graph Explorer, CN = Graph Explorer
Starting graph explorer...

> graph-explorer@1.7.0 start:proxy-server /graph-explorer
> pnpm -F graph-explorer-proxy-server start

> graph-explorer-proxy-server@1.7.0 start /graph-explorer/packages/graph-explorer-proxy-server
> node node-server.js

[18:22:23.092] INFO (39): Proxy server located at https://localhost
**[18:22:23.092] INFO (39): Graph Explorer live at: undefined/explorer**

As you can see the last line, "Graph Explorer live at: undefined/explorer"

After a connection is created, I was unable to "synchronize database". I click the synchronize button, it just give a very short 'can't synchronize database' message, nothing else.

Environment

Steps to Reproduce

  1. docker run -p 80:80 -p 443:443 --env HOST=localhost graph-explorer: see the "undefined/explorer " message
  2. Click on 'synchronize database': you will see the can't synchronize database error

Expected Behavior

I should be able to synchronize database


[!IMPORTANT] If you are interested in working on this issue or have submitted a pull request, please leave a comment.

[!TIP] Please use a 👍 reaction to provide a +1/vote.

This helps the community and maintainers prioritize this request.

kmcginnes commented 1 month ago

Hi @lingvisa. Thank you for your submission.

You might check out issue #402 as it seems very similar to your situation. Although, your issue is unique since you are using Blazegraph.

We are also tracking some improvements to the setup process in the following issue.

If anything changes in your scenario, please let me know.

lingvisa commented 1 month ago

Hi, @kmcginnes I executed these two commands:

docker pull public.ecr.aws/neptune/graph-explorer:latest $ docker run -dit -p 443:443 --name mygraphexplorer --env HOST=localhost public.ecr.aws/neptune/graph-explorer:latest

I don't use security certificate, but just click "advanced" and "proceed", then in my browser, I can't sychronize database:

Screenshot 2024-05-20 at 9 22 54 AM
kmcginnes commented 1 month ago

It looks like your database URL is:

http://127.0.0.1:9999/blazegraph/namespace/kg4hana/sparql

Try without the /sparql on the end.

http://127.0.0.1:9999/blazegraph/namespace/kg4hana
lingvisa commented 1 month ago

Hi, @kmcginnes, as you can see, I only executed the two commands you provided. I didn't use explicitly specify "http://127.0.0.1:9999/blazegraph/namespace/kg4hana/sparql" anywhere, which is my blazegraph endpoint. So how can I change this parameter?

triggan commented 1 month ago

Modify your connection using the pencil button in the top right corner (see screen shot). Change the endpoint there to remove /sparql from the end of the endpoint.

image

kmcginnes commented 1 month ago

@lingvisa Any update on this? Were you able to connect?

lingvisa commented 1 month ago

Hi, @kmcginnes I will get back to you shortly!

lingvisa commented 1 month ago

I am following this instruction: https://github.com/aws/graph-explorer/blob/main/additionaldocs/getting-started/README.md#local-docker-setup

I am working on my local Mac with a Docker Desktop. The first question is: 1) I don't need the Step 1, "Authenticate with the Amazon ECR Public Registry". Is that right? I don't have an AWS account yet. 2) Step 2 is fine. 3) Step 3: after I ran the command, you can see the message above i pasted. In particular, see the last line: [18:22:23.092] INFO (39): Proxy server located at https://localhost [18:22:23.092] INFO (39): Graph Explorer live at: undefined/explorer****

Is the 'undefined' normal?

4) Step 4: after I ran 4), in the browser, it shows "Your connection is not private", then I click "advanced" ---> "Proceed to localhost (unsafe)", I was able to see the graph-exploer UI, but with the message: "Synchronization Required It is necessary to synchronize the connection to be able to work with the database. Start synchronization

5) After I click "Start synchronization", I got an error message below: "Something went wrong. An error occurred. please try again"

I modified the URL by remove 'kg4hana', but it didn't help.

Thank you.

kmcginnes commented 4 weeks ago

@lingvisa The step for "Authenticate with the Amazon ECR Public Registry" I added because it was necessary for me to do before I was allowed to pull the docker image from Amazon ECR. It's possible it isn't necessary since it sounds like you were able to pull the image just fine.

The "undefined" is ok. It is the result of a bug that was recently fixed in PR #416. The log message was using the environment value GRAPH_CONNECTION_URL which is not required to provide. So it is typically "undefined" for most people.

kmcginnes commented 4 weeks ago

As for the sync issue, you mention

I modified the URL by remove 'kg4hana', but it didn't help.

Does that mean your connection URL was this?

http://127.0.0.1:9999/blazegraph/namespace/sparql

Instead, please try changing the URL to be this instead:

http://127.0.0.1:9999/blazegraph/namespace/kg4hana
lingvisa commented 4 weeks ago

Hi, @kmcginnes I tried both: http://127.0.0.1:9999/blazegraph/namespace/kg4hana http://127.0.0.1:9999/blazegraph/namespace/

But they are the same. So must be due to something else.

lingvisa commented 3 weeks ago

@kmcginnes does the tool depend on a particular graph database? If not, it may be a minor issue? It would be great if you can install blazeGraph to have a test and troubleshoot, and this may help to solve other similar issues if users use other graph databases.

kmcginnes commented 3 weeks ago

@lingvisa sorry for the delay. I do plan to install BlazeGraph and run through the setup to see if there is something specific we are missing. I just haven't had a chance yet.

I have added this to my list of things to do middle of next week.

If you just want to try out Graph Explorer, I highly recommend using Gremlin Server as the database. I recently updated those instructions so they should be solid.

https://github.com/aws/graph-explorer/blob/main/additionaldocs/connections.md#connecting-to-gremlin-server

lingvisa commented 3 weeks ago

Hi, @kmcginnes It would be great if you can do middle of next week.

kmcginnes commented 3 weeks ago

@lingvisa I am currently struggling my way through setting up BlazeGraph. It is not a smooth experience.

Before I waste too much time spinning my wheels, is there a particular reason you chose to use BlazeGraph? It seems like it is no longer maintained.

If you must use BlazeGraph, how do you have it set up? Can you connect to your instance over HTTP using something like curl? Graph Explorer can only access DB's through HTTP.

kmcginnes commented 2 weeks ago

I was able to enlist the help of some experts to get BlazeGraph working locally on my system. I used the following Docker command to get it running:

docker run --name blazegraph -d -p 8889:8080 triggan/blazegraph-server:2.1.5

Once I accomplished that I loaded up Graph Explorer and created the connection for it. Which synced just fine, albeit with no data since this is a new database.

CleanShot 2024-06-14 at 13 47 47@2x

I initially tried without the proxy server. But that resulted in a CORS violation. That is something I need to look in to further. I'm going to create a separate bug issue for that.

For now, @lingvisa, I suggest using the proxy server. Your proxy server setting when using the Docker hosted image should be:

https://localhost

Let me know if this helps.