andersju / webbkoll

An online tool that checks how a website is doing with regards to privacy
MIT License
266 stars 28 forks source link

Problems starting the webbkoll frontend #31

Closed chess-levin closed 1 year ago

chess-levin commented 2 years ago

Hello,

webbkol is a great tool for checking and training for good CSP-practice!

We like to run webbkoll backend and frontend. But we have no experience with erlang/elixir so far.

We are using hosts with centos 7.9. Webbkoll-Backend is already setup and running as a service. But we get an error when trying the first step of the frontend setup tutorial:

 mix deps.get
** (UndefinedFunctionError) undefined function: Mix.compilers/0
    (mix) Mix.compilers()
    mix.exs:10: Webbkoll.Mixfile.project/0
    (mix) lib/mix/project.ex:348: Mix.Project.get_project_config/1
    (mix) lib/mix/project.ex:52: Mix.Project.push/2
    (stdlib) lists.erl:1248: :lists.foldl/3

We found there is a webbkoll-backend docker container (https://hub.docker.com/r/eeacms/webbkoll-backend), but we couldn't find a matching frontend container. Running webbkoll as containers would be the easiest solution for us.

We hope you could help us, getting webkkol running.

Thank you in advance.

andersju commented 2 years ago

Hi!

If you're using Elixir installed from the normal CentOS repositories it's probably way too old (and the installed Erlang is then also too old). I'm not sure what the minimum version would be, but I use Elixir 1.12 and Erlang/OTP 24 here. (I know the Webbkoll README says "Erlang (>= 20) and Elixir (>= 1.7)", but that might no longer be true.)

The webbkoll-backend container was created by someone else, there are no "official" containers at the moment.

chess-levin commented 2 years ago

Hi @andersju I managed to start backend and frontend. But when I try to start an analysis via the frontend I always get this problem. I have no idea what to do about it. Could you help?

Compiling 27 files (.ex)
Generated webbkoll app
[warn] Job failed due to exception. %Honeydew.Job{by: :nonode@nohost, completed_at: nil, delay_secs: 0, enqueued_at: 1643292088978, failure_private: nil, from: nil, job_monitor: #PID<0.5634.0>, private: -576460752303321144, queue: Webbkoll.Queue.Q1, result: {:error, %Honeydew.Crash{reason: %RuntimeError{message: "econnrefused"}, stacktrace: [{Webbkoll.Worker, :handle_error, 2, [file: 'lib/webbkoll/worker.ex', line: 100]}, {Webbkoll.Worker, :perform, 4, [file: 'lib/webbkoll/worker.ex', line: 20]}, {Honeydew.JobRunner, :do_run, 1, [file: 'lib/honeydew/job_runner.ex', line: 58]}, {Honeydew.JobRunner, :handle_continue, 2, [file: 'lib/honeydew/job_runner.ex', line: 79]}, {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 695]}, {:gen_server, :loop, 7, [file: 'gen_server.erl', line: 437]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}], type: :exception}}, started_at: nil, task: {:perform, ["999166dc-4845-407f-95ec-d83aecb395ea", "http://hmmh.de", nil, "http://localhost:8100/"]}}
** (RuntimeError) econnrefused
    (webbkoll 0.0.1) lib/webbkoll/worker.ex:100: Webbkoll.Worker.handle_error/2
    (webbkoll 0.0.1) lib/webbkoll/worker.ex:20: Webbkoll.Worker.perform/4
    (honeydew 1.5.0) lib/honeydew/job_runner.ex:58: Honeydew.JobRunner.do_run/1
    (honeydew 1.5.0) lib/honeydew/job_runner.ex:79: Honeydew.JobRunner.handle_continue/2
    (stdlib 3.16.1) gen_server.erl:695: :gen_server.try_dispatch/4
    (stdlib 3.16.1) gen_server.erl:437: :gen_server.loop/7
    (stdlib 3.16.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

[warn] Job failed due to exception. %Honeydew.Job{by: :nonode@nohost, completed_at: nil, delay_secs: 0, enqueued_at: 1643292088978, failure_private: 1, from: nil, job_monitor: #PID<0.5653.0>, private: -576460752303321144, queue: Webbkoll.Queue.Q1, result: {:error, %Honeydew.Crash{reason: %RuntimeError{message: "econnrefused"}, stacktrace: [{Webbkoll.Worker, :handle_error, 2, [file: 'lib/webbkoll/worker.ex', line: 100]}, {Webbkoll.Worker, :perform, 4, [file: 'lib/webbkoll/worker.ex', line: 20]}, {Honeydew.JobRunner, :do_run, 1, [file: 'lib/honeydew/job_runner.ex', line: 58]}, {Honeydew.JobRunner, :handle_continue, 2, [file: 'lib/honeydew/job_runner.ex', line: 79]}, {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 695]}, {:gen_server, :loop, 7, [file: 'gen_server.erl', line: 437]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}], type: :exception}}, started_at: 1643292088978, task: {:perform, ["999166dc-4845-407f-95ec-d83aecb395ea", "http://hmmh.de", nil, "http://localhost:8100/"]}}
** (RuntimeError) econnrefused
    (webbkoll 0.0.1) lib/webbkoll/worker.ex:100: Webbkoll.Worker.handle_error/2
    (webbkoll 0.0.1) lib/webbkoll/worker.ex:20: Webbkoll.Worker.perform/4
    (honeydew 1.5.0) lib/honeydew/job_runner.ex:58: Honeydew.JobRunner.do_run/1
    (honeydew 1.5.0) lib/honeydew/job_runner.ex:79: Honeydew.JobRunner.handle_continue/2
    (stdlib 3.16.1) gen_server.erl:695: :gen_server.try_dispatch/4
    (stdlib 3.16.1) gen_server.erl:437: :gen_server.loop/7
    (stdlib 3.16.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

[warn] Job failed because {%RuntimeError{message: "econnrefused"}, [{Webbkoll.Worker, :handle_error, 2, [file: 'lib/webbkoll/worker.ex', line: 100]}, {Webbkoll.Worker, :perform, 4, [file: 'lib/webbkoll/worker.ex', line: 20]}, {Honeydew.JobRunner, :do_run, 1, [file: 'lib/honeydew/job_runner.ex', line: 58]}, {Honeydew.JobRunner, :handle_continue, 2, [file: 'lib/honeydew/job_runner.ex', line: 79]}, {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 695]}, {:gen_server, :loop, 7, [file: 'gen_server.erl', line: 437]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}]}, abandoning: %Honeydew.Job{by: :nonode@nohost, completed_at: nil, delay_secs: 0, enqueued_at: 1643292088978, failure_private: nil, from: nil, job_monitor: #PID<0.5653.0>, private: -576460752303321144, queue: Webbkoll.Queue.Q1, result: {:retrying, {%RuntimeError{message: "econnrefused"}, [{Webbkoll.Worker, :handle_error, 2, [file: 'lib/webbkoll/worker.ex', line: 100]}, {Webbkoll.Worker, :perform, 4, [file: 'lib/webbkoll/worker.ex', line: 20]}, {Honeydew.JobRunner, :do_run, 1, [file: 'lib/honeydew/job_runner.ex', line: 58]}, {Honeydew.JobRunner, :handle_continue, 2, [file: 'lib/honeydew/job_runner.ex', line: 79]}, {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 695]}, {:gen_server, :loop, 7, [file: 'gen_server.erl', line: 437]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}]}}, started_at: 1643292089147, task: {:perform, ["999166dc-4845-407f-95ec-d83aecb395ea", "http://hmmh.de", nil, "http://localhost:8100/"]}}
andersju commented 2 years ago

Looks like the kind of error you'd get if the "frontend" part can't access the backend (the backend being http://localhost:8100/).

If you run curl http://localhost:8100/status in a terminal (on the same server/computer where the frontend is running) it should respond "OK!". Does that happen?

chess-levin commented 2 years ago

You're curling https://xxx.yyy.zzz/, but the Webbkoll app is trying to use http://localhost:8100/. Edit config/dev.exs or config/prod.exs and change http://localhost:8100/ to https://xxx.yyy.zzz/ in the section about backends.

Sorry, andersju. In my last question I disclosed an internal address. Would you be so kind to delete your answer or rewrite it with xxx. Thank you.

I found out, that out that our CentOs Kernel is to old and Puppeteer/Chrome is not working correctly. So I have reinstall the backend on a recent Ubuntu.

andersju commented 2 years ago

You're curling https://xxx.yyy.zzz/, but the Webbkoll app is trying to use http://localhost:8100/. Edit config/dev.exs or config/prod.exs and change http://localhost:8100/ to https://xxx.yyy.zzz/ in the section about backends.

Sorry, andersju. In my last question I disclosed an internal address. Would you be so kind to delete your answer or rewrite it with xxx. Thank you.

Sure. The history of edited comments is still accessible so I deleted it :)