tanuj-maheshwari / Face-Recognition-API

Python based API service that performs "facial search" on a database of images.
3 stars 1 forks source link

can't run the server for the first run ! #1

Closed Ahmedsaber9 closed 2 years ago

Ahmedsaber9 commented 2 years ago

root@word:~/Face-Recognition-API-master# python3 -m gunicorn app:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 127.0.0.1:8000 [2022-06-27 00:29:08 +0000] [2576] [INFO] Starting gunicorn 20.1.0 [2022-06-27 00:29:08 +0000] [2576] [INFO] Listening at: http://127.0.0.1:8000 (2576) [2022-06-27 00:29:08 +0000] [2576] [INFO] Using worker: uvicorn.workers.UvicornWorker [2022-06-27 00:29:08 +0000] [2579] [INFO] Booting worker with pid: 2579 [2022-06-27 00:29:08 +0000] [2581] [INFO] Booting worker with pid: 2581 [2022-06-27 00:29:08 +0000] [2583] [INFO] Booting worker with pid: 2583 [2022-06-27 00:29:08 +0000] [2584] [INFO] Booting worker with pid: 2584

[2022-06-27 00:29:12 +0000] [2579] [ERROR] Exception in worker process Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/gunicorn/arbiter.py", line 589, in spawn_worker worker.init_process() File "/usr/local/lib/python3.6/dist-packages/uvicorn/workers.py", line 66, in init_process super(UvicornWorker, self).init_process() File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/base.py", line 134, in init_process self.load_wsgi() File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/base.py", line 146, in load_wsgi self.wsgi = self.app.wsgi() File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 58, in load return self.load_wsgiapp() File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python3.6/dist-packages/gunicorn/util.py", line 359, in import_app mod = importlib.import_module(module) File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/home/word/Face-Recognition-API-master/app.py", line 45, in api = AGTAPI("config.json") File "/home/word/Face-Recognition-API-master/API/implementation/AGTAPI.py", line 21, in init self.db = MySQLImageDatabase(db_config) File "/home/word/Face-Recognition-API-master/Database/implementation/MySQLImageDatabase.py", line 24, in init self.create(create_table_command) File "/home/word/Face-Recognition-API-master/Database/CRUD/implementation/MySQLDatabase.py", line 19, in create self.cursor.execute(query) File "/usr/local/lib/python3.6/dist-packages/mysql/connector/cursor.py", line 551, in execute self._handle_result(self._connection.cmd_query(stmt)) File "/usr/local/lib/python3.6/dist-packages/mysql/connector/connection.py", line 490, in cmd_query result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query)) File "/usr/local/lib/python3.6/dist-packages/mysql/connector/connection.py", line 395, in _handle_result raise errors.get_exception(packet) mysql.connector.errors.ProgrammingError: 1050 (42S01): Table 'IMAGE_DATASET' already exists [2022-06-27 00:29:12 +0000] [2579] [INFO] Worker exiting (pid: 2579) [2022-06-27 00:29:12 +0000] [2581] [ERROR] Exception in worker process Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/gunicorn/arbiter.py", line 589, in spawn_worker worker.init_process() File "/usr/local/lib/python3.6/dist-packages/uvicorn/workers.py", line 66, in init_process super(UvicornWorker, self).init_process() File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/base.py", line 134, in init_process self.load_wsgi() File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/base.py", line 146, in load_wsgi self.wsgi = self.app.wsgi() File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 58, in load return self.load_wsgiapp() File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python3.6/dist-packages/gunicorn/util.py", line 359, in import_app mod = importlib.import_module(module) File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/home/word/Face-Recognition-API-master/app.py", line 45, in api = AGTAPI("config.json") File "/home/word/Face-Recognition-API-master/API/implementation/AGTAPI.py", line 21, in init self.db = MySQLImageDatabase(db_config) File "/home/word/Face-Recognition-API-master/Database/implementation/MySQLImageDatabase.py", line 24, in init self.create(create_table_command) File "/home/word/Face-Recognition-API-master/Database/CRUD/implementation/MySQLDatabase.py", line 19, in create self.cursor.execute(query) File "/usr/local/lib/python3.6/dist-packages/mysql/connector/cursor.py", line 551, in execute self._handle_result(self._connection.cmd_query(stmt)) File "/usr/local/lib/python3.6/dist-packages/mysql/connector/connection.py", line 490, in cmd_query result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query)) File "/usr/local/lib/python3.6/dist-packages/mysql/connector/connection.py", line 395, in _handle_result raise errors.get_exception(packet) mysql.connector.errors.ProgrammingError: 1050 (42S01): Table 'IMAGE_DATASET' already exists [2022-06-27 00:29:12 +0000] [2581] [INFO] Worker exiting (pid: 2581) [2022-06-27 00:29:13 +0000] [2576] [WARNING] Worker with pid 2583 was terminated due to signal 15 [2022-06-27 00:29:13 +0000] [2576] [WARNING] Worker with pid 2584 was terminated due to signal 15 [2022-06-27 00:29:13 +0000] [2576] [WARNING] Worker with pid 2581 was terminated due to signal 15 [2022-06-27 00:29:13 +0000] [2576] [INFO] Shutting down: Master [2022-06-27 00:29:13 +0000] [2576] [INFO] Reason: Worker failed to boot.

tanuj-maheshwari commented 2 years ago

@Ahmedsaber9 Refer to the Prerequisites and Setup section, specifically this point.

As per the traceback, there already exists an IMAGE_DATASET table in your database, probably from a previous run. Either use a different database, or drop the tables in the original database.