Mattermost-server: Probleme with gif and preview youtube video

Created on 19 Jun 2019  Â·  36Comments  Â·  Source: mattermost/mattermost-server

Hello, Since I update in 5.12.0 gifs are no longer displayed or youtube videos. Only the URL link is displayed ... Is this a problem already known?

Bug ReporOpen

Most helpful comment

Now all image, youtube and link previews are requested server-side

@amyblais this should really be reconsidered. Many Mattermost servers are not allowed to connect directly to internet for security purposes. By removing client-side link preview loading this feature is effectively permanently broken for all these users.

All 36 comments

I just want to add that I have the same issue as well. I think it is related to the change "Fixed expand/collapse arrows not being visible for YouTube videos when image links are expanded by default." (https://docs.mattermost.com/administration/changelog.html#release-v5-12-feature-release), although I am not seeing the expand / collapse arrows for youtube links after upgrading to version 5.12. I had also tried clearing the browser cache, etc, in case that was related.

Hi all, do you see any Mattermost log errors or Console errors? What device and OS are you on?

I don't see any errors or warning in either the mattermost.log or in the Firefox web developer console. I'm attaching the screenshot and a snippit of the log. The screenshot is redacted to prevent exposing internal server names and users.

mattermost-log-snippit.txt

2019-06-19_14-05-15

MatterMost Server is running on Red Hat 7. Tested using Firefox 67.0.3 on a Windows 10 desktop.

Are your link previews and images enabled by default in your Account Settings?

Are link previews enabled on your server?

We have same issue, after updated from 5.11 -> 5.12 gifs and other images are not loaded anymore.
Server:
Enable link previews: false
Account:
Default appearance of image previews: expanded

Yes, link previews are not enabled, though I tried enabling them anyway in the System Console and then verifying that link previews were enabled in my account. The YouTube video previews still do not display.

Like the others, the issue was discovered after upgrading from MatterMost 5.11 to 5.12.

Interestingly, it appears that animated gifs seem to display fine for me, with or without link previews being enabled.

Just to note, I was able to do a clean install of MatterMost 5.12 on a sandbox virtual machine, and it seems to verify the same issue with the youtube video previews not displaying (with the animated gifs displaying however).

Sandbox virtual machine setup:
MatterMost 5.12 on a CentOS 7 machine - with latest yum package updates.
MySQL 5.7.26

No special configuration setup - local authentication, etc. Besides the "DataSource" value to point to the mysql database, there are no other configuration changes in /opt/mattermost/config/config.json

My suspicion is that it is related to the recent commits in https://github.com/mattermost/mattermost-webapp/commits/master/components/youtube_video/youtube_video.jsx but that is just a guess currently.

Is any of you using image proxy?

Same here, with link preview disabled. Using the "local" setting of image proxy.

GIF preview worked before 5.12, deployed with the Docker setup.

Hey all, please take a look at the tips in the special note on this section of our docs: https://docs.mattermost.com/administration/image-proxy.html#local-image-proxy.

@amyblais I configured all IPs that I know of, but I'm not sure about Dockers internal IP resolution. I'm using nginx as a reverse proxy before handing over to Mattermost (on the same machine). Is there a way to see which requests are being blocked/not whitelisted?

I was able to reproduce the youtube preview issue on a Centos 7 sandbox and on our MatterMost Dev on Red Hat 7 with MatterMost 5.12 without using the image proxy. I did try turning it on to see if there was any difference, but there wasn't. I've since turned it back off. No nginx, no docker installed on the centos 7 sandbox. Just Centos 7, mattermost 5.12 and mysql 5.7.26

The configuration file from the CentOS 7 sandbox, with the mysql password removed:
config.json.txt

For @acidicX question, there are parameters in the /opt/mattermost/config/config.json to increase logging to debug level which could have more information: "ConsoleLevel": "DEBUG", and "FileLevel": "DEBUG", settings. I've also turned those on (after uploading the config file above to this comment) and I don't see any additional error messages there, although I don't have image proxy turned on. Docker running containers resolve ip addresses in /etc/resolv.conf, just like the host. Or, if you are looking for the Docker container's ip address, it can apparently be found in /proc/net/fib_trie . I personally don't think that this issue is related to docker, however. I'm not even sure it is related to image proxy or link previews since in my Centos 7 sandbox, I have those features turned off.

Still trying to reverse engineer the code, although without a background in react or go, its a bit of a steep learning curve.

Hi all, also, what is this setting set to on your servers: https://docs.mattermost.com/administration/config-settings.html#allow-untrusted-internal-connections-to?

@amyblais I've set it to <public-hostname> 127.0.0.1 <public-ip> fe80::/0

However: Image proxy does not seem to be the issue, I turned it off and it still did not work. I set Enable Link Previews: to true and now gif preview works again. Not sure why I have to enable this though, as it is no website preview but an image link? It seems that behaviour changed with v5.12?

Haven't found anything in the changelog...

I was able to reproduce this now, bug ticket: https://mattermost.atlassian.net/browse/MM-16545.

Just curious on if anyone else can confirm that enabling the link previews to true resolves the issue with the youtube video previews ? I've tried enabling the feature on my MatterMost Dev setup and the youtube videos still do not show. Verified that "Website Link Previews" is also enabled under Account Settings.

Oddly, I've never had an issue with animated gifs - they still appear fine after upgrading to MatterMost 5.12. It has only been with Youtube video previews. I've been able to reproduce the issue regarding the youtube video previews on a clean CentOS 7 sandbox, taking out the nginx, and docker variables and working from the default mattermost 5.12 configuration with minimal changes, so if anyone else can confirm that enabling the link previews also resolves the youtube video previews, it would help me to isolate the issue to just my own environment.

@jchungvz YouTube preview works for me with link preview enabled on 5.12 (and local image proxy enabled, not sure if that makes any difference).

I can confirm this bug. I noticed the following behaviour:
If the setting "Enable Link Previews" is set to true, all new posted gifs will get a preview whereas already existing posts don't (we don't use image proxy, if that matters). With browser developer tools opened (with disabled cache) and a page refresh, all gifs will get a preview if "Enable Link Previews" was set to true.

