Comments (7)
Thanks it works now!
from mattermost-operator.
Hi @andrewklau,
Could you share your Mattermost CR manifest? I have a hard time understanding what is the problem exactly. Are you just trying to run Mattermost with the external database, or is there something specific to your setup?
It looks like Mattermost is trying to interpret the connection string as a file patch which seems a little weird.
I would appreciate some details so that we can hopefully figure it out.
from mattermost-operator.
Hi @Szymongib
I'm trying to run mattermost with an external database. Here's the full yaml file:
apiVersion: installation.mattermost.com/v1beta1
kind: Mattermost
metadata:
name: mattermost
namespace: mattermost
spec:
size: 100users
ingress:
enabled: true
host: chat.example.com
annotations:
kubernetes.io/ingress.class: nginx
version: 6.0.1
database:
external:
secret: mattermost
fileStore:
external:
url: sgp1.digitaloceanspaces.com
bucket: mymattermost
secret: mattermost
mattermostEnv:
- name: MM_FILESETTINGS_AMAZONS3SSE
value: "true"
- name: MM_FILESETTINGS_AMAZONS3SSL
value: "true"
The weird thing is yes it comes up as a file name. When I run the command kubectl logs -f -n mattermost pod/mattermost-7cc6dbcdfb-9bmd2
this comes up in the logs:
Error: failed to load configuration: failed to create store: unable to load on store creation: failed to persist: failed to write file: open /mattermost/config/postgresql:/user:password@mypostgresdb:25060/defaultdb?sslmode=require: no such file or directory
Usage:
mattermost [flags]
mattermost [command]
Available Commands:
db Commands related to the database
export Export data from Mattermost
help Help about any command
import Import data.
jobserver Start the Mattermost job server
server Run the Mattermost server
version Display version information
Flags:
-c, --config string Configuration file to use.
-h, --help help for mattermost
Use "mattermost [command] --help" for more information about a command.
The secret file:
apiVersion: v1
kind: Secret
metadata:
name: mattermost
namespace: mattermost
type: Opaque
stringData:
DB_CONNECTION_STRING: 'postgresql://admin:[email protected]:25060/defaultdb?sslmode=require'
from mattermost-operator.
Thanks a lot for details @andrewklau.
It looks like the issue is on the Mattermost Server side, apparently, the server only accepts connection schema postgres
and treats others as a file.
Try changing your connection string to:
postgres://admin:[email protected]:25060/defaultdb?sslmode=require
Hopefully, that should solve the issue.
from mattermost-operator.
In Kubernetes v1.26, the secret data can't be created as plain text.
Error from server (BadRequest): error when creating "STDIN": Secret in version "v1" cannot be handled as a Secret: illegal base64 data at input byte <n>
And in base64, as the documentation suggests:
apiVersion: v1
data:
DB_CONNECTION_CHECK_URL: cG9zdGdyZXM6Ly91c2VyOnN1cGVyX3NlY3JldF9wYXNzd29yZEBteS1kYXRhYmFzZS5jbHVzdGVyLWFiY2QudXMtZWFzdC0xLnJkcy5hbWF6b25hd3MuY29tOjU0MzIvbWF0dGVybW9zdD9jb25uZWN0X3RpbWVvdXQ9MTAK
DB_CONNECTION_STRING: cG9zdGdyZXM6Ly91c2VyOnN1cGVyX3NlY3JldF9wYXNzd29yZEBteS1kYXRhYmFzZS5jbHVzdGVyLWFiY2QudXMtZWFzdC0xLnJkcy5hbWF6b25hd3MuY29tOjU0MzIvbWF0dGVybW9zdD9jb25uZWN0X3RpbWVvdXQ9MTAK
MM_SQLSETTINGS_DATASOURCEREPLICAS: cG9zdGdyZXM6Ly91c2VyOnN1cGVyX3NlY3JldF9wYXNzd29yZEBteS1kYXRhYmFzZS5jbHVzdGVyLXJvLWFiY2QudXMtZWFzdC0xLnJkcy5hbWF6b25hd3MuY29tOjU0MzIvbWF0dGVybW9zdD9jb25uZWN0X3RpbWVvdXQ9MTAK
kind: Secret
metadata:
name: my-postgres-connection
type: Opaque
the operator seems to add a '/n' at the end of the connection string, resulting in the following error:
Defaulted container "mattermost" out of: mattermost, init-check-database (init)
Error: failed to load configuration: failed to initialize: failed to create Configurations table: parse "postgres://user:super_secret_password@my-database.cluster-abcd.us-east-1.rds.amazonaws.com:5432/mattermost?connect_timeout=10\n": net/url: invalid control character in URL
from mattermost-operator.
Opened a new issue: #342
from mattermost-operator.
@jpnorenam It is likely not the Operator that adds a new line but the way you are encoding the string.
Try this if you are on Linux:
echo "postgres://user:super_secret_password@my-database.cluster-abcd.us-east-1.rds.amazonaws.com:5432/mattermost?connect_timeout=10" | base64 -w 0
Or on MacOS:
echo "postgres://user:super_secret_password@my-database.cluster-abcd.us-east-1.rds.amazonaws.com:5432/mattermost?connect_timeout=10" | tr -d \\n | base64
from mattermost-operator.
Related Issues (20)
- Resource Patch e2e test HOT 2
- CVEs mitigation
- Mattermost Operator Does Not Support AWS IAM Profile for S3 Bucket Auth
- Inconsistent server behavior with several replicas (k8s) HOT 5
- Gossip traffic service / Istio injection HOT 3
- Operator does not configure port 8443 for calls
- Mattermost on Kubernetes with external MySQL database
- Postgres connection string invalid control character in URL for secret data in base64 HOT 1
- operatorhub.io still has v0.5.0 with max k8s version 1.21 as latest HOT 4
- Cannot set initial admin user with Postgres backend HOT 1
- Docs link to broken mysql-operator in k1.27.3 HOT 2
- ARM64 image is not working HOT 1
- Mattermost operator and cluster role scopes
- Mattermost is working but the cluster is reconciling
- [FEATURE]: Add support for COSI
- Service annotation 'tolerate-unready-endpoints' is deprecated HOT 1
- Postgres password rotated, can no longer connect
- Operator managed installation of mattermost with mysql and minio
- Document deployment with Gitlab
- Allow customizing ingress type and pathType directly in the mattermost spec HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mattermost-operator.