heilerich / Rocket.Chat.App-Slackline

Rocket.Chat app that enables users to import and receive private messages from a Slack instance
0 stars 0 forks source link

/slackline command not appearing #3

Closed brasofilo closed 2 years ago

brasofilo commented 2 years ago

I followed all steps to create a Slack app and install it on my workspace. On Slackline I entered the Slack app ID and Secret.

When I try to run the command /slackline login on a Rocket Chat channel it says it doesn't recognize the command.

I did run the following cUrl command and it returns an Internal Error:

curl -X POST https://chat.mydomain.org/api/apps/public/f36c9423-c624-49f7-a077-318ade5dc13b/slackevent

This is the log registered for the command above:

April 23, 2022 3:06 PM: "apiExecutor" (1ms)
Instance: gnK3pNkTi72A47zKG
debug: 2022-04-23T18:06:16.691Z Caller: anonymous OR constructor

[
  "slackevent's post is being executed...",
  {
    "method": "post",
    "headers": {
      "host": "localhost:5000",
      "user-agent": "curl/7.68.0",
      "accept": "*/*",
      "x-forwarded-for": "000.0.217.00",
      "x-forwarded-host": "chat.mydomain.org",
      "x-forwarded-server": "chat.mydomain.org",
      "connection": "Keep-Alive"
    },
    "query": {},
    "params": {},
    "content": {}
  }
]

warning: 2022-04-23T18:06:16.691Z Caller: failRequest -> failRequest

[
  "Received invalid call so slackevent endpoint",
  {
    "request": {
      "method": "post",
      "headers": {
        "host": "localhost:5000",
        "user-agent": "curl/7.68.0",
        "accept": "*/*",
        "x-forwarded-for": "000.0.217.00",
        "x-forwarded-host": "chat.mydomain.org",
        "x-forwarded-server": "chat.mydomain.org",
        "connection": "Keep-Alive"
      },
      "query": {},
      "params": {},
      "content": {}
    },
    "message": "No request type"
  }
]

debug: 2022-04-23T18:06:16.691Z Caller: anonymous OR constructor

[
  "slackevent's post was successfully executed."
]

The log for the GET oauth curl command is basically the same with this difference: "message": "Expected code & state"

What else could I do to further debug and troubleshoot this?

Thanks!

heilerich commented 2 years ago

The results you are seeing with your requests to the API endpoints are the expected behavior.

The slash command will not be available if either the client ID or secret are not set in the app's settings. Can you verify that those settings have the expected values?

To provide further insight other than that I would need more of the log file, e.g. from instance startup up to the first failed try of executing the slash command.

brasofilo commented 2 years ago

Hi Felix, thanks for checking out

More info. These items appear on the logs when I save Slackline settings

"onPreSettingUpdate"

debug: 2022-04-28T00:35:50.572Z Caller: anonymous OR constructor
[
  "onPreSettingUpdate is being called..."
]

debug: 2022-04-28T00:35:50.579Z Caller: anonymous OR constructor
[
  "'onPreSettingUpdate' was successfully called! The result is:",
  {
    "id": "slack_client_secret",
    "type": "string",
    "packageValue": "",
    "required": true,
    "public": false,
    "i18nLabel": "slack_api_secret",
    "i18nDescription": "slack_api_secret_description",
    "createdAt": "2022-04-20T00:48:04.508Z",
    "updatedAt": "2022-04-28T00:35:06.559Z",
    "value": "76c3f6633db7b--------------------"
  }
]

"onSettingUpdated"

debug: 2022-04-28T00:35:50.597Z Caller: anonymous OR constructor
[
  "onSettingUpdated is being called..."
]

debug: 2022-04-28T00:35:50.599Z Caller: anonymous OR constructor
[
  "'onSettingUpdated' was successfully called! The result is:",
  null
]

This is the Slack app on api.slack.com:

image

And this is the Slackline settings:

image

brasofilo commented 2 years ago

Funny that this SlackBridge is disabled and keeps appearing, could it be related?

image

DailyDome commented 2 years ago

Heya guys,

got the same issue like @brasofilo

heilerich commented 2 years ago

@brasofilo @DailyDome Can you provide more information about your environment, i.e. has this ever worked for you or is this a fresh installation? What RC version are you using? Is it running in a container?

brasofilo commented 2 years ago

My installation is fresh, no container, installed through Snap. I'm not the one that installed it, though...

Running on: Ubuntu 18.04 with 4gb ram and 2 vcore

Rocket Chat info: Version: 4.6.2 Apps Engine Version: 1.31.0 Node Version: v14.18.3 Database Migration: 258 (April 19, 2022 1:57 PM) MongoDB: 4.2.17 / wiredTiger (oplog Enabled) Commit Details: HEAD: (e8cb66624) | Branch: HEAD

DailyDome commented 2 years ago

@heilerich

Tried with two installations (since i had to reinstall rocket chat due to RC issues) both were / are fresh installation:

Current (Docker Container): Host: Ubuntu 20.04 LTS 2 vCore (based on AMD Epyc), 2gb ram Docker version 20.10.14, build a224086 Docker Compose version v2.4.1 App Version: 4.6.3 Apps Engine Version: 1.31.0 Node Version: v14.18.3 Database Migration: 258 (April 29, 2022 0:26) MongoDB: 4.2.19 / wiredTiger (oplog Enabled) Commit Details: HEAD: (596881ec9) | Branch: HEAD

Tried same with SNAP-Installation, versions were one behind (app 4.6.2, mongo were 4.2.18 as far as i can remember)

brasofilo commented 2 years ago

It started working and I don't know why

image