infobyte / faraday

Open Source Vulnerability Management Platform
https://www.faradaysec.com
GNU General Public License v3.0
4.72k stars 875 forks source link

Doc docker-compose doesn't work #483

Closed Talanor closed 5 months ago

Talanor commented 5 months ago

Issue Type

Bug Report

Faraday version

REPOSITORY TAG IMAGE ID CREATED SIZE faradaysec/faraday latest 1d9c8022f690 2 weeks ago 801MB

Component Name

Faraday ignores configured redis host

Steps to reproduce

Straight from the doc:

$ wget https://raw.githubusercontent.com/infobyte/faraday/master/docker-compose.yaml
$ docker-compose up

Upload an openvas xml

Expected results

To be able to upload findings to faraday.

Debugging tracebacks (current results)

Sample of docker-compose logs:

faraday_app    |  -------------- celery@9076fe59dffa v5.3.6 (emerald-rush)
faraday_app    | --- ***** -----
faraday_app    | -- ******* ---- Linux-6.7.0-arch3-1-x86_64-with-glibc2.2.5 2024-01-23 10:03:52
faraday_app    | - *** --- * ---
faraday_app    | - ** ---------- [config]
faraday_app    | - ** ---------- .> app:         faraday.server.app:0x7a0da43f90d0
faraday_app    | - ** ---------- .> transport:   redis://127.0.0.1:6379//
faraday_app    | - ** ---------- .> results:     redis://127.0.0.1:6379/
faraday_app    | - *** --- * --- .> concurrency: 15 (prefork)
faraday_app    | -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
faraday_app    | --- ***** -----
faraday_app    |  -------------- [queues]
faraday_app    |                 .> celery           exchange=celery(direct) key=celery

And:

faraday_app    | The above exception was the direct cause of the following exception:
faraday_app    |
faraday_app    | Traceback (most recent call last):
faraday_app    |   File "/usr/local/lib/python3.8/site-packages/faraday/server/api/modules/upload_reports.py", line 125, in file_upload
faraday_app    |     pre_process_report_task.delay(
faraday_app    |   File "/usr/local/lib/python3.8/site-packages/celery/app/task.py", line 444, in delay
faraday_app    |     return self.apply_async(args, kwargs)
faraday_app    |   File "/usr/local/lib/python3.8/site-packages/celery/app/task.py", line 594, in apply_async
faraday_app    |     return app.send_task(
faraday_app    |   File "/usr/local/lib/python3.8/site-packages/celery/app/base.py", line 799, in send_task
faraday_app    |     amqp.send_task_message(P, name, message, **options)
faraday_app    |   File "/usr/local/lib/python3.8/contextlib.py", line 131, in __exit__
faraday_app    |     self.gen.throw(type, value, traceback)
faraday_app    |   File "/usr/local/lib/python3.8/site-packages/kombu/connection.py", line 476, in _reraise_as_library_errors
faraday_app    |     raise ConnectionError(str(exc)) from exc
faraday_app    | kombu.exceptions.OperationalError: Error 111 connecting to 127.0.0.1:6379. Connection refused.
faraday_app    | 2024-01-23T10:05:42+0000 - geventwebsocket.handler - INFO {Dummy-5} [pid:49] 
Talanor commented 5 months ago

Upong investigation, this needs to be added to faraday's config/server.ini:

[faraday_server]
[...]
celery_broker_url = redis
celery_backend_url = redis
ezk06eer commented 5 months ago

@Talanor Hi! thanks for reporting this, we will make a PR for that change

kw1001 commented 5 months ago

Hello, I would like to ask where is the config/server.ini file that needs to be modified if I use Docker-compose installation like you do? Is it entering the container or using other methods?

chris-x86-64 commented 5 months ago

@kw1001

Hello, I would like to ask where is the config/server.ini file that needs to be modified if I use Docker-compose installation like you do? Is it entering the container or using other methods?

It's the one at ~/.faraday/config/server.ini (or equivalent path) on your host OS, which should be made available via the following volume configuration: https://github.com/infobyte/faraday/blob/952e6d6af4aea2847cebad1573345f5b29fe3574/docker-compose.yaml#L25-L26

After removing the server.ini that was made by a different Faraday instance (and hence couldn't be loaded) then putting in the workaround (https://github.com/infobyte/faraday/issues/483#issuecomment-1905770396) , it indeed worked on my local Debian box.

Hope this helps,

kw1001 commented 5 months ago

Okay, thank you. I have solved the problem and wish you a wonderful day