Without "Enable Link Previews", no gif previews will come up

Thank you. It appears that the link previews (and possibly the local image proxy) would result in the mattermost server sending out the request to generate and gather the preview image or other metadata of the website. For anyone in an environment that utilizes proxies to access the external internet, the following steps are also required in the current workaround:

  • Specify the proxy URL in /etc/systemd/system/mattermost.service:
[Service]
Environment="https_proxy=http://<username>:<my password>@<ip address>:<port>"
  • And set the AllowedUntrustedInternalConnections parameter in /opt/mattermost/config/config.json to the proxy's IP address:
    "AllowedUntrustedInternalConnections": "<proxy_IP_address>/32",

This would be in addition to "Enable Link Previews" and possibly the image proxy (local) settings on Mattermost v 5.12. After that, I was then able to view the YouTube video previews and also website previews, for newly posted youtube videos.

This was discussed with product managers. This change is an expected behavior in 5.12, though it is a breaking change and wasn't properly documented. Here is an explanation:

What change was made:
Previously image and Youtube previews were requested client-side so they worked regardless of the "Enable link previews" console setting. Link previews on the other hand were requested server-side and controlled by the "Enable link previews" console setting. Now all image, youtube and link previews are requested server-side, hence controlled by the "Enable link previews" setting.

Why was this change necessary?

  • Remove scroll pop with youtube and image link previews because now the dimensions and post-metadata are stored on the server instead of the client stuffing them in with no post-metadata available for scroll correction.
  • Quicker loading times of embedded content in posts since the data is stored on the server.
  • Supporting image and youtube previews as they used to work (ie backwards compatibility) will be difficult to re-add and maintain with the scrolling features we have now or what's upcoming ie bidirectional scrolling etc.

