[Solved] Webhooks `No text specified [details: ]` error

I have a Problems with the new hooks introduced in v1.1
When I do a Hook over the curl command like shown in the example Incoming Webhooks, it all works great.
But when I let GitLab do the hook. It does not work.

Using CURL

curl -k -i -X POST -d 'payload={"text": "Hello, this is some text."}' https://mattermost.private.org/hooks/on4fee1tkiyydkifc1sx1u535o                                                    
HTTP/1.1 200 OK
Server: nginx/1.4.7
Date: Thu, 29 Oct 2015 11:33:23 GMT
Content-Type: text/plain
Content-Length: 2
Connection: keep-alive
X-Ratelimit-Limit: 10
X-Ratelimit-Remaining: 9
X-Ratelimit-Reset: 1
X-Request-Id: 657thq75ipr75c45p1p8acaquh
X-Version-Id: 1.1.0.1446116526

Mattermost ./platform log:

Oct 29 12:33:23 mattermost platform[1657]: [10/29/15 12:33:23] [DEBG] /hooks/on4fee1tkiyydkifc1sx1u535o

Using GitLab

I cant figure out how to crawl the HTTP request, so all I have is the production.log output of GitLab.

gitlab/production.log

Started GET "/td/game-prototype/hooks/32/test" for xxx.xxx.xxx.xxx at 2015-10-29 13:20:38 +0100
Processing by Projects::HooksController#test as HTML
  Parameters: {"namespace_id"=>"td", "project_id"=>"game-prototype", "id"=>"32"}
Redirected to https://git.devcontrol.org/td/game-prototype/hooks
Completed 302 Found in 159ms (ActiveRecord: 9.8ms)
Started GET "/td/game-prototype/hooks" for xxx.xxx.xxx.xxx at 2015-10-29 13:20:38 +0100
Processing by Projects::HooksController#index as HTML
  Parameters: {"namespace_id"=>"td", "project_id"=>"game-prototype"}
Completed 200 OK in 200ms (Views: 97.4ms | ActiveRecord: 14.8ms)

Mattermost ./platform log:

Oct 29 12:23:10 mattermost platform[1657]: [10/29/15 13:20:39] [EROR] /hooks/on4fee1tkiyydkifc1sx1u535o:incomingWebhook code=500 rid=crx48kysxjnz5xrydrt3qtih8y uid= ip=192.168.1.15 No text specified [details: ]

What I have tried

  • Disabling SSL
  • Serval DNS configurations ( I know, why bother, but I just wanted to be sure ).

There seems to be a bug that passes the travis-ci tests?? see: Home ā€“ Travis-CI

Hello,
I have the same error for slack integration, works fine with curl, but fails from slack with following log:

[2015/10/30 08:27:29 UTC] [EROR] /hooks/4nxy6qkf97n8ur8p6yypzuezhh:incomingWebhook code=500 rid=ocsxcf7j8iys9m7m577ajk7xbo uid= ip=54.165.66.184 No text specified [details: ]

Hereā€™s the POST request:

