matamorphosis / Scrummage

A Holistic OSINT and Threat Hunting Platform
GNU General Public License v3.0
502 stars 81 forks source link

Creating Tables fails #30

Closed ghost closed 2 years ago

ghost commented 2 years ago

So I run the installation script and when it gets to the create tables I get the following:

[+] Creating Tables using Create_Tables.py

Traceback (most recent call last): File "./support_files/Create_Tables.py", line 8, in Load_Main_Database with open('db.json') as JSON_File: FileNotFoundError: [Errno 2] No such file or directory: 'db.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./support_files/Create_Tables.py", line 31, in connection = Load_Main_Database() File "./support_files/Create_Tables.py", line 18, in Load_Main_Database sys.exit(str(datetime.datetime.now()) + " Failed to load configuration file.")
SystemExit: 2021-11-01 12:29:57.571783 Failed to load configuration file.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./support_files/Create_Tables.py", line 102, in if(connection): NameError: name 'connection' is not defined


Any suggestions would be great! Postgresql is running Thanks

matamorphosis commented 2 years ago

Hey @scars321,

Thanks for raising this, was a bug with some recent changes in the install.sh file, I believe the issue has been rectified, please pull the latest changes from this repo and try rerunning this installation script.

ghost commented 2 years ago

Cheers for that. Sadly I'm now recieving the following:


Traceback (most recent call last):

File "./Create_Tables.py", line 21, in Load_Main_Database
    return psycopg2.connect(user=DB_Username,
  File "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  password authentication failed for user "scrummage"
FATAL:  password authentication failed for user "scrummage"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./Create_Tables.py", line 31, in <module>
    connection = Load_Main_Database()
  File "./Create_Tables.py", line 28, in Load_Main_Database
    sys.exit(str(datetime.datetime.now()) + " Failed to connect to database.")
SystemExit: 2021-11-02 12:47:50.924996 Failed to connect to database.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./Create_Tables.py", line 102, in <module>
    if(connection):
NameError: name 'connection' is not defined
matamorphosis commented 2 years ago

The reason you're seeing this error is the password used to access the PostgreSQL database is generated randomly, so the installation script has set up the DBMS, DB, and user the first time you ran the script with password A. The second time it has generated the same details but with a different, randomly-generated password and stored the creds in the db.json file, which instructs the Create_User.py and Create_Tables.py scripts in terms of how to access the database. The easiest way to resolve this, would be to just uninstall PostgreSQL from your system and run the script again.

ghost commented 2 years ago

Thanks dude that is now resolved.