Actions taken now:

Above action items are completed. I'll close this for now,

The problem is time of period too short.
Anyone with this issue can resolve by changing Link Metadata Timeout: in EXPERIMENTAL -> Features

I think Mattermost team should be written on documents.

Thanks @NgoHuy! We have some documentation of this setting here https://docs.mattermost.com/administration/config-settings.html#link-metadata-timeout

Did you also have "Enable Link Previews" enabled in System Console > Site Configuration > Posts?

Yes, I must enable "Enable Link Previews" in System Console > Site Configuration > Posts

@NgoHuy Thanks! And what did you change the Link Metadata Timeout setting to?

I changed it to 6000, that means for 6s.

Thanks! Someone on our team reproduced as well, we'll look at adding docs for it. Appreciate the report @NgoHuy!

Now all image, youtube and link previews are requested server-side

@amyblais this should really be reconsidered. Many Mattermost servers are not allowed to connect directly to internet for security purposes. By removing client-side link preview loading this feature is effectively permanently broken for all these users.

@amyblais this should really be reconsidered. Many Mattermost servers are not allowed to connect directly to internet for security purposes. By removing client-side link preview loading this feature is effectively permanently broken for all these users.

Agreed, this doesn't work well in security focused enterprise situations.

@amyblais this should really be reconsidered. Many Mattermost servers are not allowed to connect directly to internet for security purposes. By removing client-side link preview loading this feature is effectively permanently broken for all these users.

Agreed, this doesn't work well in security focused enterprise situations.

I second this, @amyblais is there any chance for this to be reconsidered by the PM team? I think depending on environments 'scroll pop' is a better alternative than no image/video/youtube previews. This torpedos our usage of Mattermost, as other enterprise users mentioned our server too will never be connected to the external network; it's just IT and security policies. Proxy options are only client side for us. _It's something that will never change–_

I got a ton of 'What happened' or 'Mattermost is broken' messages after this update--now seeing this is intentional is quite the letdown..!

We tried to fix this issue with image-proxy, but it does not work either. https://github.com/mattermost/mattermost-server/issues/11857

So currently there is no way to have gif/image/youtube support in mattermost, if mattermost server does not have internet access.

Thanks all for the feedback. We understand the issues being faced here and I have created a follow-up ticket to investigate if there are any potential options on our end: https://mattermost.atlassian.net/browse/MM-17825

More information on the decision can be found on the forums: https://forum.mattermost.org/t/link-previews-managed-server-side-in-v5-12-and-later/7712

Thanks all for the feedback. We understand the issues being faced here and I have created a follow-up ticket to investigate if there are any potential options on our end: https://mattermost.atlassian.net/browse/MM-17825

More information on the decision can be found on the forums: https://forum.mattermost.org/t/link-previews-managed-server-side-in-v5-12-and-later/7712

I'm not sure how to understand the ticket, as it too is now "Closed, Done", with a linked google doc that explains the situation. None of the proposed solutions in it actually solves the problem (as we're all saying here, many environments can't have their MM server connected to the internet–including by proxy.

The only working options for these environments are the first two alternative solutions (Re-add as a server option, re-add as a plugin).

_The regression of having page loading be worse from a UX perspective and/or break scrolling is preferable to forced server-side link previews that can't be enabled in all environments._

A doc PR has been submitted here to document how to configure Mattermost to connect through an outgoing proxy for organizations with strict security requirements https://github.com/mattermost/docs/pull/3096.

A doc PR has been submitted here to document how to configure Mattermost to connect through an outgoing proxy for organizations with strict security requirements mattermost/docs#3096.

As I stated in my message and others have in this thread–_a server-side proxy is not an option in many high secure environments._ The doc PR doesn't address that, and the ticket was to look at getting it back as an option (even if it had the side-effect of springy chats scrolling).

Was this page helpful?
0 / 5 - 0 ratings