POST /hooks/4nxy6qkf97n8ur8p6yypzuezhh HTTP/1.1
User-Agent: Slackbot 1.0 (+https://api.slack.com/robots)
Host: mm.test.com
Accept: */*
Accept-Encoding: gzip,deflate
Content-Length: 238
Content-Type: application/x-www-form-urlencoded
Cache-Control: max-age=259200
Connection: keep-alive

token=justatoken&team_id=ourteamid&team_domain=ourdomain&service_id=13549101282&channel_id=C04ESECHD&channel_name=dev-custom-support&timestamp=1446193643.000082&user_id=U031QGRTP&user_name=jirka&text=pour+la+capture+wireshark

Many thanks,
Jirka

Hi @zwarag and @jirka

This is a known issue that should be fixed in master (meaning it will be fixed in the 1.2 release coming up). GitLab and Slack send ā€˜attachmentsā€™ with their outgoing webhooks which we donā€™t yet support.

The fix currently in for the 1.2 release will stop the incoming webhook from breaking when attachments are present (it will just use the plaintext) and itā€™s on our roadmap to convert Slackā€™s attachments to Markdown so that weā€™re 100% compatible

1 Like

Hello,
Many thanks for your help, actually it was my fault, Iā€™ve been too fast and missed the need of conversion from the slackā€™s format to json. Credits to @jwilander :

token=justatoken&team_id=ourteamid&team_domain=ourdomain&service_id=13549101282&channel_id=C04ESECHD&channel_name=dev-custom-support&timestamp=1446193643.000082&user_id=U031QGRTP&user_name=jirka&text=pour+la+capture+wireshark

It needs to be formatted as a JSON object in a payload parameter (or as straight JSON if you use Content-Type: application/json) like this:

payload={"text": "pour la capture wireshark", "channel": "dev-custom-support", "username": "jirka"}

Jirka

Thank you for the response @jwilander.
Nice to let be let down and getting an answer

Shouldnā€™t this be fixed with the 1.2 release? Iā€™m still getting that error.

Maybe Iā€™m doing it wrongā€¦ Is there a guide on how to set up the hooks for GitLab yet?
Iā€™m hosting Mattermost on a separate server but successfully use the GitLab Oauth authentication.

Hi @zwarag,

Thereā€™s a new GitLab Mattermost Admin Guide with references to Mattermost documentation most relevant to GitLab users.

Here are instructions for hooking up Mattermost to the default GitLab Slack UI

Please let us know if youā€™re still having issues?

There is one minor outstanding issue still outstanding in v1.2.1.

1 Like

We Get the same error with 2.0 and jira. Hints anyone?

Update:2.0 that is

Hi @rompic, are you having the issue with outgoing webhooks, incoming webhooks or slash commands?

Having a similar error between Mattermost and Gitlab. Prior to upgrading to 8.5.1, the integration seemed to be working fine. After upgrading, every time the outgoing hook from Gitlab fires (testing or a real event), it throws up a 500 error. In sidekiq.log I see:

 "error_message"=>"getaddrinfo: Name or service not known", "error_class"=>"SocketError"

Followed by:

WARN: SocketError: getaddrinfo: Name or service not known

dig shows that address resolution is working OK, and curl posts out to Mattermost successfully, so Iā€™m not sure whatā€™s throwing the error.

EDIT: More information from production.log

Started GET "/testingroup/mattermost/services/slack/test" for 127.0.0.1 at 2016-02-26 11:37:36 -0500
Processing by Projects::ServicesController#test as HTML
  Parameters: {"namespace_id"=>"testingroup", "project_id"=>"mattermost", "id"=>"slack"}
Completed 500 Internal Server Error in 137ms (ActiveRecord: 5.6ms)

SocketError (getaddrinfo: Name or service not known):
  app/models/project_services/slack_service.rb:101:in `execute'
  app/models/service.rb:106:in `test'
  app/controllers/projects/services_controller.rb:49:in `test'

With Incoming webhooks

Hi @jweare, is there anything showing up in your Mattermost log?

Are you able to provide the server logs with the errors? We have the Jira integration running on our own instance and it seems to work fine.

Can you also provide me with some extra information on how youā€™re using the Jira integration? It might be different than how we do it, hence us not noticing any issues

Hi @jwilander, thereā€™s nothing that shows up in mattermost.log, no. Iā€™m wondering if the failure is entirely on the Gitlab sideā€¦

Is this the only integration you have running? Maybe try setting up a different one to test if that works. If Mattermost works with a different integration the issue could be on the GitLab side or a specific problem with the GitLab integration itself (maybe a change in GitLab broke the integration).

If you donā€™t have the latest version of the integration you might be able to get it here. You can also open an issue there to see if anyone else is having your problem.

Thanks @jwilander. I set up mattertee just to make sure that things are working correctly that way, so Iā€™m pretty sure this issue is on the Gitlab side. Again, thanks for your help!

1 Like

Hi. I have a same problem with Mattermost Team EditionVersion:2.0.0 Build Number:5950 and GitLab Community Edition 8.5.5 11f388a

It looks like this.

[2016/03/14
 05:20:48 EDT] [EROR] /hooks/g3iu3rfdkinozf6z5xp13tq3hy:incomingWebhook 
code=500 rid=7dfb1atgmiyp3n1o91oa8juxuo uid= ip=192.168.1.24 No text 
specified [details: ]
[2016/03/14
 05:22:54 EDT] [EROR] /hooks/g3iu3rfdkinozf6z5xp13tq3hy:incomingWebhook 
code=500 rid=4u4cqdtsmtnkdfj995zanoymer uid= ip=192.168.1.24 No text 
specified [details: ]
[2016/03/14
 05:36:28 EDT] [EROR] /hooks/g3iu3rfdkinozf6z5xp13tq3hy:incomingWebhook 
code=500 rid=xmhwo8qanjfdzbdoehuejd1mja uid= ip=192.168.1.24 No text 
specified [details: ]
[2016/03/14
 05:38:36 EDT] [EROR] /hooks/g3iu3rfdkinozf6z5xp13tq3hy:incomingWebhook 
code=500 rid=uw31mahinigs8cywc75ut3op4y uid= ip=192.168.1.24 No text 
specified [details: ]
[2016/03/14
 05:48:20 EDT] [EROR] /hooks/g3iu3rfdkinozf6z5xp13tq3hy:incomingWebhook 
code=500 rid=wxexy5x787fr3m4pq7gadti8ge uid= ip=192.168.1.24 No text 
specified [details: ]
[2016/03/14
 05:48:35 EDT] [EROR] /hooks/g3iu3rfdkinozf6z5xp13tq3hy:incomingWebhook 
code=500 rid=uj9kt199jfgbpbomb4ok6ugauo uid= ip=192.168.1.24 No text 
specified [details: ]
[2016/03/14
 05:58:35 EDT] [EROR] /hooks/rfbfobaeujr6fcgnynz77itmpr:incomingWebhook 
code=500 rid=8o74nkpucbnt8y8kdf18e35s1e uid= ip=192.168.1.24 No text 
specified [details: ]

Having the same issue with 2.0 docker image. WebHook works fine when I compose it myself, but when I let TFS generate it, I get a 500 error.

Hi @mrcaron,

You will need some sort of immediate translator between TFS and Mattermost. Mattermost webhooks must be formatted as described here in our documentation.

Iā€™m not overly familiar with TFS but I imagine the format of their outgoing webhooks does not match the format of our incoming webhooks (this is normal between any practically any two products), hence the need for some intermediate application to act as a translator.

Yeah, thatā€™s what I figured. Iā€™m writing a little node server on the same linux box to receive the hook and pass it along with a ā€œtextā€ property.