dev-lu / osint_toolkit

A full stack web application that combines many tools and services for security analysts into a single tool.
MIT License
516 stars 85 forks source link

backend uvicorn main:app error #22

Closed gabyavra closed 1 year ago

gabyavra commented 1 year ago

Error when running backend:

Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 3280, in _wrap_pool_connect return fn() ^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 310, in connect return _ConnectionFairy._checkout(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 868, in _checkout fairy = _ConnectionRecord.checkout(pool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 476, in checkout rec = pool._do_get() ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/impl.py", line 256, in _do_get return self._create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 256, in _create_connection return _ConnectionRecord(self) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 371, in init self.connect() File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 665, in connect with util.safereraise(): File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/util/langhelpers.py", line 70, in exit compat.raise( File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 661, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/create.py", line 590, in connect return dialect.connect(*cargs, *cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/default.py", line 597, in connect return self.dbapi.connect(cargs, **cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlite3.OperationalError: unable to open database file

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/local/lib/python3.11/dist-packages/uvicorn/main.py", line 4, in uvicorn.main() File "/usr/lib/python3/dist-packages/click/core.py", line 1130, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/uvicorn/main.py", line 408, in main run( File "/usr/local/lib/python3.11/dist-packages/uvicorn/main.py", line 576, in run server.run() File "/usr/local/lib/python3.11/dist-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete File "/usr/local/lib/python3.11/dist-packages/uvicorn/server.py", line 67, in serve config.load() File "/usr/local/lib/python3.11/dist-packages/uvicorn/config.py", line 479, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/uvicorn/importer.py", line 21, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/root/OSINT/osint_toolkit/backend/main.py", line 3, in from routers import internal, external File "/root/OSINT/osint_toolkit/backend/routers/internal.py", line 15, in models.Base.metadata.create_all(bind=engine) File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/sql/schema.py", line 4889, in create_all bind._run_ddl_visitor( File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 3146, in _run_ddl_visitor with self.begin() as conn: ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 3062, in begin conn = self.connect(close_with_result=close_with_result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 3234, in connect return self._connection_cls(self, close_with_result=close_with_result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 96, in init else engine.raw_connection() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 3313, in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 3283, in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 2117, in _handle_dbapi_exceptionnoconnection util.raise( File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/base.py", line 3280, in _wrap_pool_connect return fn() ^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 310, in connect return _ConnectionFairy._checkout(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 868, in _checkout fairy = _ConnectionRecord.checkout(pool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 476, in checkout rec = pool._do_get() ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/impl.py", line 256, in _do_get return self._create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 256, in _create_connection return _ConnectionRecord(self) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 371, in init self.connect() File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 665, in connect with util.safereraise(): File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/util/langhelpers.py", line 70, in exit compat.raise( File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/pool/base.py", line 661, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/create.py", line 590, in connect return dialect.connect(*cargs, *cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/default.py", line 597, in connect return self.dbapi.connect(cargs, cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file (Background on this error at: https://sqlalche.me/e/14/e3q8)

Any ideea why? Tried on two different compuers, same on docker

dev-lu commented 1 year ago

Hello, thank you for reporting this error. There was a misconfiguration for creating the database at the first launch. This error is fixed now. Please clone the latest version of this repository and try again.

gabyavra commented 1 year ago

Hello, I've got the same error after update. Also tried on docker.

Traceback (most recent call last): File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3280, in _wrap_pool_connect return fn() ^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 310, in connect return _ConnectionFairy._checkout(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 868, in _checkout fairy = _ConnectionRecord.checkout(pool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 476, in checkout rec = pool._do_get() ^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 256, in _do_get return self._create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 256, in _create_connection return _ConnectionRecord(self) ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 371, in init self.connect() File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 665, in connect with util.safereraise(): File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit compat.raise( File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 661, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 590, in connect return dialect.connect(*cargs, *cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 597, in connect return self.dbapi.connect(cargs, **cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlite3.OperationalError: unable to open database file

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/homebrew/bin/uvicorn", line 8, in sys.exit(main()) ^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/uvicorn/main.py", line 408, in main run( File "/opt/homebrew/lib/python3.11/site-packages/uvicorn/main.py", line 576, in run server.run() File "/opt/homebrew/lib/python3.11/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/uvicorn/server.py", line 67, in serve config.load() File "/opt/homebrew/lib/python3.11/site-packages/uvicorn/config.py", line 479, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/Users/avramescugabriel/Dropbox/!computer forensics and hack/Social Engineering/osint_toolkit/backend/main.py", line 3, in from routers import internal, external File "/Users/avramescugabriel/Dropbox/!computer forensics and hack/Social Engineering/osint_toolkit/backend/routers/internal.py", line 15, in models.Base.metadata.create_all(bind=engine) File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/sql/schema.py", line 4889, in create_all bind._run_ddl_visitor( File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3146, in _run_ddl_visitor with self.begin() as conn: ^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3062, in begin conn = self.connect(close_with_result=close_with_result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3234, in connect return self._connection_cls(self, close_with_result=close_with_result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 96, in init else engine.raw_connection() ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3313, in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3283, in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2117, in _handle_dbapi_exceptionnoconnection util.raise( File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3280, in _wrap_pool_connect return fn() ^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 310, in connect return _ConnectionFairy._checkout(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 868, in _checkout fairy = _ConnectionRecord.checkout(pool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 476, in checkout rec = pool._do_get() ^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 256, in _do_get return self._create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 256, in _create_connection return _ConnectionRecord(self) ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 371, in init self.connect() File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 665, in connect with util.safereraise(): File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit compat.raise( File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 661, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 590, in connect return dialect.connect(*cargs, *cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 597, in connect return self.dbapi.connect(cargs, cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file (Background on this error at: https://sqlalche.me/e/14/e3q8)

dev-lu commented 1 year ago

Please delete old Docker images and files and try again.

gabyavra commented 1 year ago

we have a winner, close cased. thank your support :)

Lynka7 commented 1 year ago

we have a winner, close cased. thank your support :)

Is there any means I can contact you privately so you guide me out to resolve same issue ? been finding it hard since...

Lynka7 commented 1 year ago

Tried running it on Parrot OS and faced same issue you're facing...

Linux parrot 6.1.0-1parrot1-amd64 #1 SMP PREEMPT_DYNAMIC Parrot 6.1.15-1parrot1 (2023-04-25) x86_64 GNU/Linux

Tried Docker and gives me this;

[+] Building 0.0s (0/0)
http: invalid Host header