We upgraded 3.4 to 3.5 a month ago and then moved from an external pg14 server to another pg16 server two weeks ago. We have been using MAAS fairly smoothly before during and after these. As of today, we cannot create libvirt VMs with our usual maas $MAAS_PROFILE pod compose ... - they are created, but do not start, and yield this message a minute or two later.
temporal-server is crash cycling on the region controller, and this looks relevant (note REGIOND_IP - this has not been used for the database for years):
Sep 2 21:26:29 maas temporal-server[13734]: Unable to create server. Error: could not build arguments for function "go.uber.org/fx".(*module).constructCustomLogger.func2 (/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/module.go:251): failed to build fxevent.Logger: could not build arguments for function "go.temporal.io/server/temporal".glob..func8 (/build/temporal-8dYnj9/temporal-1.22.5/src/temporal/fx.go:1037): failed to build log.Logger: received non-nil error from function "go.temporal.io/server/temporal".ServerOptionsProvider (/build/temporal-8dYnj9/temporal-1.22.5/src/temporal/fx.go:173): sql schema version compatibility check failed: pq: no pg_hba.conf entry for host "REGIOND_IP", user "maas", database "maasdb", no encryption.
If your PostgreSQL SSL settings were compatible with how MAAS is using psycopg2 before the introduction of Temporal on 3.5, then a potential patch on the below files could work for you.
As I said, it is not supported so please consider them before applying them at your own risk.
This is needed to run dbupgrade when on SSL. It could be an alternative to what you did on the PostgreSQL side.
diff --git a/src/maasserver/management/commands/dbupgrade.py b/src/maasserver/management/commands/dbupgrade.py
index 18d7156e4..8ab1e7fe8 100644
--- a/src/maasserver/management/commands/dbupgrade.py
+++ b/src/maasserver/management/commands/dbupgrade.py
@@ -149,6 +149,9 @@ class Command(BaseCommand):
get_path("/usr/bin/temporal-sql-tool"),
"--plugin",
"postgres12",
+ "--tls",
+ "--tls-ca-file",
+ "/path/of/ca/with/self/signed",
+ # or skipping the host verification
+ # "--tls-disable-host-verification",
"--endpoint",
endpoint,
"--port",
This is needed to operate Temporal Server with PostgreSQL on SSL mode:
Thank you for the detailed description and the option to try! I think we will run with plaintext for now and wrap it up in protections such as firewall rules, but I will run it by other relevant people before we decide.
We are operational again and these log messages have stopped, but I am still very interested in not repeating a problem like this again in future. With that in mind, I would like to know if there are pages we should be looking at for upgrade information like this. Should we ordinarily expect to find such information at Release notes and upgrade instructions ?
I believe you used a wrong procedure to backup the MAAS database and you missed the temporal schema. This is why I asked you to manually execute the migrations once again to recreate them.
So there are no special upgrade instructions, it’s simply that you did the backup wrong
Okay, so it was likely the db migration, not the upgrade, where we went off the path. I am now looking at How to back up MAAS and I don’t see anything particularly special (which is good) there, and nothing stands out as different to our migration procedure. I’ll leave this alone for now, and consider it again next time we are doing any kind of significant database work, or version upgrades.
Thank you all for the assistance here. It is much appreciated.