mirror of
https://github.com/mattermost/mattermost.git
synced 2026-11-05 21:56:58 -06:00
9 lines
900 B
Markdown
9 lines
900 B
Markdown
---
|
|||
|
|
title: "Debug Server plugins"
|
||
|
|
---
|
||
|
|
|
||
|
|
Plugins communicate with the main Mattermost Server by [RPC](https://github.com/hashicorp/go-plugin). In order to debug them with Delve, a few steps are necessary.
|
||
|
|
### macOS
|
||
|
|
1. After starting the main Mattermost application, run `ps aux | grep name.of.your.plugin`. This will print a list of running processes that match that name, as such: `username 78836 0.0 0.1 4397696 12492 s006 S 7:07AM 0:00.03 plugins/name.of.your.plugin/server/dist/plugin-darwin-amd64`.
|
||
|
|
2. Grab the `pid`, which is the second number after your username in the output above. Run `dlv attach pid`, where `pid` is that number. let the plugin continue executing soon after connecting; Otherwise, the server will detect it as stopped and attempt to restart it.
|
||
|
|
3. You're done. You should have access to your plugin's code through Delve and be able to set breakpoints, etc.
|