# Issues standing up OpenBalena on Ubuntu 22.04

**URL:** <https://forums.balena.io/t/issues-standing-up-openbalena-on-ubuntu-22-04/370580>\
**Category:** openBalena\
**Created:** [May 27, 2024, 1:26pm UTC](https://forums.balena.io/t/issues-standing-up-openbalena-on-ubuntu-22-04/370580 "2024-05-27T13:26:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flux](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@flux](https://forums.balena.io/u/flux)\
**Post date:** [May 27, 2024, 1:26pm UTC](https://forums.balena.io/t/issues-standing-up-openbalena-on-ubuntu-22-04/370580/1 "2024-05-27T13:26:16Z")

</div>

Hi Everyone, I am trying to setup OpenBalena from the quick start guide (mashed with a few of the newer quick start guides for ubuntu 22.04 in the Github pull requests + issues) and seem to be running into issues with everything starting.

I am running Ubuntu 22.04 on Digital Ocean, Docker version 24.0.5, docker-compose 1.29.2, cloning from the current master branch.

Running docker ps, I get the following versions

> openbalena\_haproxy  
> balena/open-balena-vpn:v11.29.36  
> balena/open-balena-api:v19.1.19  
> balena/open-balena-registry:v2.39.45  
> redis:alpine  
> balena/open-balena-db:v5.2.2  
> balena/open-balena-s3:v2.28.32  
> openbalena\_cert-provider

Nothing is responding on the api url, so checking the log with ./scripts/compose exec api journalctl -fn100, I see some issue with rsyslog, but the main issue I see is with the node stack trace failing to find /usr/src/app/init.js

```auto
May 27 12:22:49 2c673be0a702 systemd[1]: rsyslog.service: Scheduled restart job, restart counter is at 5.
May 27 12:22:49 2c673be0a702 systemd[1]: Stopped rsyslog.service - System Logging Service.
May 27 12:22:49 2c673be0a702 systemd[1]: rsyslog.service: Start request repeated too quickly.
May 27 12:22:49 2c673be0a702 systemd[1]: rsyslog.service: Failed with result 'exit-code'.
May 27 12:22:49 2c673be0a702 systemd[1]: Failed to start rsyslog.service - System Logging Service.
May 27 12:22:49 2c673be0a702 systemd[1]: syslog.socket: Failed with result 'service-start-limit-hit'.
May 27 12:22:50 2c673be0a702 api[1531]: Error: Cannot find module '/usr/src/app/init.js' imported from /usr/src/app/index.js
May 27 12:22:50 2c673be0a702 api[1531]: Did you mean to import "./init.ts"?
May 27 12:22:50 2c673be0a702 api[1531]: at finalizeResolution (node:internal/modules/esm/resolve:264:11)
May 27 12:22:50 2c673be0a702 api[1531]: at moduleResolve (node:internal/modules/esm/resolve:924:10)
May 27 12:22:50 2c673be0a702 api[1531]: at defaultResolve (node:internal/modules/esm/resolve:1148:11)
May 27 12:22:50 2c673be0a702 api[1531]: at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12)
May 27 12:22:50 2c673be0a702 api[1531]: at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25)
May 27 12:22:50 2c673be0a702 api[1531]: at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38)
May 27 12:22:50 2c673be0a702 api[1531]: at ModuleLoader.import (node:internal/modules/esm/loader:322:34)
May 27 12:22:50 2c673be0a702 api[1531]: at importModuleDynamically (node:internal/modules/esm/translators:160:35)
May 27 12:22:50 2c673be0a702 api[1531]: at importModuleDynamicallyCallback (node:internal/modules/esm/utils:225:14)
May 27 12:22:50 2c673be0a702 api[1531]: at start (file:///usr/src/app/index.js:8:2) {
May 27 12:22:50 2c673be0a702 api[1531]: code: 'ERR_MODULE_NOT_FOUND',
May 27 12:22:50 2c673be0a702 api[1531]: url: 'file:///usr/src/app/init.js'
May 27 12:22:50 2c673be0a702 api[1531]: }
May 27 12:22:50 2c673be0a702 api[1521]: Program node index.js exited with code 1

```

HAproxy also seems to have some issues

```auto
balena@pegasus:~/open-balena$ ./scripts/compose logs haproxy
Attaching to openbalena_haproxy_1
haproxy_1 | /start-haproxy: line 11: can't create /etc/ssl/private/open-balena.pem: Permission denied
haproxy_1 | Building certificate from environment variables...
haproxy_1 | Setting up watches. Beware: since -r was given, this may take a while!
haproxy_1 | Watches established.
haproxy_1 | [NOTICE] (10) : haproxy version is 2.9.7-5742051
haproxy_1 | [ALERT] (10) : config : parsing [/usr/local/etc/haproxy/haproxy.cfg:13] : The 'reqadd' directive is not supported anymore since HAProxy 2.1. Use 'http-request add-header' instead.
haproxy_1 | [ALERT] (10) : config : parsing [/usr/local/etc/haproxy/haproxy.cfg:57] : 'bind 127.0.0.1:444' in section 'frontend' : unable to stat SSL certificate from file '/etc/ssl/private/open-balena.pem' : No such file or directory.
haproxy_1 | [ALERT] (10) : config : parsing [/usr/local/etc/haproxy/haproxy.cfg:58] : The 'reqadd' directive is not supported anymore since HAProxy 2.1. Use 'http-request add-header' instead.
haproxy_1 | [ALERT] (10) : config : parsing [/usr/local/etc/haproxy/haproxy.cfg:133] : 'bind *:3129' in section 'listen' : unable to stat SSL certificate from file '/etc/ssl/private/open-balena.pem' : No such file or directory.
haproxy_1 | [ALERT] (10) : config : Error(s) found in configuration file : /usr/local/etc/haproxy/haproxy.cfg
haproxy_1 | [ALERT] (10) : config : Fatal errors found in configuration.

```

Am I missing something in the installation process?

---

<div class="post-metadata">

**Author:** ![Maurits](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Maurits](https://forums.balena.io/u/Maurits)\
**Post date:** [May 27, 2024, 1:56pm UTC](https://forums.balena.io/t/issues-standing-up-openbalena-on-ubuntu-22-04/370580/2 "2024-05-27T13:56:54Z")

</div>

The current HAProxy config doesn’t work because the syntax changes in v2. You can fix this by making some small changes (see [haproxy:2.9-alpine can not build · Issue #189 · balena-io/open-balena · GitHub](https://github.com/balena-io/open-balena/issues/189) )

For the API issue, I believe you have 2 options. Either set `PRODUCTION_MODE` to `true` or use a newer version.

---

<div class="post-metadata">

**Author:** ![flux](https://avatars.discourse-cdn.com/v4/letter/f/ce7236/32.png) [@flux](https://forums.balena.io/u/flux)\
**Post date:** [May 28, 2024, 6:30am UTC](https://forums.balena.io/t/issues-standing-up-openbalena-on-ubuntu-22-04/370580/3 "2024-05-28T06:30:43Z")

</div>

Awesome, setting `PRODUCTION_MODE` did it in the older version of the API.

I may have made a bad assumption that master would be using the newer containers. Just changed over to use all new versions and it seems to have all started (without doing much testing with it yet).

Thanks Maurits

---

<div class="post-metadata">

**Author:** ![Maurits](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Maurits](https://forums.balena.io/u/Maurits)\
**Post date:** [May 28, 2024, 8:27am UTC](https://forums.balena.io/t/issues-standing-up-openbalena-on-ubuntu-22-04/370580/4 "2024-05-28T08:27:12Z")

</div>

The main openbalena repo is in a bit of rough state at the moment. They are working on a big PR to get everything up to date. (see [openBalena 2024 by ab77 · Pull Request #141 · balena-io/open-balena · GitHub](https://github.com/balena-io/open-balena/pull/141))
