Posted attachments no longer appear (self-built version)

Hello,

After upgrading from v3.8.2 to v4.0.1, posted attachments no longer appear.

Summary

  • Both existing posts and new posts are the same.
  • It occurs in the case of FireFox and Chrome.
  • When accessed from iOS and Android, attachments are displayed normally.

Does anyone know something?

Regards.

Hi @shada,

Thanks for your feedback,

I’m not able to reproduce your issue… Are there any errors in the console? If so, could you share a screenshot?

Hi @lindy65,
In the browser, no error is displayed, and the place where the attached file should be displayed is blank.
The HTML element of the corresponding part is empty as follows:

<div>
  <!-- react-text: 5317 -->
  <!-- /react-text -->
  <div class="post__body ">
    <div id="nt66p3tdmirpzfd44pd3oyrdow_message" class="">
      <div><span class="post-message__text">
        <p>In the case of a post with one image file attached</p>
        <!-- react-text: 5323 -->
        <!-- /react-text --></span>
      </div>
    </div>
    <div>
      <div class="post-image__columns clearfix">
        <div class="post-image__column post-image__column--placeholder">
        </div>
      </div>
      <!-- react-empty: 5327 -->
    </div>
    <!-- react-empty: 5328 -->
  </div>
</div>

Hi @shada,

I’ve tried again to reproduce your issue, also on the desktop app, and am not able to. I’ll see if anyone on the team has suggestions for you.

Hi @shada

Do you have cross-origin requests set on the Mattermost Server?

If you’re not sure, you can ask your System Administrator to check what value is set in System Console > Connections > Enable cross-origin requests from

Hi @jasonblais,
I have disabled that setting as follows:

config.json
“ServiceSettings”: “AllowCorsFrom”: “”

I’m sorry I did not fully describe the conditions of reproduction.
The problem occurred in the self-build version, and there was no problem with the official version. It may be a problem with my development environment.

@shada Were you able to solve this problem? I am currently facing it on my self build as well.

I’ve left a comment here: https://github.com/42wim/matterircd/issues/122#issuecomment-390929025.

Posting a normal text message works:

curl -d 'payload={"text": "Hello, this is some text\nThis is more text. :tada:"}' http://localhost:8065/hooks/hook_id

However, when trying to post an attachment like so:

curl -d 'payload={"channel": "#town-square", "username": "bottest", "attachments": [{ "fallback":"test", "text":"blah" }], "icon_emoji": ":ghost:", "icon_url": "" }' http://localhost:8065/hooks/hook_id

The browser tab shows an asterisk signalling something has happened, but nothing (no message, no blank line, nothing) appears in my #town_square channel if I run the command above.

I am slightly lost on where I would start debugging this. Any help is greatly appreciated since I really do need the attachments to work. :slight_smile:

Here are the build details:
53%20AM

Is there any more info that I can give which would help you help me?

Hi @haris! Thank you for reaching out.

Did you try the previous suggestion here?
Do you see any errors in logs or the console?
Is there any specific Mattermost documentation that you are following?

If these suggestions do not help, please let me know and I’ll ask one of our engineers to take a look! Happy to help with this further.