RabbitMQ Local Environment + Debugger

43 views
Skip to first unread message

Lucas Weis Polesello

unread,
Nov 4, 2023, 6:47:38 PM11/4/23
to rabbitmq-users
Guys I tried to follow the CONTRIBUTING.md and the below StackOverflow post so I could play around RabbitMQ internals and code.

I am able to get the broker up and running using `bazel sync` and `bazel run broker` but unfortunately I am not able to debug the application. I am using VsCode + Erlang LS extension

Tried to look into `rabbitmq_run.sh` so I could understand wether we are compiling stuff with `+debug_info` but couldnt manage to do so.

One thing I noticed is that I cannot run `gmake` or either `bazel build //...`. Each time I do so I get an error for `rabbitmq_codegen.py` not found.

How do you guys develop locally? I am missing something?

Luke Bakken

unread,
Nov 5, 2023, 11:07:50 AM11/5/23
to rabbitmq-users
Hello,

Which operating system are you using? Which version of Erlang?

I use a combination of NeoVim and erlang_ls on either Arch Linux or Ubuntu 22. I generally build and start the broker using GNU make. In general I debug using good old stdout print statements and the redbug library (https://github.com/massemanet/redbug). On very rare occasions I have used the Erlang Observer and have debugged that way.

If you'd like further assistance it would be helpful to know exactly what commands you are running, and the full output. Save the output to a file and attach it.

Lucas Weis Polesello

unread,
Nov 5, 2023, 1:37:51 PM11/5/23
to rabbitmq-users
Hi Luke! Thank you for your time!

Erlang: 26.0.2
SO: MacOSX Ventura 13.2.1
IDE: VsCode

I was just able to run `bazel build //...` after recloning the repo. But following Michael's tip from Discord community I cloned once again and I am using `gmake` and `gmake run-broker` to run RMQ locally. I don't see those `rabbitmq_codegen.py missing` thing.

As per the logs you mean the logs from either `gmake` and `gmake run-broker`? If so I can attach it here.

Or do you mean the ADP Server/Erlang LS Debugger Server logs? One important log line I am seeing is:

```
[2023-11-04T20:52:58.668341-03:00] /home/runner/work/vscode/vscode/erlang_ls/apps/els_dap/src/els_dap_protocol.erl:71 <0.108.0> [debug] [Response] [message=#{command => <<"setBreakpoints">>,type => <<"response">>,success => true,body => #{<<"breakpoints">> => [#{message => <<"module not available (no_src) in the debugged node, reset the breakpoint when the module is availalbe">>,<<"line">> => 1241,<<"verified">> => false}]},request_seq => 8}
```

As to the suggestions for redbug, thank you so much. If I don't manage to make the VsCode debugger work with a more couple of days of effort I think I might look into those shell-like debugging tools

Thanks in Advance!
Reply all
Reply to author
Forward
0 new messages