Edit on GitHub

Debug plugins in the Mattermost Server

Plugins communicate with the main Mattermost Server by RPC. 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.

Did you find what you were looking for?

Thank you! We appreciate your feedback.
×

Tell us more

Your feedback helps us improve the Mattermost developer documentation.

Have a feature request? Share it here.

Having issues? Join our Community server.