Unable to configure postgres HA

Trying to deploy canonical-maas by executing scripet where this following command gives error,
Command–
sudo maas init region+rack --database-uri “postgres://maas:maaspass@bitnamipostgres-postgresql-ha-postgresql:5432/maasdb”
Note–
Executed following sql as per docs,
CREATE ROLE maas WITH LOGIN ENCRYPTED PASSWORD ‘maaspass’;
CREATE DATABASE maasdb OWNER maas;
GRANT ALL PRIVILEGES ON DATABASE maasdb TO maas;
Error—
Failed to perfom migrations:ations^[[C5240/MAAS]:
Running Temporal migrations:
Failed to apply Temporal migrations
2024-11-16T07:09:09.678Z INFO Starting schema setup {“config”: {“SchemaFilePath”:“”,“InitialVersion”:“0.0”,“Overwrite”:false,“DisableVersioning”:false}, “logging-call-at”: “setuptask.go:58”}
2024-11-16T07:09:09.678Z DEBUG Setting up version tables {“logging-call-at”: “setuptask.go:68”}
2024-11-16T07:09:09.678Z ERROR Unable to setup SQL schema. {“error”: “pq: cannot execute CREATE TABLE in a read-only transaction”, “logging-call-at”: “handler.go:57”}
Please provide a solution for this issue.

Hi,

This looks like a misconfiguration of Postgres on your side. How are you setting up postgres HA?

Random guess is that you are pointing to a replica node and not the primary node of postgres