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

DBCreator.py fails during generate, cleardb, etc. #22

Open
mosdeft opened this issue Nov 17, 2020 · 9 comments
Open

DBCreator.py fails during generate, cleardb, etc. #22

mosdeft opened this issue Nov 17, 2020 · 9 comments

Comments

@mosdeft
Copy link

mosdeft commented Nov 17, 2020

Tried DBCreator in WIN10, Kali, and on a MAC. All 3 trails produce similar issue.

Generate:
raise Neo4jError.hydrate(**metadata)
neo4j.exceptions.ConstraintError: {code: Neo.ClientError.Schema.ConstraintValidationFailed} {message: Node(9) already exists with label Base and property objectid = 'bc40b5a8-8a0b-4f7f-90ed-916aac46a4d6'}

ClearDB:
File "/home/kali/.local/lib/python3.8/site-packages/neo4j/data.py", line 141, in index
raise KeyError(key)
KeyError: 'description'

clear_and_generate:
File "/home/kali/.local/lib/python3.8/site-packages/neo4j/data.py", line 141, in index
raise KeyError(key)
KeyError: 'description'

@LauraWartschinski
Copy link

I have a similar issue. Maybe those additional datapoints help.
Ubuntu 20.04.1

(Cmd) cleardb
Clearing Database
Traceback (most recent call last):
  File "DBCreator.py", line 806, in <module>
    MainMenu().cmdloop()
  File "DBCreator.py", line 69, in cmdloop
    cmd.Cmd.cmdloop(self)
  File "/usr/lib/python3.8/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python3.8/cmd.py", line 217, in onecmd
    return func(arg)
  File "DBCreator.py", line 166, in do_cleardb
    result = session.run(
  File "/home/laura/.local/lib/python3.8/site-packages/neo4j/__init__.py", line 503, in run
    self._connection.fetch()
  File "/home/laura/.local/lib/python3.8/site-packages/neobolt/direct.py", line 419, in fetch
    return self._fetch()
  File "/home/laura/.local/lib/python3.8/site-packages/neobolt/direct.py", line 461, in _fetch
    response.on_failure(summary_metadata or {})
  File "/home/laura/.local/lib/python3.8/site-packages/neobolt/direct.py", line 755, in on_failure
    raise CypherError.hydrate(**metadata)
neobolt.exceptions.ClientError: Supplied bookmark [FB:kcwQw47xDD+DSAe/59LRT1v0L1eQ] does not conform to pattern neo4j:bookmark:v1:tx

The same errors occurs on "generate" and and "clear_and_generate".

@lflinders
Copy link

lflinders commented Feb 24, 2021

I am getting the same issue on windows 10, don't hate I have no choice 👎

Traceback (most recent call last):
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\BloodHound-Tools\DBCreator\DBCreator.py", line 806, in <module>
    MainMenu().cmdloop()
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\BloodHound-Tools\DBCreator\DBCreator.py", line 69, in cmdloop
    cmd.Cmd.cmdloop(self)
  File "C:\Users\lflinders\AppData\Local\Programs\Python\Python38\lib\cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "C:\Users\lflinders\AppData\Local\Programs\Python\Python38\lib\cmd.py", line 217, in onecmd
    return func(arg)
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\BloodHound-Tools\DBCreator\DBCreator.py", line 200, in do_generate
    self.generate_data()
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\BloodHound-Tools\DBCreator\DBCreator.py", line 261, in generate_data
    session.run(f"{base_statement},n.highvalue=true", gname=cn(
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\venv\lib\site-packages\neo4j\__init__.py", line 503, in run
    self._connection.fetch()
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\venv\lib\site-packages\neobolt\direct.py", line 419, in fetch
    return self._fetch()
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\venv\lib\site-packages\neobolt\direct.py", line 461, in _fetch
    response.on_failure(summary_metadata or {})
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\venv\lib\site-packages\neobolt\direct.py", line 755, in on_failure
    raise CypherError.hydrate(**metadata)
neobolt.exceptions.ClientError: Supplied bookmark [FB:kcwQiFWgM2XfQS67VlUPuKDx/8kFOpA=] does not conform to pattern neo4j:bookmark:v1:tx

Looks like either the creator needs updating or Neo4j needs upgrading
BloodHoundAD/BloodHound#343

If i upgrade Neo4j to the latest version 4.2.1 I get a new error,

Traceback (most recent call last):
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\venv\lib\site-packages\neo4j\data.py", line 139, in index
    return self.__keys.index(key)
ValueError: tuple.index(x): x not in tuple

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\BloodHound-Tools\DBCreator\DBCreator.py", line 806, in <module>
    MainMenu().cmdloop()
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\BloodHound-Tools\DBCreator\DBCreator.py", line 69, in cmdloop
    cmd.Cmd.cmdloop(self)
  File "C:\Users\lflinders\AppData\Local\Programs\Python\Python38\lib\cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "C:\Users\lflinders\AppData\Local\Programs\Python\Python38\lib\cmd.py", line 217, in onecmd
    return func(arg)
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\BloodHound-Tools\DBCreator\DBCreator.py", line 204, in do_clear_and_generate
    self.do_cleardb("a")
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\BloodHound-Tools\DBCreator\DBCreator.py", line 176, in do_cleardb
    session.run("DROP {}".format(index['description']))
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\venv\lib\site-packages\neo4j\data.py", line 97, in __getitem__
    index = self.index(key)
  File "C:\Users\lflinders\Desktop\code\SWARM\Hunter\PlumHound\venv\lib\site-packages\neo4j\data.py", line 141, in index
    raise KeyError(key)
KeyError: 'description'

This issue is isolated to resetting the DB schema, so if you manual clear the DB then you can dodge this issue.

@Corkster919
Copy link

updating the python3 libs will resolve the bookmark bolt errors

I rewrote the DBCreator.py file to fix the version update issues. You can use this one that works on my updated recon vm

DBCreator_update.zip

@tunelko
Copy link

tunelko commented Jul 15, 2021

This fix works for me.

pip uninstall neotime neo4j neobolt
pip install neo4j

@ashawe
Copy link

ashawe commented Nov 3, 2021

So I was trying to use generate and this is how it worked for me:

going to http://localhost:7474/
and logging in by using default username password => neo4j:neo4j (which tells you to reset password)
then running the updated DBCreator_update.zip
typing dbconfig
and entering the username, password which you reset while setting up the db
and then typing generate
worked for me

@byt3bl33d3r
Copy link

This was fixed in #28.

@Joanthan17
Copy link

Joanthan17 commented May 17, 2022

i'm getting the following error:
image

any clue?

EDIT: the domain name was too long (18 chars) and for some reason it didnt liked that ><

@Joanthan17
Copy link

python3.10

i have the latest ubuntu (22.04) with all updates

v-p-b pushed a commit to v-p-b/BloodHound-Tools that referenced this issue Dec 21, 2022
@danialhx
Copy link

So I was trying to use generate and this is how it worked for me:

going to http://localhost:7474/ and logging in by using default username password => neo4j:neo4j (which tells you to reset password) then running the updated DBCreator_update.zip typing dbconfig and entering the username, password which you reset while setting up the db and then typing generate worked for me

thx. this works for me

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

9 participants