Configuring for S3

Summary

I’m trying to configure for S3 but keeping getting an error.

Steps to reproduce

  1. Open System Console
  2. Navigate to File Storage
  3. Change storage to S3
  4. Fill in bucket name, leaving everything else as default except turn on debugging.

Expected behavior

The bucket name will be accepted.

Observed behavior

When clicking “Test connection”, there is an error “Connection unsuccessful: S3 Bucket is required”.

Hello, @jerauf

May I know real quick if you have saved the configuration before testing the connection?

If that does not help, can you have the DEBUG File Log Level enabled and verify what is being logged in the mattermost.log when you reproduce the issue?

Hello @ahmaddanial - I tried saving first. When testing, the error said that it couldn’t connect to the bucket.

Here is the final entry in the log:

12/7/2020, 11:21:30 AM mattermost [stderr] {“level”:“error”,“ts”:1607361690.1954281,“caller”:“mlog/log.go:190”,“msg”:“Error checking if bucket exists.”,“path”:"/api/v4/file/s3_test",“request_id”:“c8obsj5srjd6un7i7qck7tnddr”,“ip_addr”:“67.167.216.82”,“user_id”:“mwojbktda7gftkug59dzz6yg8a”,“method”:“POST”,“err_where”:“TestFileConnection”,“http_code”:500,“err_details”:“Get “http://169.254.169.254/latest/meta-data/iam/security-credentials/”: dial tcp 169.254.169.254:80: i/o timeout”}

Hi, @jerauf

Got it. The i/o timeout suggests that there is a firewall that is blocking the connection between Mattermost and the S3. For example:

Ahmad-Danials-MacBook-Pro:~ ahmaddanialmohammad$ echo | telnet 169.254.169.254 80
Trying 169.254.169.254...
telnet: connect to address 169.254.169.254: Operation timed out
telnet: Unable to connect to remote host

Can you please confirm that the firewall whitelists Mattermost to reach out to the S3 itself?

Hi @ahmaddanial - I’m using stackhero and, according to their support, there is no firewall.

Is your network provider blocking specific ports by any chance?

1 Like