Neo4j - ConfigurationError: username not supported in the URI
Labels: name: auto:bug, name: area: models

### System Info

Langchain==0.0.338
python==3.8.1
neo4j latest

this is the error:

---------------------------------------------------------------------------
ConfigurationError                        Traceback (most recent call last)
[/Users/m1/Desktop/LangChain/Untitled.ipynb](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/Untitled.ipynb) Cell 1 line 5
      [2](vscode-notebook-cell:/Users/m1/Desktop/LangChain/Untitled.ipynb#W0sZmlsZQ%3D%3D?line=1) import os
      [4](vscode-notebook-cell:/Users/m1/Desktop/LangChain/Untitled.ipynb#W0sZmlsZQ%3D%3D?line=3) uri, user, password = os.getenv("NEO4J_URI"), os.getenv("NEO4J_USERNAME"), os.getenv("NEO4J_PASSWORD")
----> [5](vscode-notebook-cell:/Users/m1/Desktop/LangChain/Untitled.ipynb#W0sZmlsZQ%3D%3D?line=4) graph = Neo4jGraph(
      [6](vscode-notebook-cell:/Users/m1/Desktop/LangChain/Untitled.ipynb#W0sZmlsZQ%3D%3D?line=5)     url=uri,
      [7](vscode-notebook-cell:/Users/m1/Desktop/LangChain/Untitled.ipynb#W0sZmlsZQ%3D%3D?line=6)     username=user,
      [8](vscode-notebook-cell:/Users/m1/Desktop/LangChain/Untitled.ipynb#W0sZmlsZQ%3D%3D?line=7)     password=password,
      [9](vscode-notebook-cell:/Users/m1/Desktop/LangChain/Untitled.ipynb#W0sZmlsZQ%3D%3D?line=8) )

File [~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/langchain/graphs/neo4j_graph.py:69](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/langchain/graphs/neo4j_graph.py:69), in Neo4jGraph.__init__(self, url, username, password, database)
     [66](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/langchain/graphs/neo4j_graph.py:66) password = get_from_env("password", "NEO4J_PASSWORD", password)
     [67](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/langchain/graphs/neo4j_graph.py:67) database = get_from_env("database", "NEO4J_DATABASE", database)
---> [69](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/langchain/graphs/neo4j_graph.py:69) self._driver = neo4j.GraphDatabase.driver(url, auth=(username, password))
     [70](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/langchain/graphs/neo4j_graph.py:70) self._database = database
     [71](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/langchain/graphs/neo4j_graph.py:71) self.schema: str = ""

File [~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/_sync/driver.py:190](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/_sync/driver.py:190), in GraphDatabase.driver(cls, uri, auth, **config)
    [170](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/_sync/driver.py:170) @classmethod
    [171](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/_sync/driver.py:171) def driver(
    [172](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/_sync/driver.py:172)     cls, uri: str, *,
ref='~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/_sync/driver.py:0'>0</a>;32m   (...)
    [177](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/_sync/driver.py:177)     **config
    [178](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/_sync/driver.py:178) ) -> Driver:
...
--> [486](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/api.py:486)     raise ConfigurationError("Username is not supported in the URI")
    [488](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/api.py:488) if parsed.password:
    [489](https://file+.vscode-resource.vscode-cdn.net/Users/m1/Desktop/LangChain/~/Desktop/LangChain/KG_openai/lib/python3.8/site-packages/neo4j/api.py:489)     raise ConfigurationError("Password is not supported in the URI")

ConfigurationError: Username is not supported in the URI
Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?bbc3ed55-b69e-4557-b7e7-e9913806eb86) or open in a [text editor](command:workbench.action.openLargeOutput?bbc3ed55-b69e-4557-b7e7-e9913806eb86). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...


### Who can help?

_No response_

### Information

- [ ] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [X] Tools / Toolkits
- [X] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

from langchain.graphs import Neo4jGraph
import os

uri, user, password = os.getenv("NEO4J_URI"), os.getenv("NEO4J_USERNAME"), os.getenv("NEO4J_PASSWORD")
graph = Neo4jGraph(
    url= uri,
    username=user,
    password=password,
)

### Expected behavior

This driver formation is running fine in v264. however its giving me error in v338 version. at last in the driver stub, its parsing the url and then the username from the parsed url is being checked. If its present then its raising this above config error.