ManageIQ / manageiq-appliance_console

The console for the ManageIQ appliances.
Apache License 2.0
2 stars 28 forks source link

Fix post_activation exception when setting up internal database #244

Closed agrare closed 6 months ago

agrare commented 6 months ago

Once both database and messaging have been configured by the CLI, start evmserverd.service. This will work if you pass both database and messaging config in the same invocation or if you configure them separately.

Example command: appliance_console_cli --internal --username='root' --password='smartvm' --region=1 --dbdisk=/dev/vdb --message-server-config --message-keystore-password="smartvm" --server=start

Fixes:

  config.post_activation
        ^^^^^^^^^^^^^^^^
from /opt/manageiq/manageiq-gemset/gems/manageiq-appliance_console-9.0.1/lib/manageiq/appliance_console/cli.rb:297:in `set_db'
from /opt/manageiq/manageiq-gemset/gems/manageiq-appliance_console-9.0.1/lib/manageiq/appliance_console/cli.rb:261:in `run'
from /opt/manageiq/manageiq-gemset/gems/manageiq-appliance_console-9.0.1/lib/manageiq/appliance_console/cli.rb:544:in `parse'
from /opt/manageiq/manageiq-gemset/gems/manageiq-appliance_console-9.0.1/bin/appliance_console_cli:7:in `<top (required)>'
from /opt/manageiq/manageiq-gemset/bin/appliance_console_cli:25:in `load'
from /opt/manageiq/manageiq-gemset/bin/appliance_console_cli:25:in `<main>'

Introduced by https://github.com/ManageIQ/manageiq-appliance_console/pull/195

Follow-up:

agrare commented 6 months ago

Unsure if it is related or not but I have to manually run db:migrate db:seed in order for

[root@manageiq-devel ~]# appliance_console_cli --internal --username='root' --password='smartvm' --region=1 --dbdisk=/dev/vdb --standalone --message-server-config --message-keystore-password="smartvm"
create encryption key
configuring internal database
Initialize postgresql disk starting
Initialize postgresql disk complete
Initialize postgresql starting
Initialize postgresql complete
Create Jaas Config
Create Client Properties
Create Logs Directory
Configure Firewall
Configure Keystore
Create Server Properties
Configure Messaging Yaml
Starting zookeeper and configure it to start on reboots ...
Starting kafka and configure it to start on reboots ...

to complete. Looking into this.

Disregard, I was passing --standalone which skips running migrate+seed

agrare commented 6 months ago

We already have an explicit --server=start option, thinking we just reuse that either by setting options[:server] ||= "start" or just documenting that when you run appliance_console_cli you pass that so the full command would be:

appliance_console_cli --internal --username='root' --password='smartvm' --region=1 --dbdisk=/dev/vdb \
  --message-server-config --message-keystore-password="smartvm" \
  --server=start

Or split up into individual steps:

appliance_console_cli --internal --username='root' --password='smartvm' --region=1 --dbdisk=/dev/vdb
appliance_console_cli --message-server-config --message-keystore-password="smartvm" 
appliance_console_cli --server=start
Fryguy commented 6 months ago

I like the single step version and we can take care of the dependencies internally. So, yeah, seems we can just document that.

agrare commented 6 months ago

Working on adding documentation for the messaging config since it seems that wasn't added, I'll add the --server=start to the examples so people should copy&paste the right thing

agrare commented 6 months ago

Okay I'm going to take this out of WIP since this is functional and the only issues left aren't related to this fix (specifically https://github.com/ManageIQ/manageiq-appliance_console/issues/245)

Example: appliance_console_cli --internal --username='root' --password='smartvm' --region=1 --dbdisk=/dev/vdb --message-server-config --message-keystore-password="smartvm" --server=start