Slack nodes for KNIME

I tried to add everything but identity/admin scopes but the result is same. It seems that only channels created before 5th May 2017 are available which is really odd. Thank you for fast responses, at least now we have an idea where the problem is, just need to get around it.

@atolvanen

I have updated from v1.6.0 to v3.0.3 of the jslack library on the nightly build which gives version 2.1.0 of the KNIME plugin.

Can you please try to see if you still have the issue with this version?

I’ve also made the following changes:

  1. Added a Get Users node

  2. Added a Message Slack User node. This node is still in beta
    image

Annoyingly the @{user} (display name) in Slack isn’t unique so I couldn’t use this as the user string provided. Instead you have to provide the users ID; I don’t like this and will have a think about how it can be improved.

Cheers

Sam

2 Likes

Unfortunately the Message Slack channel and Get Channels/Channel Names nodes still work the same, so no change there. How ever I can send private message for users (at least for myself) and I can also list all users with Get Users node and interestingly using the Channel History node I can list all messages from my public test channel I cannot message for. Channel History does not work for private channel I have added the app on tho. We can use this private message ability for our purposes how ever, so this has been a great help already!

I also asked about the user rights from our sysadmins and they said that there should not be anything that would cause anything like this. How ever I asked about the date on channels I can list with the app and around that date we have started to use Google authentication with Slack. So it seems that the app cannot see channels that have been made trough Google authentication. I don’t know how this could change the behavior like that or maybe it is just a coincidence with the dates?

Channel History node I can list all messages from my public test channel I cannot message for

This node still uses the old method rather than the ‘conversations api’ that’s used to interact with private channels. I should have also updated this node but it seems it slipped through

We can use this private message ability for our purposes how ever, so this has been a great help already!

I’m glad you have a viable work around

How ever I asked about the date on channels I can list with the app and around that date we have started to use Google authentication with Slack. So it seems that the app cannot see channels that have been made trough Google authentication. I don’t know how this could change the behavior like that or maybe it is just a coincidence with the dates?

I’ll have a look and see if I can find anything that may cause a different with google auth. I assume you’re an enterprise slack user?

Cheers

Sam

We have the Standard plan.

Hey, I am still getting NullPointerException by providing oAuth Token and Bot oAuth Token.

Could any one help me out?

Note: I dont see Chot:write:bot scope in my scopes list. I have added other scopes that mentioned in this thread.

Hi @raghum

Can you provide me some more details? When do the NullPointerException get thrown, is it executing any node?

Could you share the stack trace? If this isn’t in the Knime console you can find this in the log file.

Cheers

Sam

Thanks for the response Sam.

Here it is,
2020-03-27 19:08:08,334 : ERROR : KNIME-Worker-4043-Message Slack channel 6:49 : : Node : Message Slack channel : 6:49 : Execute failed: (“NullPointerException”): null
java.lang.NullPointerException
at com.sjwebb.knime.slack.api.SlackBotApi.getChannelList(SlackBotApi.java:85)
at com.sjwebb.knime.slack.api.SlackBotApi.getChannelList(SlackBotApi.java:62)
at com.sjwebb.knime.slack.api.SlackBotApi.findChannelWithName(SlackBotApi.java:141)
at com.sjwebb.knime.slack.nodes.messages.send.SendMessageNodeModel.execute(SendMessageNodeModel.java:45)
at org.knime.core.node.NodeModel.execute(NodeModel.java:737)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:571)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1236)
at org.knime.core.node.Node.execute(Node.java:1016)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:557)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:218)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:124)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

Thank you for the stack trace. It would appear my handling of the response from Slack needs improving here. I’ll update the node to try report the issue a bit better hopefully this evening.

Which version of KNIME are you using?

Could you try using the nightly build of the Slack nodes which can be installed from this update site:

KNIME Community Contributions (trunk) - https://update.knime.com/community-contributions/trunk/

This version has a few improvements that haven’t been released to main builds yet and if we’re lucky I may have already fixed the issue you are having.

Cheers

Sam

I am using 4.1.2 version.

I am unable to download provided link due to lack of permissions.

Is there alternate way to download this version?

Are you trying to access the URL in a browser or do you not have permissions to access it in KNIME?

This is what I meant for you to do:

If that is what you did then you can download a zipped version from this link: http://update.knime.com/community-contributions/trunk/CommunityContributions_trunk_202003270647.zip

Cheers

Sam

2 Likes

Well, I have same version on my m/c. I will wait for next steps from you.

Hrm maybe the nightly build version number is behind as the stack trace implies you’re on a release build rather than the nightly build.

I’ve added some additional error handling into the master build so we should now be able to see what’s going wrong.

I’ve also merged the significant changes to the nightly build over into the KNIME 4.1 build.

The version in the nightly/trunk build has already been built, the KNIME 4.1 build is still running (available in half an hour from now maybe).

The new version is version 2.0.1 - the timestamp at the end will differ between the nightly and 4.1 build when it’s finished.

image

If it works on the new version please let me know otherwise please share the new stack trace.

If you have KNIME open you will need to restart it as it will have cached an out of date update site.

Cheers

Sam

1 Like

Now, i am getting following error

ERROR Message Slack channel 0:5 Execute failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Are you behind a company proxy or firewall? It looks like something is interfering with the connection between KNIME and Slack.

1 Like

Yes, I guess so but when I disconnected form my VPN then I received following error.

ERROR Message Slack channel 0:5 Execute failed: API call failed: missing_scope

This one we should be able to fix.

I’ll double check the scopes when I get back on a PC but for now do you have the scopes in this image added:

https://forum.knime.com/uploads/default/original/2X/f/f326d8fec5dd744a5432f5eead66d1e86073cc19.png

You mentioned you couldn’t find chat:write:bot, I don’t think that is needed for getting the channel names but probably will be to send the message.

1 Like

Hi Sam,

Coming to firewall issue. We allowed access to *.slack.com. I would like to know is there any other domain to allow as part of this connectivity? I still get following message even though we allowed *.slack.com

ERROR Message Slack channel 0:5 Execute failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Please suggest.

First on the topic of the SSL issue:

In terms of allowing domains:

“Check whether your proxy is running SSL decryption. If it is, the proxy must either support WebSockets or you’ll need to exempt the following domains: *.slack-msgs.com wss-primary.slack.com wss-backup.slack.com wss-mobile.slack.com

Try adding:

Alternatively you could try adding your proxy SSL certificate into the Java keystore (KNIME’s version of Java). Though this can be a pain.

On the topic of permissions scopes:

It would appear since the last time I configured my app the slack scopes have changed and I’m going to have to go through the new scopes and work out the minimum set needed.

This is what Slack suggests covers the permissions I have set up using the old method:

Some of these don’t look necessary but maybe start with these in the meantime? Once I’ve worked out the new set I’ll update you.

Cheers

Sam

1 Like

Are these scopes mandatory?

Is it necessary to add both Bot Token and User Token scopes?