# Opal Server fails to launch (Debian Package Installation), missing env variables

**URL:** <https://datashield.discourse.group/t/opal-server-fails-to-launch-debian-package-installation-missing-env-variables/927>\
**Category:** Developer support\
**Created:** [17 January 2024 23:02 UTC](https://datashield.discourse.group/t/opal-server-fails-to-launch-debian-package-installation-missing-env-variables/927 "2024-01-17T23:02:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aakkoc](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/aakkoc/32/200_2.png) [@aakkoc](https://datashield.discourse.group/u/aakkoc)\
**Post date:** [17 January 2024 23:02 UTC](https://datashield.discourse.group/t/opal-server-fails-to-launch-debian-package-installation-missing-env-variables/927/1 "2024-01-17T23:02:10Z")

</div>

Hi,

I recently tried installing [Opal as a Debian Package](https://opaldoc.obiba.org/en/latest/admin/installation.html#debian-package-installation). Somehow, I think the environment variables OPAL\_HOME, OPAL\_DIST, OPAL\_LOG and OPAL\_ARGS are not created correctly.

* * *

After following all instructions upto `sudo apt-get install opal`, I was unable to load web ui. Also `service opal` gives `opal: unrecognized service`.

Running systemctl:

```bash
# systemctl status opal.service 
● opal.service - OBiBa Opal service
     Loaded: loaded (/lib/systemd/system/opal.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2024-01-17 22:21:24 UTC; 22min ago
   Main PID: 3024 (code=exited, status=127)

Jan 17 22:21:24 ubuntu-8gb-hel1-2 systemd[1]: Started OBiBa Opal service.
Jan 17 22:21:24 ubuntu-8gb-hel1-2 systemd[1]: opal.service: Main process exited, code=exited, status=127/n/a
Jan 17 22:21:24 ubuntu-8gb-hel1-2 systemd[1]: opal.service: Failed with result 'exit-code'.

```

The log file is also interesting:

_/var/log/opal/stderr.log_:

```bash
/usr/share/opal/bin/start.sh: line 3: /usr/bin/java: No such file or directory

```

start.sh references OPAL\_HOME and its sister OPAL variables:

```java
#!/bin/bash

$JAVA $JAVA_ARGS -cp "${OPAL_HOME}/conf:${OPAL_DIST}/lib/*" -DOPAL_HOME=${OPAL_HOME} -DOPAL_DIST=${OPAL_DIST} -DOPAL_LOG=${OPAL_LOG} org.obiba.opal.server.OpalServer $OPAL_ARGS

```

When I check my env, these are **missing**.

If I restart opal.service from systemctl:

- The variables are seemingly loaded in correctly

```bash
/usr/bin/java -Xms1G -Xmx2G -XX:+UseG1GC -cp /var/lib/opal/conf:/usr/share/opal/lib/* -DOPAL_HOME=/var/lib/opal -DOPAL_DIST=/usr/share/opal -DOPAL_LOG=/var/log/opal org.obiba.opal.server.OpalServer

```

- The web UI loads but log-in fails for the admin/password I chose.
- service opal remains unavailable.

Is there anything I am skipping here?

Machine Details:

- Ubuntu 20 (Freshly Spun-up)
- RAM: 8GB
- Storage: 80GB

---

<div class="post-metadata">

**Author:** ![aakkoc](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/aakkoc/32/200_2.png) [@aakkoc](https://datashield.discourse.group/u/aakkoc)\
**Post date:** [19 January 2024 13:07 UTC](https://datashield.discourse.group/t/opal-server-fails-to-launch-debian-package-installation-missing-env-variables/927/2 "2024-01-19T13:07:25Z")

</div>

Solution: Java 8 should be installed prior to opal. Else a restart is required for the Opal .sh command to execute correctly.

---

<div class="post-metadata">

**Author:** ![yannick](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/yannick/32/19_2.png) [@yannick](https://datashield.discourse.group/u/yannick)\
**Post date:** [19 January 2024 15:27 UTC](https://datashield.discourse.group/t/opal-server-fails-to-launch-debian-package-installation-missing-env-variables/927/3 "2024-01-19T15:27:57Z")

</div>

For information: Opal currently depends on Java 8, and Opal’s development plan for this year is to upgrade to a higher version (at least Java 17). This is a major piece of work that I will keep the community posted on as soon as a release date can be anticipated.

Note that whatever the Java version is, these are not compatible, so Java must always be properly setup prior to the Opal install. Or use Opal’s Docker container instead to hide this system dependency’s extra complexity.

Regards  
Yannick
