Background
When initializing a new SCH instance, the SCH’s app components need to authenticate via auth-tokens which are generated by and stored in the security database. The dev script `dev/02-initsecurity.sh` will generate auth-token.txt files in the $DPM_CONF directory for each SCH app component, and insert these auth tokens into the security database.
Issue
When upgrading or adding a new HA SCH instance to an existing SCH database, executing `dev/02-initsecurity.sh` results in empty auth-token.txt files are created the $DPM_CONF directory. This causes errors during startup because none of the SCH apps are able to authenticate without an auth-token.
Solution
This issue can happen if any of the following default values for environment variables used in the `dev/02-initsecurity.sh` script are incorrect:
DPM_DIST=${DPM_DIST:-$(pwd)}
DPM_CONF=${DPM_CONF:-$DPM_DIST/etc}
DPM_ADMIN_USER=${DPM_ADMIN_USER:-admin@admin}
DPM_ADMIN_PASSWORD=${DPM_ADMIN_PASSWORD:-admin@admin}
For instance, when adding a new HA SCH instance to an existing SQL database, the admin@admin default password would have been changed. So in order to use the correct credentials, simply set the DPM_ADMIN_PASSWORD environment variable and re-run the `dev/02-initsecurity.sh` script:
export DPM_ADMIN_PASSWORD=MyNewPassword!
./dev/02-initsecurity.sh
Now you should see output Generate Auth Token for component id: xxx and your auth-token.txt’s should now work.