infobyte / faraday

Open Source Vulnerability Management Platform

Home Page:https://www.faradaysec.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker-compose up failing with latest image

jotamjr opened this issue · comments

Faraday version

5.2.0

Component Name

Docker image (faradaysec/faraday)

docker images --digests
REPOSITORY                            TAG             DIGEST                                                                    IMAGE ID       CREATED        SIZE
faradaysec/faraday                    latest          sha256:7d4ca614af952f917b790c55e3bf83527d2a86c9534c4eff43caa384eb3ff5b3   24a4aa3a1a3c   5 days ago     782MB

Steps to reproduce

wget https://github.com/infobyte/faraday/raw/master/docker-compose.yaml
docker-compose up
app_1    | Wed Mar 20 01:47:02 UTC 2024 Creating server.ini
app_1    | Waiting for postgres on db
app_1    | Wed Mar 20 01:47:03 UTC 2024 Creating tables on database faraday...
app_1    | Traceback (most recent call last):
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
app_1    |     self.dialect.do_execute(
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
app_1    |     cursor.execute(statement, parameters)
app_1    | psycopg2.errors.UndefinedTable: relation "agent" does not exist
app_1    | LINE 2: FROM agent
app_1    |              ^
app_1    |
app_1    |
app_1    | The above exception was the direct cause of the following exception:
app_1    |
app_1    | Traceback (most recent call last):
app_1    |   File "/usr/local/bin/faraday-manage", line 5, in <module>
app_1    |     from faraday.manage import cli
app_1    |   File "/usr/local/lib/python3.8/site-packages/faraday/manage.py", line 62, in <module>
app_1    |     app = get_app(register_extensions_flag=False)
app_1    |   File "/usr/local/lib/python3.8/site-packages/faraday/server/app.py", line 539, in get_app
app_1    |     FARADAY_APP = create_app(db_connection_string=db_connection_string,
app_1    |   File "/usr/local/lib/python3.8/site-packages/faraday/server/app.py", line 526, in create_app
app_1    |     remove_sid()
app_1    |   File "/usr/local/lib/python3.8/site-packages/faraday/server/websockets/dispatcher.py", line 53, in remove_sid
app_1    |     agents = Agent.query.filter(Agent.sid!=None).all()  # noqa E711
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3373, in all
app_1    |     return list(self)
app_1    |   File "/usr/local/lib/python3.8/site-packages/nplusone/ext/sqlalchemy.py", line 99, in query_iter
app_1    |     ret, clone = itertools.tee(original_query_iter(self))
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
app_1    |     return self._execute_and_instances(context)
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
app_1    |     result = conn.execute(querycontext.statement, self._params)
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
app_1    |     return meth(self, multiparams, params)
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
app_1    |     return connection._execute_clauseelement(self, multiparams, params)
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
app_1    |     ret = self._execute_context(
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
app_1    |     self._handle_dbapi_exception(
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
app_1    |     util.raise_(
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
app_1    |     raise exception
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
app_1    |     self.dialect.do_execute(
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
app_1    |     cursor.execute(statement, parameters)
app_1    | sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "agent" does not exist
app_1    | LINE 2: FROM agent
app_1    |              ^
app_1    |
app_1    | [SQL: SELECT agent.create_date AS agent_create_date, agent.update_date AS agent_update_date, agent.id AS agent_id, agent.token AS agent_token, agent.name AS agent_name, agent.active AS agent_active, agent.sid AS agent_sid, agent.creator_id AS agent_creator_id, agent.update_user_id AS agent_update_user_id
app_1    | FROM agent
app_1    | WHERE agent.sid IS NOT NULL]
app_1    | (Background on this error at: http://sqlalche.me/e/13/f405)
app_1    | Wed Mar 20 01:47:05 UTC 2024 Using existing server.ini
app_1    | Update swagger...
app_1    | Traceback (most recent call last):
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
app_1    |     self.dialect.do_execute(
app_1    |   File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
app_1    |     cursor.execute(statement, parameters)
app_1    | psycopg2.errors.UndefinedTable: relation "agent" does not exist
app_1    | LINE 2: FROM agent

I have the same error

@jotamjr Hi, we are aware of the issue, and it will be corrected shortly.

I hava the same error:

docker logs faraday_db 2>&1 | grep ERROR

2024-04-19 02:55:55.941 UTC [56] ERROR: relation "agent" does not exist at character 307
2024-04-19 02:56:00.048 UTC [57] ERROR: relation "agent" does not exist at character 307
2024-04-19 02:56:00.142 UTC [57] ERROR: relation "vulnerability" does not exist
2024-04-19 02:56:06.005 UTC [58] ERROR: relation "agent" does not exist at character 307
2024-04-19 02:56:10.110 UTC [59] ERROR: relation "agent" does not exist at character 307
2024-04-19 02:56:10.148 UTC [59] ERROR: relation "vulnerability" does not exist
2024-04-19 02:56:16.132 UTC [60] ERROR: relation "agent" does not exist at character 307
2024-04-19 02:56:20.549 UTC [61] ERROR: relation "agent" does not exist at character 307