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

getting neo4j url connection error while docker compose #4

Open
ssfd7 opened this issue Apr 25, 2024 · 4 comments
Open

getting neo4j url connection error while docker compose #4

ssfd7 opened this issue Apr 25, 2024 · 4 comments

Comments

@ssfd7
Copy link

ssfd7 commented Apr 25, 2024

Here is the error:
llm-movieagent-api-1 | File "/code/packages/neo4j-semantic-layer/neo4j_semantic_layer/utils.py", line 5, in
llm-movieagent-api-1 | graph = Neo4jGraph()
llm-movieagent-api-1 | ^^^^^^^^^^^^
llm-movieagent-api-1 | File "/usr/local/lib/python3.11/site-packages/langchain_community/graphs/neo4j_graph.py", line 207, in init
llm-movieagent-api-1 | raise ValueError(
llm-movieagent-api-1 | ValueError: Could not connect to Neo4j database. Please ensure that the url is correct

my .env is like:
NEO4J_URI=neo4j://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=****
OPENAI_API_KEY=sk-***

@tomasonjo
Copy link
Owner

Yeah, localhost will not work inside docker. Use NEO4J_URI=neo4j://neo4j:7687 if you are using the provided neo4j in docker

@ssfd7
Copy link
Author

ssfd7 commented Apr 25, 2024

ok - i have made the change above and re-ran docker compose and got the following output:
...
✔ Network llm-movieagent_net Created 0.1s
✔ Container llm-movieagent-neo4j-1 Created 0.2s
✔ Container llm-movieagent-ui-1 Created 0.2s
✔ Container llm-movieagent-api-1 Created 0.2s
Attaching to llm-movieagent-api-1, llm-movieagent-neo4j-1, llm-movieagent-ui-1
llm-movieagent-neo4j-1 | Installing Plugin 'apoc' from /var/lib/neo4j/labs/apoc-*-core.jar to /var/lib/neo4j/plugins/apoc.jar
llm-movieagent-neo4j-1 | Applying default values for plugin apoc to neo4j.conf
llm-movieagent-neo4j-1 | Changed password for user 'neo4j'. IMPORTANT: this change will only take effect if performed before the database is started for the first time.
llm-movieagent-neo4j-1 | 2024-04-25 19:55:32.163+0000 INFO Logging config in use: File '/var/lib/neo4j/conf/user-logs.xml'
llm-movieagent-neo4j-1 | 2024-04-25 19:55:32.205+0000 INFO Starting...
llm-movieagent-neo4j-1 | 2024-04-25 19:55:33.860+0000 INFO This instance is ServerId{9d2576fa} (9d2576fa-b773-4c09-86c3-beadea306446)
llm-movieagent-neo4j-1 | 2024-04-25 19:55:35.294+0000 INFO ======== Neo4j 5.19.0 ========
llm-movieagent-neo4j-1 | 2024-04-25 19:55:39.499+0000 INFO Bolt enabled on 0.0.0.0:7687.
dependency failed to start: container llm-movieagent-neo4j-1 is unhealthy

@ssfd7
Copy link
Author

ssfd7 commented Apr 25, 2024

If I try to run from my docker desktop I am getting this error:
image

@tomasonjo
Copy link
Owner

Just do

docker-compose down

and then restart it with

docker-compose up --build

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