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

[BUG] bokube slack kubectl command gets "Invalid request. Dumping the response" #293

Closed
aavileli opened this issue Jun 22, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@aavileli
Copy link

version botkube-v0.10.0

│ DEBU[2020-06-22T02:23:21Z] Slack incoming message: &{Msg:{Type:message Channel:G0165LB8EKB User:U03S1C6TR Text:<@U015Z632C76> get pods Timestamp:1592792601.005300 ThreadTimestamp: IsStarred:false PinnedTo:[] Attachments:[] Edited:<nil │
│ > LastRead: Subscribed:false UnreadCount:0 SubType: Hidden:false DeletedTimestamp: EventTimestamp:1592792601.005300 BotID: Username: Icons:<nil> Inviter: Topic: Purpose: Name: OldName: Members:[] ReplyCount:0 Replies:[] ParentUserId:  │
│ Files:[] Upload:false Comment:<nil> ItemType: ReplyTo:0 Team:T03Q6GN2A Reactions:[] ResponseType: ReplaceOriginal:false DeleteOriginal:false Blocks:{BlockSet:[]}} SubMessage:<nil> PreviousMessage:<nil>}                                 │
│ INFO[2020-06-22T02:23:21Z] Invalid request. Dumping the response
@aavileli aavileli added the bug Something isn't working label Jun 22, 2020
@PrasadG193
Copy link
Collaborator

@aavileli have you enabled kubectl command execution? Could you please share settings section in BotKube config?

@aavileli
Copy link
Author

aavileli commented Jun 22, 2020

Hi @PrasadG193 in the above debug output from container I can see the slack command is received

Here is the settings from the configmap botkube-configmap

    settings:
      allowkubectl: true
      clustername: ashtest
      configwatcher: false
      kubectl:
        commands:
          resources:
          - deployments
          - pods
          - namespaces
          - daemonsets
          - statefulsets
          - storageclasses
          - nodes
          verbs:
          - api-resources
          - api-versions
          - cluster-info
          - describe
          - diff
          - explain
          - get
          - logs
          - top
          - auth
        defaultNamespace: default
        enabled: true
        restrictAccess: false
      restrictAccess: false
      upgradeNotifier: true
    ssl:
      enabled: false
kind: ConfigMap

@PrasadG193
Copy link
Collaborator

Can you please tell me how did you install BotKube? Are you following instructions from https://www.botkube.io/installation/? The configuration you provided is for development version of BotKube.

@aavileli
Copy link
Author

I used helm install instructions from the website and made a copy of the values file from here
https://github.com/infracloudio/botkube/blob/develop/helm/botkube/values.yaml.
I will make a copy of this tag https://github.com/infracloudio/botkube/blob/v0.10.0/helm/botkube/values.yaml and test

helm install --version v0.10.0 botkube --namespace ashtest --values ./customconfig.yaml infracloudio/botkube

@aavileli
Copy link
Author

tried got the same result

 DEBU[2020-06-22T06:29:59Z] Slack incoming message: &{Msg:{Type:message Channel:G0165LB8EKB User:U03S1C6TR Text:<@U015Z632C76> top pods Timestamp:1592807398.012400 ThreadTimestamp: IsStarred:false PinnedTo:[] Attachments:[] Edited:<n │
│ il> LastRead: Subscribed:false UnreadCount:0 SubType: Hidden:false DeletedTimestamp: EventTimestamp:1592807398.012400 BotID: Username: Icons:<nil> Inviter: Topic: Purpose: Name: OldName: Members:[] ReplyCount:0 Replies:[] ParentUser │
│ Id: Files:[] Upload:false Comment:<nil> ItemType: ReplyTo:0 Team:T03Q6GN2A Reactions:[] ResponseType: ReplaceOriginal:false DeleteOriginal:false Blocks:{BlockSet:[]}} SubMessage:<nil> PreviousMessage:<nil>}                           │
                                                                                                  │
│ INFO[2020-06-22T06:29:59Z] Invalid request. Dumping the response
    settings:
      allowkubectl: true
      clustername: ashtest
      configwatcher: true
      restrictAccess: false
      upgradeNotifier: true
    ssl:
      enabled: false
kind: ConfigMap

@aavileli
Copy link
Author

ok figured it out based on the code
https://github.com/infracloudio/botkube/blob/v0.10.0/pkg/bot/slack.go

			// Serve only if current channel is in config
			if b.ChannelName == info.Name {
				sm.IsAuthChannel = true
			}

sm.IsAuthChannel Was false.

In slack, you can subscribe bots to many channels this was getting set to false as the channel is not in the config field channel.

Thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants