Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

returned an empty response #2

Open
waki6ra opened this issue Feb 6, 2017 · 4 comments
Open

returned an empty response #2

waki6ra opened this issue Feb 6, 2017 · 4 comments

Comments

@waki6ra
Copy link

waki6ra commented Feb 6, 2017

Thank you for a wonderful hubot.
I installed it in my environment and I was able to use the hubot command.
However, every time I use a slash command, an error log is output to the mattermost. Is this normal?

input:
/slashbot myhubot-name ping

response:
PONG

Error log:
Command with a trigger of 'slashbot' returned an empty response [details:]

@wpears
Copy link
Contributor

wpears commented Feb 9, 2017

The typical input here is /mybot <command> from a mattermost channel where mybot is your bot's name and <command> is the command you want to run, ie /mybot ping. If the slash-command is setup properly in integrations, this should be equivalent to saying mybot ping in a channel the bot has entered.

@waki6ra
Copy link
Author

waki6ra commented Feb 15, 2017

Without installing in the document, placing your mattermost-slashbot.js in the scripts directory, it worked as expected.
(It can still work now.)

I created another hubot and installed it again according to the document, but now I do not get a return an empty response and now comes out as We received an unexpected status code from the server. (504) It was.

In my Linux environment strace hubot seems to receive POST from mattermost, but it does not seem to react to it.

Is there anything I can do to solve the problem?

@wpears
Copy link
Contributor

wpears commented Feb 15, 2017

How this script functions is by intercepting the the POST from mattermost and creating a new message with the body of the slash command fed to the bot. If the command is a valid command for the bot, it should work.

If you're getting a 504 from issuing the slash command in mattermost it sounds like there is a server setup issue, check to make sure hubot and mattermost are setup correctly.

@waki6ra
Copy link
Author

waki6ra commented Mar 2, 2017

The first reported empty response was reproduced.

I will report the situation again.

Version: [email protected],
              [email protected],
              [email protected],
              [email protected]
Hubot name: hubot 1
Trigger word: hubot 1
Request url: http://127.0.0.1:40900/hubot/command
Executed strace command: strace -tt -s 999 -e trace=write,read,writev,connect -p [hubot pid]

Question:

  1. In case of success or in other cases returned an empty response is output to the log. Will not it be outputted in your environment? (Mattermost log)

  2. It did not work unless hubot name was specified after triling word. Looking at strace, it seems that hubot name is not passed to hubot. When I started hubot with --name "" it worked even with / hubot1 ping, but is your environment so?


Types: /hubot1 ping
Response: none
Log: Command with a trigger of 'hubot 1' returned an empty response [details:]
Strace:
15:53:00.448361 read(9, "POST /hubot/command HTTP/1.1\r\nHost: 127.0.0.1:40900\r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 257\r\nAccept: application/json\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept-Encoding: gzip\r\n\r\nchannel_id=a4fjtpzso7nd7ciwb8frx5fpza&channel_name=town-square&command=%2Fhubot1&response_url=not+supported+yet&team_domain=debug&team_id=gsoiqtrgmjd5zmyobsbouy3rno&text=ping&token=**************&user_id=htro3wh8ofyb5ppnoan3xit1jr&user_name=root", 65536) = 463

15:53:00.452185 write(9, "HTTP/1.1 200 OK\r\nX-Powered-By: hubot/hubot1\r\nContent-Type: text/plain\r\nDate: Mon, 13 Feb 2017 06:53:00 GMT\r\nConnection: keep-alive\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\n", 167) = 167


Types: /hubot1 hubot1 ping
Response: pong
Log: Command with a trigger of 'hubot 1' returned an empty response [details:]
Strace:
15:54:44.686026 read(12, "POST /hubot/command HTTP/1.1\r\nHost: 127.0.0.1:40900\r\nUser-Agent: Go-http-client/1.1\r\nContent-Length: 264\r\nAccept: application/json\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept-Encoding: gzip\r\n\r\nchannel_id=a4fjtpzso7nd7ciwb8frx5fpza&channel_name=town-square&command=%2Fhubot1&response_url=not+supported+yet&team_domain=debug&team_id=gsoiqtrgmjd5zmyobsbouy3rno&text=hubot1+ping&token=**************&user_id=htro3wh8ofyb5ppnoan3xit1jr&user_name=root", 65536) = 470

15:54:44.689975 write(12, "HTTP/1.1 200 OK\r\nX-Powered-By: hubot/hubot1\r\nContent-Type: text/plain\r\nDate: Mon, 13 Feb 2017 06:54:44 GMT\r\nConnection: keep-alive\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\n", 167) = 167

15:54:44.694347 connect(13, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("172.16.197.133")}, 16) = -1 EINPROGRESS (Operation now in progress)

15:54:44.697291 writev(13, [{"POST /hooks/************ HTTP/1.1\r\nUser-Agent: Hubot/2.19.0\r\nContent-Type: application/json\r\nHost: 172.16.197.133:8080\r\nContent-Length: 99\r\nConnection: close\r\n\r\n{\"icon_url\":\"http://127.0.0.1/hubot.png\",\"channel\":\"town-square\",\"username\":\"hubot1\",\"text\":\"PONG\"}", 274}, {"", 0}], 2) = 274

15:54:44.711924 read(13, "HTTP/1.1 200 OK\r\nServer: nginx/1.10.2\r\nDate: Mon, 13 Feb 2017 06:54:44 GMT\r\nContent-Type: text/plain\r\nContent-Length: 2\r\nConnection: close\r\nX-Cluster-Id: \r\nX-Request-Id: hzp9dowhttd18jyf1badde8z4a\r\nX-Version-Id: 3.6.0.3.6.2.0a58f31e79392e02e4c0eb666a95de1c\r\n\r\nok", 65536) = 262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants