**Description**:
I encountered an issue with MAAS 3.5 where the **Temporal** process fails to start after a fresh installation on Oracle Linux 9.4, rendering MAAS unusable as the images do not sync.
This bug does not occur with MAAS 3.4, where the installation and setup work smoothly.
**Steps to reproduce**:
1. Remove MAAS:
```bash
snap remove --purge maas
```
2. Recreate PostgreSQL database using this script:
```bash
#!/bin/bash
# Variables - Update these with your actual values
MAAS_DBUSER="maasdbuser" # Replace with your MAAS DB user
MAAS_DBPASS="maasdbpass" # Replace with your MAAS DB password
MAAS_DBNAME="maasdbname" # Replace with your MAAS DB name
HOSTNAME="localhost" # Assuming localhost, change if needed
# Step 1: Drop the MAAS database if it exists
echo "Dropping the database if it exists..."
sudo -i -u postgres psql -c "DROP DATABASE IF EXISTS \"$MAAS_DBNAME\";"
# Step 2: Drop the MAAS database user if it exists
echo "Dropping the database user if it exists..."
sudo -i -u postgres psql -c "DROP USER IF EXISTS \"$MAAS_DBUSER\";"
# Step 3: Create PostgreSQL user
echo "Creating the database user..."
sudo -i -u postgres psql -c "CREATE USER \"$MAAS_DBUSER\" WITH ENCRYPTED PASSWORD '$MAAS_DBPASS';"
# Step 4: Create the MAAS database
echo "Creating the database..."
sudo -i -u postgres createdb -O "$MAAS_DBUSER" "$MAAS_DBNAME"
# Step 5: Change the owner of the MAAS database to the MAAS_DBUSER
echo "Changing the database owner to '$MAAS_DBUSER'..."
sudo -i -u postgres psql -c "ALTER DATABASE \"$MAAS_DBNAME\" OWNER TO \"$MAAS_DBUSER\";"
echo "PostgreSQL setup for MAAS is complete."
```
3. Install MAAS 3.5:
```bash
snap install --channel=3.5/stable maas
```
4. Initialize MAAS:
```bash
maas init region --database-uri '${database_uri}' --maas-url 'http://${maasfqdn}:5240/MAAS'
```
Upon accessing the UI, MAAS loads, but the image syncing process never begins, and the Temporal process fails to start. The following logs were observed:
```
# journalctl -n 500 -f -u snap.maas.pebble -t maas-temporal
Oct 04 15:36:43 maas-regiond-1 maas-temporal[15144]: Unable to start server. Error: failed to start service worker: context deadline exceeded
Oct 04 15:36:44 maas-regiond-1 maas-temporal[15234]: 2024/10/04 15:36:44 Loading config; env=production,zone=,configDir=/var/snap/maas/36889/temporal
Oct 04 15:36:44 maas-regiond-1 maas-temporal[15234]: 2024/10/04 15:36:44 Loading config files=[/var/snap/maas/36889/temporal/production.yaml]
Oct 04 15:36:49 maas-regiond-1 maas-temporal[15234]: {"level":"warn","ts":"2024-10-04T15:36:49.575+0200","msg":"error creating sdk client","service":"worker","error":"failed reaching server: context deadline exceeded","logging-call-at":"factory.go:114"}
Oct 04 15:36:54 maas-regiond-1 maas-temporal[15234]: {"level":"warn","ts":"2024-10-04T15:36:54.767+0200","msg":"error creating sdk client","service":"worker","error":"failed reaching server: context deadline exceeded","logging-call-at":"factory.go:114"}
Oct 04 15:37:00 maas-regiond-1 maas-temporal[15234]: {"level":"warn","ts":"2024-10-04T15:37:00.114+0200","msg":"error creating sdk client","service":"worker","error":"failed reaching server: context deadline exceeded","logging-call-at":"factory.go:114"}
Oct 04 15:37:05 maas-regiond-1 maas-temporal[15234]: {"level":"warn","ts":"2024-10-04T15:37:05.869+0200","msg":"error creating sdk client","service":"worker","error":"failed reaching server: context deadline exceeded","logging-call-at":"factory.go:114"}
Oct 04 15:37:12 maas-regiond-1 maas-temporal[15234]: {"level":"warn","ts":"2024-10-04T15:37:12.409+0200","msg":"error creating sdk client","service":"worker","error":"failed reaching server: context deadline exceeded","logging-call-at":"factory.go:114"}
Oct 04 15:37:20 maas-regiond-1 maas-temporal[15234]: {"level":"warn","ts":"2024-10-04T15:37:20.277+0200","msg":"error creating sdk client","service":"worker","error":"failed reaching server: context deadline exceeded","logging-call-at":"factory.go:114"}
Oct 04 15:37:30 maas-regiond-1 maas-temporal[15234]: {"level":"warn","ts":"2024-10-04T15:37:30.186+0200","msg":"error creating sdk client","service":"worker","error":"failed reaching server: context deadline exceeded","logging-call-at":"factory.go:114"}
Oct 04 15:37:39 maas-regiond-1 maas-temporal[15234]: {"level":"warn","ts":"2024-10-04T15:37:39.205+0200","msg":"error creating sdk client","service":"worker","error":"failed reaching server: context deadline exceeded","logging-call-at":"factory.go:114"}
Oct 04 15:37:44 maas-regiond-1 maas-temporal[15234]: {"level":"error","ts":"2024-10-04T15:37:44.522+0200","msg":"start failed","component":"fx","error":"context deadline exceeded","logging-call-at":"fx.go:1163","stacktrace":"go.temporal.io/server/common/log.(*zapLogger).Error\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/common/log/zap_logger.go:156\ngo.temporal.io/server/temporal.(*fxLogAdapter).LogEvent\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/temporal/fx.go:1163\ngo.uber.org/fx.(*App).Start.func1\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:639\ngo.uber.org/fx.(*App).Start\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:647\ngo.temporal.io/server/temporal.(*ServerImpl).startServices.func1\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/temporal/server_impl.go:142"}
Oct 04 15:37:44 maas-regiond-1 maas-temporal[15234]: {"level":"error","ts":"2024-10-04T15:37:44.523+0200","msg":"OnStart hook failed","component":"fx","callee":"go.temporal.io/server/temporal.(*ServerImpl).Start-fm()","caller":"go.temporal.io/server/temporal.ServerLifetimeHooks","error":"failed to start service worker: context deadline exceeded","logging-call-at":"fx.go:1055","stacktrace":"go.temporal.io/server/common/log.(*zapLogger).Error\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/common/log/zap_logger.go:156\ngo.temporal.io/server/temporal.(*fxLogAdapter).LogEvent\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/temporal/fx.go:1055\ngo.uber.org/fx.appLogger.LogEvent\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:810\ngo.uber.org/fx/internal/lifecycle.(*Lifecycle).runStartHook.func1\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/internal/lifecycle/lifecycle.go:247\ngo.uber.org/fx/internal/lifecycle.(*Lifecycle).runStartHook\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/internal/lifecycle/lifecycle.go:257\ngo.uber.org/fx/internal/lifecycle.(*Lifecycle).Start\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/internal/lifecycle/lifecycle.go:216\ngo.uber.org/fx.(*App).start.func1\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:679\ngo.uber.org/fx.(*App).withRollback\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:661\ngo.uber.org/fx.(*App).start\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:678\ngo.uber.org/fx.withTimeout.func1\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:782"}
Oct 04 15:37:44 maas-regiond-1 maas-temporal[15234]: {"level":"error","ts":"2024-10-04T15:37:44.523+0200","msg":"start failed, rolling back","component":"fx","error":"failed to start service worker: context deadline exceeded","logging-call-at":"fx.go:1156","stacktrace":"go.temporal.io/server/common/log.(*zapLogger).Error\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/common/log/zap_logger.go:156\ngo.temporal.io/server/temporal.(*fxLogAdapter).LogEvent\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/temporal/fx.go:1156\ngo.uber.org/fx.(*App).withRollback\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:662\ngo.uber.org/fx.(*App).start\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:678\ngo.uber.org/fx.withTimeout.func1\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:782"}
Oct 04 15:37:44 maas-regiond-1 maas-temporal[15234]: {"level":"error","ts":"2024-10-04T15:37:44.523+0200","msg":"start failed","component":"fx","error":"failed to start service worker: context deadline exceeded","logging-call-at":"fx.go:1163","stacktrace":"go.temporal.io/server/common/log.(*zapLogger).Error\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/common/log/zap_logger.go:156\ngo.temporal.io/server/temporal.(*fxLogAdapter).LogEvent\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/temporal/fx.go:1163\ngo.uber.org/fx.(*App).Start.func1\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:639\ngo.uber.org/fx.(*App).Start\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/go.uber.org/fx/app.go:647\ngo.temporal.io/server/temporal.(*ServerFx).Start\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/temporal/fx.go:299\nmain.buildCLI.func2\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/cmd/server/main.go:204\ngithub.com/urfave/cli/v2.(*Command).Run\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/github.com/urfave/cli/v2/command.go:163\ngithub.com/urfave/cli/v2.(*App).RunContext\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/github.com/urfave/cli/v2/app.go:313\ngithub.com/urfave/cli/v2.(*App).Run\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/vendor/github.com/urfave/cli/v2/app.go:224\nmain.main\n\t/build/temporal-8dYnj9/temporal-1.22.5/src/cmd/server/main.go:55\nruntime.main\n\t/usr/lib/go-1.20/src/runtime/proc.go:250"}
```
**Workaround attempts**:
I tried applying the workaround mentioned in bug #2067117, but I could not find the `maasserver_secret` table.
This issue occurs consistently with a fresh installation of MAAS 3.5, not as an upgrade from MAAS 3.4.
Does it work on an Ubuntu host? Oracle Linux is not officially supported