Missing Mattermost notifications - maximum attachment length exceeded
Summary
We have a running GitLab instance (we use the Docker image), we have installed a separate Mattermost instance (not using the one in omnibus, but an external one). We have setup integration and for example it is working well for issues, MR, etc. However for wiki updates, only a fraction of the changes is written to the channel (so we do receive some notifications but not all).
Mattermost shows in its log many:
[2017/09/01 15:14:01 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14758 [details: ]
[2017/09/01 15:15:13 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14769 [details: ]
[2017/09/01 15:17:12 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14848 [details: ]
[2017/09/04 12:02:54 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14736 [details: ]
[2017/09/04 12:19:41 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14797 [details: ]
Steps to reproduce
- Prerequisite: install GitLab and Mattermost and configure them for integration.
- Create a webhook on a mattermost team
- In a GitLab project, setup integration for Mattermost Notification ticking the "wiki" notification and copy/pasting the webhook
- Create a wiki page in the gitlab project, a small one (e.g. containing just
# Hello World!) -> make sure the notification is published on Mattermost (it should) - Create or update a wiki page with substantial change (10000+ characters) -> no notification in Mattermost
- Check mattermost logs, it will reports something like
Maximum attachments length is 7900 characters, received size is 14797
Example Project
I could do that. Does GitLab have a Mattermost instance that could be used for testing?
What is the current bug behavior?
Some notifications for wiki page update are missing.
What is the expected correct behavior?
We receive all notifications of wiki changes.
Relevant logs and/or screenshots
Mattermost log:
[2017/09/01 15:14:01 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14758 [details: ]
[2017/09/01 15:15:13 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14769 [details: ]
[2017/09/01 15:17:12 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14848 [details: ]
[2017/09/04 12:02:54 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14736 [details: ]
[2017/09/04 12:19:41 UTC] [EROR] /hooks/*********:HandleIncomingWebhook code=400 rid=********* uid= ip=172.17.0.2 Maximum attachments length is 7900 characters, received size is 14797 [details: ]
No relevant logs from GitLab side at the time of the above events (the 2 machines have their clocks in sync). It only shows the wiki update and then some sidekiq and workhorse foo, but with no mention of the word mattermost nor the URL of the mattermost instance.
Output of checks
It seems that GitLab is sending too much data to Mattermost hook. So a GitLab bug, but no check are required here in my opinion.
Results of GitLab environment info
Expand for output related to GitLab environment info
$ docker exec -it gitlab gitlab-rake gitlab:env:infoSystem information System: Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.13.4 Sidekiq Version:5.0.0 Go Version: unknown
GitLab information Version: 9.4.5 Revision: 140292e Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://gitlab.vcs.de/gitlab HTTP Clone URL: https://gitlab.vcs.de/gitlab/some-group/some-project.git SSH Clone URL: git@gitlab.vcs.de:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.3.1 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
I think it is not relveant here. Anyway, like in a previous issue I created this week, it's all green!
Possible fixes
I would like to help, but sadly I currently do not have the time.