exist icon indicating copy to clipboard operation
exist copied to clipboard

[BUG] Admin Password not set during programmatic installation (JAR installation with -console)

Open danielesalvatore opened this issue 3 years ago • 6 comments

Describe the bug We are installing ExistDB 5.3.0 on an AWS EC2 instance running Amazon Linux 2 as the operating system and Java 1.8. We would like to fully automate the ExistDB installation in the user-data script in order to have the DB installed and running No manual intervention should be made to complete the installation. In our case, the installation process completes successfully but the admin password is not set even if specified in the installation command. This results in having the DB up and running but not secured by a password: it is in fact accessible only by providing admin as username and a blank (empty) password. We would like to complete the installation, with the provided password set as admin password. The issue seems to be present also in v 5.2.0.

Expected behavior The database to be programmatically installed, and the admin password is set to the one provided.

To Reproduce We tried to install the JAR file using two different approaches, both are failing for different reasons.

  1. JAR installation with option files java -jar exist-installer-5.3.0.jar -console -options ./existdb-options where the options files looks like below
#eXist-db 5.3.0

#TargetPanel.0
INSTALL_PATH=/opt/existdb

#DataDirPanel
dataDir=/data/existdbData

#AdminPasswordPanel
adminPasswd=mySecurePwd

This correctly installs the DB, but the password is set to empty.

  1. installation passing explicit parameters java -jar exist-installer-5.2.0.jar -DINSTALL_PATH=/opt/existdb -DdataDir=/data/existdbData -DadminPasswd=mySecurePwd -options-system

the above command produces the following output, but I cannot find any doc on how to pass the requested parameters.

Command line arguments: -DINSTALL_PATH=/opt/existdb -DdataDir=/data/existdbData -DadminPasswd=mySecurePwd -options-system
Cannot find named resource: 'userInputLang.xml' AND 'userInputLang.xml_eng'
Cannot find named resource: 'userInputLang.xml' AND 'userInputLang.xml_eng'
Cannot find named resource: 'userInputLang.xml' AND 'userInputLang.xml_eng'
Cannot find named resource: 'userInputLang.xml' AND 'userInputLang.xml_eng'
Missing mandatory target path!
[ Console installation FAILED! ]
WARNING: null

Context (please always complete the following information):

  • OS: Amazon Linux 2 / Centos 7
  • eXist-db version: 5.3.0
  • Java Version java-1.8.0-openjdk.x86_64

Additional context

  • How is eXist-db installed? JAR installer
  • The issue seems to be present also in v 5.2.0.
  • As a workaround, it would be OK also to understand how to programmatically set the password once the DB is installed, as an additional step in the user-data script. This would result in having the DB initially installed with empty password, and an additional command to set the password to the desired value.

Thank you in advance for any support you may provide.

danielesalvatore avatar Jul 08 '21 16:07 danielesalvatore

@danielesalvatore the docker readme features some notes on changing the db admin password that might be a good starting point. In principal the same warning and cautions that apply to the doing this via a dockerfile apply to doing if via other automation tools/orchestrators.

as for the missing userInputLang.xml i have no idea, and never seen this warning. One step at a time i guess

duncdrum avatar Jul 19 '21 19:07 duncdrum

I can confirm that setting the admin password does not work during unattended installation:

java -DINSTALL_PATH="${installationDir}" -DdataDir="${dataDir}" -DadminPasswd="${password}" -jar "exist-installer-${existVersion}.jar" -options-system

In my case setting the directories works, but the admin password is not set.

I can also confirm the `Connot find names resource" lines.

dariok avatar Jul 31 '21 16:07 dariok

@dariok The Admin Password will not be set if the data dir already exists... could that be the issue you are seeing?

adamretter avatar Aug 02 '21 11:08 adamretter

That is possible, indeed. I have created the dir beforehand and changed the ownership to the existdb user. I'll give it a try without creating the directory and report back.

dariok avatar Aug 02 '21 16:08 dariok

I can confirm that removing the pre-created 'data'-directory (even if it's empty) will prompt for the admin password during the installation, where before it did not.

stijnbrouwers avatar Dec 22 '22 13:12 stijnbrouwers

I've solved the problem, I have this problem and when I tried to install it skip the user and passwrod set but once I reinstall and change to other folder it let me put user and password, make sure you don't have the folder exist-db before, create a new one a set it up there, for example I installed in my Desktop in a folder and that's all

5antyVC avatar Apr 27 '23 08:04 5antyVC