Downgrade errors from the OpenGraph API

Description

We previously downgraded similar errors from the post metadata code, but the mobile app still uses this code path, so it can cause the server logs to be full of messages that don't need to be marked as errors.

QA Test Steps

1. On RN, make a post containing an invalid or internal URL such as `http://notarealurlatall.com/index.html`
Also test with `http://192.168.1.1/index.html` (see LM's comment below)
2. View the server logs in the system console

Expected: If you see a message like "address forbidden, you may need to set AllowedUntrustedInternalConnections to allow an integration access to your internal network", it should appear at DEBUG level, not ERROR level

Activity

Show:
Harrison Healey
July 18, 2019, 7:49 PM

Merged into master and cherry-picked into 5.14 and 5.13.1

Linda Mitchell
July 19, 2019, 4:58 PM

For v5.13.1, tested by posting the above URL from iOS and got this debug item in the server log:
{"level":"debug","ts":1563553887.1777534,"caller":"app/opengraph.go:22","msg":"GetOpenGraphMetadata request failed","requestURL":"http://notarealurlatall.com/index.html","error":"Get http://notarealurlatall.com/index.html: lookup notarealurlatall.com: no such host"}

HH suggested I could also post http://192.168.1.1/index.html to get the same error he had described, and posting that from iOS did indeed produce this debug-level item in the server log:
{"level":"debug","ts":1563555354.1200995,"caller":"app/opengraph.go:22","msg":"GetOpenGraphMetadata request failed","requestURL":"http://192.168.1.1/index.html","error":"Get http://192.168.1.1/index.html: address forbidden, you may need to set AllowedUntrustedInternalConnections to allow an integration access to your internal network"}

Leaving open to test on v5.14. Added label done-5.13.

Steve Mudie
July 29, 2019, 7:41 PM

Tested on 5.14 server.
Errors not appearing in logs.
Labeled PR
Closing.

Done

Mana

None

Assignee

Harrison Healey

QA Assignee

Steve Mudie

Reporter

Harrison Healey

Epic Link

None

Mattermost Team

Core Features

Sprint

None

Labels

QA Testing Areas

Other (write in QA test steps)

GitHub Issue

None

Components

None

Severity

None
Configure