Mattermost, Inc.

[SOLVED] 502 Badgateway when uploading file

Summary

Cannot upload file using S3

Steps to reproduce

Testing connection in System Console is working fine, but when I tried to upload file in a chat screen, I have 502 error on api/v4/files

Expected behavior

Received 502 Badgateway error on api/v4/files

Observed behavior

I saw this in my log file

/api/v4/files:WriteFile code=500 rid=oc3ugcfq5789bpkyrexm9djhpe uid=mpdqaxwc6jdm38hafkzqyqazge ip=113.23.16.236 Encountered an error writing to S3 [details: Endpoint: s3.amazonaws.com/sample-chat-app does not follow ip address or domain name standards.]

I’m using version 4.9.0, with https
07%20AM

Had the same issue - in the STDERR log (accessed via sudo journalctl -u mattermost on my system) there was an ‘out of memory’ error. Had 1GB free but apparently that wasn’t enough for s3 uploads… Local uploads worked fine. Bit odd, but I just increased the swap partition size from 256MB to 2GB and all is working now.

1 Like

Works like a charm, thanks!!!