Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc docker-compose doesn't work #483

Closed
Talanor opened this issue Jan 23, 2024 · 5 comments
Closed

Doc docker-compose doesn't work #483

Talanor opened this issue Jan 23, 2024 · 5 comments

Comments

@Talanor
Copy link

Talanor commented Jan 23, 2024

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
Copy link
Author

Talanor commented Jan 23, 2024

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

[faraday_server]
[...]
celery_broker_url = redis
celery_backend_url = redis

@ezk06eer
Copy link

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

@kw1001
Copy link

kw1001 commented Jan 26, 2024

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
Copy link

@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:

volumes:
- "$HOME/.faraday:/home/faraday/.faraday:rw"

After removing the server.ini that was made by a different Faraday instance (and hence couldn't be loaded) then putting in the workaround (#483 (comment)) , it indeed worked on my local Debian box.

Hope this helps,

@kw1001
Copy link

kw1001 commented Jan 28, 2024

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

@ezk06eer ezk06eer closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants