Skip to main content

We are seeing a repeating error from the Salesforce Slack app whenever a user posts a message in Slack. The message in the channel is delivered normally, but the author also gets an ephemeral error in the Salesforce app DM. 

 

Error (Only visible to you): 

There was a problem processing the Slack event MESSAGE_EVENT ErrorType: NullPointerException 

 

This happens on every message typed directly in Slack. 

Please advise how to stop the Salesforce app from sending these errors (configuration, scopes/event subscription, or a known platform issue). If the user sends a message from Salesforce, this error does not occur and everything works correctly;  

 

 

There was a problem processing the Slack event MESSAGE_EVENT ErrorType: NullPointerException

 

 

 

#Slack  #Slack Developers  #Slack Community  #Integration

1 answer
  1. Sep 10, 10:36 PM
    Hi Maksimilian, that exact wording — "There was a problem processing the Slack event MESSAGE_EVENT ErrorType: NullPointerException" — is what the Apex SDK for Slack runtime posts as an ephemeral message when the Apex handler you registered for the message event throws an unhandled exception, so the NullPointerException is happening inside your own message-event handler class, not on Slack's side. It fires on every message because your app is subscribed to the message event (e.g. message.channels) and the handler runs for each one; it does not fire when you send from Salesforce because that path never invokes the inbound message handler. The usual culprit is a message subtype that doesn't carry the field you're reading — bot_message (including your app's own echoed messages), message_changed/message_deleted, and join/leave events have no user and often no text, so event.getUser()/getText() or a downstream SOQL lookup that finds nothing comes back null. Fix it in the handler: early-return when a subtype is present or when user/text is null (ignore bot and echoed messages), null-check any record you query, and wrap the body in try/catch with a debug log so you can see the exact line. If you need the noise to stop immediately, remove the message event from Event Subscriptions in the app manifest, then re-add it once the handler is guarded. If this helps, please mark it as the Best Answer so it helps the next person — thanks 🙂
0/9000