NRC-Research / SNAP-issues

This repository was created to provide a public location to record and display the status of "issues" for the SNAP application. The SNAP developers will acknowledge, provide (and maybe request) feedback on the reported issues, and in general use the information to improve SNAP code.
3 stars 0 forks source link

HEADLESS installation mode failure #45

Closed NRCgg closed 1 year ago

NRCgg commented 1 year ago

When trying to install SNAP 4.1.3 using the "HEADLESS" installation guidance (which, BTW, should be included in the standard documentation), the installation fails.

Procedure for reproducing:

In a folder containing the SNAP distribution files ("fts" files) create a "SNAP.def" file containing:

INSTALL_DIR = /usr/local/snap/
DISABLE_PROMPTS = yes 
DISABLE_GUI = yes 

Then, create the folder to install to and be sure its writable:

mkdir -p /usr/local/snap
chmod u+rwx /usr/local/snap

Then attempt to run the installer with:

java -jar SnapInstaller.jar

The installation fails. The failure is due to the installer trying to open a window. I tried running in a non-headless environment and a windows opens requesting the acknowledgement of the EULA. I suspect that the EULA display was added after the headless installation feature and probably overlooked the headless installation case. An option could simply be added to the "def" files to indicate acceptance of the EULA, or another option could be added to the SnapInstaller itself to allow a command line option to acknowledge the EULA.

WDunsford commented 1 year ago

Interesting. We exclusively use a headless installer for building test distributions for our RH test environments. So this is actually a heavily tested feature. Our script uses "true" instead of "yes" but the source code appears to accept either. What environment are you running this under? Our testing includes EULA pop-ups for SNAP itself, along with the R53D plug-in that would appear during the install process but are hidden:

Try removing the "=" character in your script. e.g:

INSTALL_DIR /usr/local/snap/ DISABLE_GUI true DISABLE_PROMPTS true

NRCgg commented 1 year ago

The same result. This is in a debian (ubuntu) container. The JRE is openjdk 11. I have attached the error log file. error.txt

WDunsford commented 1 year ago

OK I just double checked this script under Ubuntu:

!/bin/bash

TARGET=${1}

if [ -e $TARGET ]; then echo "Clearing Existing Installation" rm -r $TARGET fi

echo "Configuring SNAP installer..."

if [ -e "SNAP.def" ]; then rm SNAP.def fi

echo "INSTALL_DIR ${TARGET}" >> "SNAP.def" echo "DISABLE_GUI true" >> "SNAP.def" echo "DISABLE_PROMPTS true" >> "SNAP.def"

echo "Installing SNAP..." mkdir -p "${TARGET}"

java -jar SnapInstaller.jar

echo "SNAP installed to: ${TARGET}"

Please verify that this doesn't work for you.

NRCgg commented 1 year ago

That worked! But I don't see any difference in what that script does versus what i did by hand!

All I can think of offhand is that maybe there were some ownership problems with the files/folders I had in place already.

Thanks!

Marking as resolved.