matrix-appservice-slack icon indicating copy to clipboard operation
matrix-appservice-slack copied to clipboard

Appservice won't create slackbot user

Open anaskaejdar opened this issue 6 years ago • 15 comments
trafficstars

I'm trying to run this appservice on my own instance. I'm following the readme's instructions. The readme seems inadequate because of #86. Following the readme, when it comes time to invite the slackbot to my admin control room, I find out that the slackbot user doesn't exist, which means the appservice isn't creating it.

When I launch the appservice, its console output looks like this:

$ node app.js -c config.yaml -p 25566
Unable to load crypto module: crypto will be disabled: Error: global.Olm is not defined
Mar-24 06:58:53.836 INFO app Matrix-side listening on port %s 25566
Mar-24 06:58:53.850 INFO SlackHookHandler Slack-side listening on port 9898 over http
Mar-24 06:58:53.907 INFO Main Loading teams.db

I don't know if it's supposed to progress beyond "Main Loading teams.db", but it never does. I've left it running for days, and this is still the last thing it's spat out. It might be hanging on something. I have restarted both the appservice and synapse several times to no avail. Anyway, I found out that if I invite the nonexistent MXID to a room despite it not existing, the appservice spits out this line on the console:

Mar-24 06:59:12.936 INFO bridge ::1 - - [24/Mar/2019:06:59:12 +0000] "PUT /transactions/5?access_token=<REDACTED> HTTP/1.1" 200 55 "-" "Synapse/0.99.2"

Sidenote: This seems like the sort of problem that could have been solved just by talking to somebody. So two and a half weeks ago, I went into #bridges:matrix.org (I was told that's /the/ place to get help with matrix-appservice-slack). Two and a half weeks ago, I asked. No response. A week later, I ask again, no response. Half a week ago, I asked for the third time, and still nobody has acknowledged me. I'm saying this because I feel awkward even posting this in the issue tracker... I just don't want to keep asking the same question for months, I want to get this bridge set up.

anaskaejdar avatar Mar 24 '19 07:03 anaskaejdar

I can confirm I have this same issue when trying to make appservice-sclack work. No user created and pretty much exact same messages on logs.

ADD/EDIT: appservice-slack from git, Synapse 0.99.2 from synapse debian repositories..

olmari avatar Mar 24 '19 20:03 olmari

Sorry to hear about this, and how this has been open for so long :(. Can you share your config so I can see if there is any divergence from what we are running?

Half-Shot avatar Apr 14 '19 22:04 Half-Shot

Here's my config, I tried a few different things in inbound_uri_prefix, like including the port, not including the port, using localhost, using the matrix port rather than the slack one, etc.

slack_hook_port: 9898
inbound_uri_prefix: "https://ostavrosnika.com:9898/"
bot_username: "slackbot"
username_prefix: "slack_"

# Optional
#slack_master_token: "abc-123-def"

# Optional
matrix_admin_room: "!jGXPpRqagMWxWHzrcp:ostavrosnika.com"

homeserver:
  url: http://localhost:8008
  server_name: ostavrosnika.com

# Optional
#tls:
#  key_file: /path/to/tls.key
#  crt_file: /path/to/tls.crt
#
#logging:
#  console: "info"
#  files:
#      - "./debug.log": "info"
#      - "./error.log": "error"

anaskaejdar avatar Apr 16 '19 23:04 anaskaejdar

Hmm, looks sane. And the reg file?

Half-Shot avatar Apr 17 '19 23:04 Half-Shot

id: 😃
hs_token: 🤷‍♂️
as_token: 🔥
namespaces:
  users:
    - exclusive: true
      regex: '@slack_.*'
  aliases: []
  rooms: []
url: 'http://localhost:25566'
sender_localpart: slackbot
rate_limited: true
protocols: null

anaskaejdar avatar Apr 18 '19 17:04 anaskaejdar

I'm having the same problem. One thing I tried was to update my reg file because the aliases seemed off.

namespaces:
  users:
    - exclusive: true
      regex: '@slack_.*'
  aliases:
    - exclusive: true
      regex: '#slack_.*'
  rooms: []

Didn't work. In all the problems I've found on the internet, the Unable to load crypto module was always irrelevant to the problem and the real problem was something else. Hmmmmm.

I'm running this from a Ubuntu web server from Digital Ocean.

kingoftheconnors avatar May 20 '19 12:05 kingoftheconnors

Can confirm, this is still a thing. Just tried to set up the bridge - no dice.

Valodim avatar Jul 22 '19 17:07 Valodim

For the record. If you invite the user despite the objections of Riot this should work.

@Half-Shot do you know what we have to do to make synapse think the user is there?

Cadair avatar Jul 22 '19 19:07 Cadair

In my case, I have tried inviting the bot despite it not existing. The bot never responds to the invite. And even if I use trickery to get it into the room, it doesn't respond to anything I say.

anaskaejdar avatar Jul 23 '19 04:07 anaskaejdar

@Cadair, create the user as a real user on startup.

Half-Shot avatar Jul 23 '19 07:07 Half-Shot

@barudaret You then have a different issue, probably a configuration bug of the appservice not getting messages from synapse. Can you either create another issue or chat in #bridges:matrix.org?

Cadair avatar Jul 23 '19 10:07 Cadair

@Cadair I was trying to get answers in #bridges, but weeks went by and I kept having to restate the question, not a soul acknowledged me in there. That's why I made this issue in the first place

anaskaejdar avatar Jul 23 '19 21:07 anaskaejdar

@barudaret It's not one of the rooms I pay close attention to, feel free to ping me if you have slack questions.

If the bot isn't responding to invites check that the matrix port is configured properly in the appservice registration file and you are running the appservice command with the correct matrix port. Also if synapse was configured to send to the appservice for a long time with the appservice down, or misconfigured then synapse may have given up on sending events to the appservice so you might need to restart synapse again.

Cadair avatar Jul 24 '19 09:07 Cadair

Alright, I'll go back in #bridges tonight. But before I do, I'll remove my current installation of appservice-slack and re-do the installation process from scratch again, just to make sure things are up to date and all the steps are fresh in my mind.

anaskaejdar avatar Jul 25 '19 16:07 anaskaejdar

Did you ever resolve this?

joshfinley avatar Jul 14 '20 15:07 joshfinley