Slack nodes for KNIME

@raghum I think this is fixed now and it should install in 4.1 (v2.6.1 is the latest you will need to restart KNIME before trying to update if you have it open already).

I think I also fixed the issue with regards to more than 1000 channels/users. I think you no longer need to uncheck the ‘Lookup conversation’ option and the private channels should now appear in the Get Channels node output.

That sounds great. What was the change to overcome Lookup conversation?

The first thing the node does is make an API request to get all the available channels. We do this to get the channel ID and check the channel name is valid.

There is max limit of 1000 results being returned by the slack API call. However, if you hit that limit then the response also contains a ‘cursor’ value. If you make the call again with the cursor set you get the next set of channels.

I hadn’t spotted the cursor functionality in the Slack API so the nodes just got the first 1000 channels and stopped. If your channel was 1001 or later the KNIME nodes treated it as if it didn’t exist.

When I get the available channels or users now I keep making the call until the cursor is completed. So we should no longer have missing channels or users in large workspaces.

Perfect, Thanks for all.

A post was split to a new topic: Executor cannot load job because of missing node.

Hello Sam,

We are receiving strange error while using these slack nodes through scheduler. However, it works as expected through KNIME AP.

Could you please look into it at HIGH priority?

Log errors:
org.eclipse.core.runtime.CoreException: Error occurred while loading workflow into memory: An error occurred during the creation of a job for ‘/engineering/integration/finalfrontier/test’: No such node ID: 128

at com.knime.explorer.server.rest.RestServerExplorerFileStore.throwCoreException(RestServerExplorerFileStore.java:403)
at com.knime.explorer.server.rest.RestServerExplorerFileStore.loadWorkflow(RestServerExplorerFileStore.java:1356)
at com.knime.explorer.server.internal.view.actions.rest.RestServerExecuteAction.execute(RestServerExecuteAction.java:251)
at com.knime.explorer.server.internal.view.actions.rest.RestServerExecuteAction.access$1(RestServerExecuteAction.java:245)
at com.knime.explorer.server.internal.view.actions.rest.RestServerExecuteAction$2.run(RestServerExecuteAction.java:155)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

Caused by: java.lang.RuntimeException: An error occurred during the creation of a job for ‘/engineering/integration/finalfrontier/test’: No such node ID: 128

at com.knime.explorer.server.rest.RestServerContent.createWorkflowJob(RestServerContent.java:1862)
at com.knime.explorer.server.rest.RestServerExplorerFileStore.loadWorkflow(RestServerExplorerFileStore.java:1348)
... 4 more

2020-08-19 11:30:01,255 : WARN : main : : Node : Message Slack User (beta) : 12:6 : Errors overwriting node settings with flow variables: Unknown variable “icon_url”
2020-08-19 11:30:07,599 : ERROR : Worker-100 : : RestServerExecuteAction : : : Error occurred while loading workflow into memory: An error occurred during the creation of a job for ‘/engineering/integration/finalfrontier/test’: No such node ID: 128

org.eclipse.core.runtime.CoreException: Error occurred while loading workflow into memory: An error occurred during the creation of a job for ‘/engineering/integration/finalfrontier/test’: No such node ID: 128

at com.knime.explorer.server.rest.RestServerExplorerFileStore.throwCoreException(RestServerExplorerFileStore.java:403)
at com.knime.explorer.server.rest.RestServerExplorerFileStore.loadWorkflow(RestServerExplorerFileStore.java:1356)
at com.knime.explorer.server.internal.view.actions.rest.RestServerExecuteAction.execute(RestServerExecuteAction.java:251)
at com.knime.explorer.server.internal.view.actions.rest.RestServerExecuteAction.access$1(RestServerExecuteAction.java:245)
at com.knime.explorer.server.internal.view.actions.rest.RestServerExecuteAction$2.run(RestServerExecuteAction.java:155)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

Caused by: java.lang.RuntimeException: An error occurred during the creation of a job for ‘/engineering/integration/finalfrontier/test’: No such node ID: 128

![Screen Shot 2020-08-19 at 11.01.39 AM|428x500]

(upload://1oonP5r3DP6SeqTWUpIHQr0feAP.png)

Hello Sam,

One more thing is, we are trying to send message to new private channel by creating new private channel under Slack and it is throwing an error channel name is not valid error.

Will it take time to reflect?

Will try tomorrow once again and update you on the same.

Regards, Raghu.

I would have thought it would be available to use instantly as long as you add the bot to the channel.

Maybe my second attempt at fixing the not valid issue wasn’t as successful as I’d hoped. Does it still error when unchecking the new Lookup conversation option in the dialog?

I get following error when I try by unchecking the Lookup conversation option
Failed to post message:channel_not_found

Is the bot definately in the channel?

You should also get a channel_not_found response from the Slack API tester. If you do then it’s an issue with your slack bot if it works its an issue with the node. Can you check and let me know?

Yes, I am able to send message to new private channel with Slack API tester.

Ok, thanks for confirming.

I’ll take another look but I’m not sure how soon I’ll have you an answer. I thought we’d resolved this issue when we fixed you being able to send messages to the private channels 10 days ago. It’s not obvious why it wouldn’t also work for the newly made channels.

yeah… that looks odd and strange as well.

Sam, do we have any update on this?

I’m afraid I haven’t yet found a reason why it fails in the node but not via the API tester.

I have however put together a workaround for you:

This component uses only native KNIME nodes to make a post request to the slack API (which is actually what the slack node is doing behind the scenes).

The component dialog looks like:

image

Contents of the component:

All you need to do is fill in the dialog, the component will handle configuring the POST Request node with your token, channel name and text.

On success you should see some output such as:

On failure you will see something like:

As your request works in the API tester I expect this component will succeed. I’d appreciate it if you could let me know if it does/doesn’t pass.

Can I just confirm you can send the messages to the private channels we fixed the nodes for originally? It’s just the new channels it doesn’t work for?

Cheers

Sam

Yes, I can confirm that we can able to send message to private channels but not NEWly created private channels.

Could you confirm do you use KNIME nodes behind the scenes?

Could you confirm do you use KNIME nodes behind the scenes?

The ones from the component I shared? No, the dedicated nodes call onto the now official slack java api (formerly jslack). Which uses the okhttp java library to make the call to Slack as a POST request.

I’ve taken another read through the slack chatPostmessage documentation and the node. I’ve got some questions to help debug:

  1. Were you able to send a message to the channel using the component I shared?
  2. Does the channel name have any special characters in it?
  3. Does it work if you use the channel ID rather than the channel name (make sure Lookup conversation is disabled). The channel ID can be found if you navigate to the channel in a browser https://app.slack.com/client/xxxxxx/G011DQKBL9H the channel ID is the last bit.
  4. Can you try with the a # in front of the channel name: so demo-private would be #demo-private
  5. Can you message new public channels

Cheers

Sam

Sam,

We able to send message to new channels now by adding app into that channel.

Now,

  1. Not able to send message using Row based Slack Channel. No messages received even after successful run.
  2. Title (username) not working for Slack Channel node

Could you please look into these?

Are you trying to send lots of messages in quick succession? Slack has limits on how many API requests you can make (rate limiting). For chatPostmessage I think it’s about 1 per second is the max with some burst behaviour allowed.

The nodes don’t do anything to try to help manage this I can look at options for helping with this. Maybe enabling a customisable delay between sending messages. Though maybe I’m thinking down the wrong lines.

When you say title not working is this at all? Or its using the title for the first message but then not updating?