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

Matrix -> Slack Puppeting: Images messages are not displayed at slack

Open dongshu2013 opened this issue 3 years ago • 9 comments

Describe the bug After bridging matrix room and slack channel, when sending image at matrix, the image is not synced to slack. Instead, slack got an empty message.

To Reproduce Steps to reproduce the behavior:

  1. bridge the matrix room and slack channel following guide
  2. send a image from element macos desktop
  3. the image was sent successfully from element but the slack got a empty message

text messages and files were bridged successfully, only image was failed.

Expected behavior the slack should receive the image as well(at least a link but should not be empty message)

Screenshots Image sent at matrix: Screen Shot 2021-09-29 at 12 08 15 PM

Message received at slack: Screen Shot 2021-09-29 at 12 11 01 PM

Desktop (please complete the following information):

  • OS: MacOS
  • version: 1.9.0

Smartphone (please complete the following information): N/A

Additional context I'm using latest docker image published.

dongshu2013 avatar Sep 29 '21 19:09 dongshu2013

Hi there, we will need logs from the bridge in order to debug this one further. At least logs of debug level to figure out why it's missing messages.

Half-Shot avatar Sep 30 '21 13:09 Half-Shot

Hello, I am having the same issue with the bridge using a puppeted account. Here's what I have in the logs and a few screenshots as well: image image

Jan-25 13:55:52.365 INFO bridge 127.0.0.1 - - [25/Jan/2022:18:55:52 +0000] "PUT /transactions/1432?access_token=<REDACTED> HTTP/1.1" 200 2 "-" "Synapse/1.48.0"
Jan-25 13:55:52.366 INFO Main Handling matrix room message $LvverNLRS1iA_4jfH34ty5AtYKDjLYVQzqBnOcBRWiA !PcvYQqNIDnBZbaMRRx:matrix.mydomain.tld
Jan-25 13:55:53.249 DEBUG SlackEventHandler Received slack event: {
  type: 'message',
  user: 'UXXXXXXXX',
  bot_id: 'BXXXXXXXXX',
  suppress_notification: false,
  text: '',
  team: 'TXXXXXXXX',
  bot_profile: {
    id: 'BXXXXXXXXX',
    deleted: false,
    name: 'Matrix Bridge',
    updated: 1642187229,
    app_id: 'A02U4EA7XCJ',
    icons: {
      image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
      image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
      image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png'
    },
    team_id: 'TXXXXXXXX'
  },
  attachments: [ { id: 1, fallback: 'PXL_20210911_162724203.jpg' } ],
  source_team: 'TXXXXXXXX',
  user_team: 'TXXXXXXXX',
  channel: 'CXXXXXXXXX',
  event_ts: '1643136943.002200',
  ts: '1643136943.002200'
} TXXXXXXXX
Jan-25 13:55:53.281 DEBUG BridgedRoom Recent message key add: 1643136943.002200
Jan-25 13:55:53.281 DEBUG PgDatastore upsertEvent: !PcvYQqNIDnBZbaMRRx:matrix.mydomain.tld $LvverNLRS1iA_4jfH34ty5AtYKDjLYVQzqBnOcBRWiA C02RDJ5NA64 1643136943.002200
Jan-25 13:55:53.288 INFO Main Handled $LvverNLRS1iA_4jfH34ty5AtYKDjLYVQzqBnOcBRWiA (!PcvYQqNIDnBZbaMRRx:matrix.mydomain.tld)
Jan-25 13:55:53.834 DEBUG SlackRTMHandler Received Slack user event: @jroy:matrix.mydomain.tld {
  type: 'message',
  user: 'UXXXXXXXX',
  bot_id: 'BXXXXXXXXX',
  suppress_notification: false,
  text: '',
  team: 'TXXXXXXXX',
  bot_profile: {
    id: 'BXXXXXXXXX',
    deleted: false,
    name: 'Matrix Bridge',
    updated: 1642187229,
    app_id: 'AXXXXXXXXX',
    icons: {
      image_36: 'https://a.slack-edge.com/80588/img/plugins/app/bot_36.png',
      image_48: 'https://a.slack-edge.com/80588/img/plugins/app/bot_48.png',
      image_72: 'https://a.slack-edge.com/80588/img/plugins/app/service_72.png'
    },
    team_id: 'TXXXXXXXX'
  },
  attachments: [ { id: 1, fallback: 'PXL_20210911_162724203.jpg' } ],
  source_team: 'TEXXXXXXX',
  user_team: 'TXXXXXXXX',
  channel: 'CXXXXXXXXX',
  event_ts: '1643136943.002200',
  ts: '1643136943.002200',
  team_id: 'TXXXXXXXX',
  team_domain: 'xxxxxxxxx-xxxxxxxxx',
  user_id: 'UXXXXXXXX'
}

I'm using the official Synapse server and the elements client.

MrRoy avatar Jan 25 '22 19:01 MrRoy

Same behavior in my instance.

Queistion: how to activate debug logging?

I tried upload a text file. Result: Screenshot from 2022-02-13 21-38-06

I can take the string and edit:

  • add https://
  • remove |test.txt (the filename)

paste in browser an see the content: Screenshot from 2022-02-13 21-44-54

look like a simple thing to fix, doesn't it!?

felixx9 avatar Feb 13 '22 20:02 felixx9

unfortunately not for me, as I never touched the bridges code by now. But I will have a look on the fix to learn how to do such simple (hope it is) stuff.

felixx9 avatar Feb 13 '22 20:02 felixx9

@Half-Shot I cannot change label - or do I?

felixx9 avatar Feb 13 '22 20:02 felixx9

Is media_url properly set in config? https://github.com/matrix-org/matrix-appservice-slack/blob/develop/config/config.sample.yaml#L14

olmari avatar Feb 14 '22 07:02 olmari

Is media_url properly set in config? https://github.com/matrix-org/matrix-appservice-slack/blob/develop/config/config.sample.yaml#L14

In my case, it wasn't set. Setting it solved the problem for sending images, but if I send videos, it sends a link to the video that is on my home server, rather than embedding the video in the Slack chat.

MrRoy avatar Feb 14 '22 14:02 MrRoy

Thank you for your help. I do have it set. Yes. Avatars work, so I assume it's set correct. Because of an other problem I did reboot the host and now: It works. I think we can assume the setting of this parameter is the solution!?

felixx9 avatar Feb 14 '22 19:02 felixx9

I see this occasionally happen on my selfhosted server which uses the EMS Slack bridge integration. It seems to happen more often with larger images (size and resolution)

nik0kin avatar Feb 28 '22 17:02 nik0kin