docs
docs copied to clipboard
Help Wanted: Cannot connect to AWS Lightsail Postgres instance with sslmode=disable
Summary
The sslmode=disable as suggested by the instructions don't seem to be compatible with AWS Lightsail Postgres instances.
Steps to reproduce
- Create an AWS Lightsail Postgres instance
- Follow instructions to setup mattermost database
- Follow instructions to update mattermost config to use database.
Expected behavior
It should be able to connect to the database
Observed behavior (that appears unintentional)
It gives the following error:
Nov 03 16:20:03 ip-172-26-5-245 mattermost[6201]: {"timestamp":"2023-11-03 16:20:03.028 Z","level":"error","msg":"failed to initialize platform: cannot create store: error setting up connections: pq: no pg_hba.conf entry for host \"172.26.5.245\", user \"mmuser\", database \"mattermost\", no encryption","caller":"commands/server.go:76"}
Note that AWS Lightsail is a managed postgres and does not allow direct control over pg_hba.conf
Possible fixes
Workaround: Changing the config to sslmode=require worked for me.
Fix: Update the docs to mention that the sslmode setting may depend on your particular environment.
Thanks, @tleyden, for logging this issue. Are you open to creating a docs PR with your proposed changes?
Yes @cwarnermm I can create a docs PR, but it might be good if someone more familiar with these settings could review it. I was literally just doing "trial and error" to get it working 😄
Understood completely, @tleyden! I would welcome your help with this docs PR and can ensure it's reviewed by Engineering for technical accuracy. Thank you!
@cwarnermm Are there any instructions on creating the docs PR? Is this the repo? https://github.com/mattermost/mattermost-developer-documentation
Great question! The easiest way to get started with a docs PR is to visit the page that needs an update and select the Edit on GitHub option located in the top right corner of the docs page. That will take you directly to the correct repository and source file in GitHub.
@cwarnermm I would love to take this up. Feel free to assign this to me. Thanks.
As per my understanding, we just need to add a Note on that particular section in the Install Ubuntu stating that the sslmode setting depends on the working environment and one needs to refer to the native environment docs to figure it out We can also add an example of the Lightsail in the Note.
Let me know if you have any further suggestions.