mattermost-plugin-jira
mattermost-plugin-jira copied to clipboard
Notifications are not coming. Error Unable to save the Post
Hi, we stopped receiving notifications for some events, according to the logs, this is an error
{"timestamp":"2024-03-21 11:18:31.454 Z","level":"error","msg":"WebhookWorker id: 2, error posting to channel, err: CreatePost: Unable to save the Post.","caller":"app/plugin_api.go:1003","plugin_id":"jira"} {"timestamp":"2024-03-21 11:18:34.467 Z","level":"error","msg":"WebhookWorker id: 3, error posting to channel, err: CreatePost: Unable to save the Post.","caller":"app/plugin_api.go:1003","plugin_id":"jira"}
Hi @Sadisms, thanks for filing this issue. Can you please set your log level to DEBUG if not already set? There may be some more logs related to this near this log line. Thank you!
Hi @mickmister , sorry for the very late reply, the error still appears, debug log is enabled, no strange logs are seen, here is an example:
{"timestamp":"2024-05-23 05:00:27.431 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:187","method":"POST","url":"/api/v4/users/ids","request_id":"tuicm7cx37re3k8iscr9th58se","user_id":"a56gykefwpduf84k4eopygq>
{"timestamp":"2024-05-23 05:00:27.440 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:187","method":"POST","url":"/api/v4/users/status/ids","request_id":"x8cxw5ce7t83zneno69uia46xy","user_id":"kpo3mtp5hp8mi8sx>
{"timestamp":"2024-05-23 05:00:27.444 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:187","method":"GET","url":"/api/v4/users/me","request_id":"hoo7ke5au3dmtmbfxzwwj1hgko","user_id":"jimjbexcm7f67rg8rmy1ntszz>
{"timestamp":"2024-05-23 05:00:27.446 Z","level":"error","msg":"WebhookWorker id: 7, error posting to channel, err: CreatePost: Unable to save the Post.","caller":"app/plugin_api.go:1003","plugin_id":"jira"}
{"timestamp":"2024-05-23 05:00:27.449 Z","level":"debug","msg":"Websocket request","caller":"wsapi/websocket_handler.go:26","action":"user_update_active_status"}
{"timestamp":"2024-05-23 05:00:27.450 Z","level":"debug","msg":"Websocket request","caller":"wsapi/websocket_handler.go:26","action":"user_update_active_status"}
{"timestamp":"2024-05-23 05:00:27.451 Z","level":"debug","msg":"Websocket request","caller":"wsapi/websocket_handler.go:26","action":"user_update_active_status"}
@mickmister Explored a bit on this, the issue seems to be on the mattermost side(internal server error from their side), here is the permalink for the line from mattermost server which appears to be the source of the error.
On the Jira side, there seems to be no code that can cause this error. The only point from where an error can be returned is the call to the createPost function of the mattermost server. Here are some related permalinks. errorSouce, createPost Call
@Kshitij-Katiyar That's strange that we don't have a more descriptive error here
From the code that prepares the post in the plugin, it looks like we only populate:
ChannelIdUserIdMessageProps.Attachments(conditionally)
https://github.com/mattermost/mattermost-plugin-jira/blob/1b9490bffa36a6ec4fcc0b521a82885f3d1408bd/server/webhook.go#L63-L100
I'm thinking there may be an issue with the channel id provided. Maybe the channel is archived?
@Kshitij-Katiyar That's strange that we don't have a more descriptive error here
From the code that prepares the post in the plugin, it looks like we only populate:
ChannelIdUserIdMessageProps.Attachments(conditionally)https://github.com/mattermost/mattermost-plugin-jira/blob/1b9490bffa36a6ec4fcc0b521a82885f3d1408bd/server/webhook.go#L63-L100
I'm thinking there may be an issue with the channel id provided. Maybe the channel is archived?
@mickmister @wiggin77 I tried a few cases, but this error does not seem to reproduce:
-
Archived Channel: The message gets posted regardless.
-
Closed Channel: No message is posted in this case, but no error is logged in the system logs.
@Sadisms Are you still facing this issue or can we close it?
Closing for now, can reopen if someone faces the issue.