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

Error when running cron job #24

Closed
skeet opened this issue Feb 5, 2015 · 17 comments
Closed

Error when running cron job #24

skeet opened this issue Feb 5, 2015 · 17 comments

Comments

@skeet
Copy link

skeet commented Feb 5, 2015

I'm getting an error after setting up a new cron job via Slack. It's set up to send messages to a public room called #development.

e.g:

hubot new job 0 10 * * 1-5 "It's time for standup, folks!"

458293: 0 10 * * 1-5 @C033R5PHW "It's time for standup, folks!"

The job worked fine for a few days but now I can see the following error in the logs:

2015-02-05T10:00:00.802614+00:00 app[web.1]: Sending message
2015-02-05T10:00:01.575453+00:00 app[web.1]: Slack services error: 500
2015-02-05T10:00:01.575612+00:00 app[web.1]: Invalid channel specified

Any idea how I can resolve this?

Thanks.

@skeet
Copy link
Author

skeet commented Feb 19, 2015

Quick update:

I've not seen the "Invalid channel specified" error since prepending a hash to the room ID:-

cron.coffee:

sendMessage: (robot) ->
    envelope = user: @user, room: "#" + @user.room
    robot.send envelope, @message

Happy to make a PR if you think it's an issue.

@skeet skeet closed this as completed Feb 19, 2015
@miyagawa
Copy link
Owner

well if you do that it will break all other adapters.

@skeet
Copy link
Author

skeet commented Feb 19, 2015

Your plugin doesn't work for Slack then.

@miyagawa
Copy link
Owner

But in OP you said it works sometimes but sometimes doesn't? Can you spot the difference?

@skeet
Copy link
Author

skeet commented Feb 19, 2015

Working "sometimes" makes it a completely non-viable option for Slack.

@miyagawa
Copy link
Owner

@skeet geez, I meant: if you can tell the difference when it works and when it doesn't, we can figure out a fix to make it always work. Blindly adding '#' makes all adapters fail (and often fails on Slack either, assuming the original code sometimes works).

@miyagawa
Copy link
Owner

I looked at the slack adapter and these change look suspicious:
slackapi/node-slack-sdk@9b45412
slackapi/hubot-slack#136

@skeet
Copy link
Author

skeet commented Feb 19, 2015

Ok apologies, I misunderstood.

I agree that looks suspicious. I'm not familiar at all with how the Slack client works though I do believe all public Slack channels should start with a hash.

@miyagawa
Copy link
Owner

@skeet can you note the versions of node-slack-client and hubot-slack you're currently using?

Apparently the issue is not released to npm yet on the node-slack-client/hubot-slack side, and I hope it gets fixed once they're shipped...

@skeet
Copy link
Author

skeet commented Feb 19, 2015

hubot-slack: 2.2.0

I don't think I can get the version of node-slack-client as we connect to hubot via the Slack admin interface as an integration and I don't get any version information.

Yeah, let's hope so.

Cool, thanks for your help.

@miyagawa
Copy link
Owner

I don't think I can get the version of node-slack-client as we connect to hubot via the Slack admin interface as an integration and I don't get any version information.

Hm, not sure if it's relevant :) I guess you can get the version by looking at:
node_modules/hubot-slack/node_modules/slack-client/package.json

@skeet
Copy link
Author

skeet commented Feb 19, 2015

Ah, version 2.2.0 doesn't have any dependencies hence why I couldn't find it!

https://github.com/slackhq/hubot-slack/blob/2.2.0/package.json

@miyagawa
Copy link
Owner

Aha, interesting. Thanks for checking :)

@tvmanikandan
Copy link

I am using slack adapter. Please confirm how to use your module with slack adapter.

@tvmanikandan
Copy link

skeet:,
How did you create the below command:
hubot new job 0 10 * * 1-5 "It's time for standup, folks!"

I am running the below command to invoke hubot , but then not able to figure out to create cron command like above.

my usage model:
bin/hubot -a slack => Loads all .js and .coffee files in scripts directory.

-Mani

@tvmanikandan
Copy link

where do I find about creating hubot rooms, getting hubot room details , getting hubot users list ? Please let me know.

-mani

@skeet
Copy link
Author

skeet commented Jul 9, 2015

@tvmanikandan I can run it locally just with:

bin/hubot

Then:

hubot> hubot new job 0 10 * * 1-5 "It's time for standup, folks!"
Job 867617 created

You maybe just have to follow the specific instructions for Slack? https://github.com/slackhq/hubot-slack

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

3 participants