Debug Server plugins
Plugins communicate with the main Mattermost Server by RPC. In order to debug them with Delve, a few steps are necessary.
macOS
- 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. - Grab the
pid, which is the second number after your username in the output above. Rundlv attach pid, wherepidis that number. let the plugin continue executing soon after connecting; Otherwise, the server will detect it as stopped and attempt to restart it. - You're done. You should have access to your plugin's code through Delve and be able to set breakpoints, etc.