[SOLVED] Fresh install of openHAB2 via repository does not work (Linux)

  • Platform information:
    • Hardware: Pi4
    • OS: Raspbian Lite
    • Java Runtime Environment:
      openjdk version “1.8.0_212”
      OpenJDK Runtime Environment (build 1.8.0_212-8u212-b01-1+rpi1-b01)
      OpenJDK Client VM (build 25.212-b01, mixed mode)
    • openHAB version: 2.5.0 (Build)
  • Issue of the topic:
    Followed these instructions exactly openHAB on Linux | openHAB

I get

HTTP ERROR 404
Problem accessing /start/index. Reason:
Not Found

  • Please post configurations (if applicable): fresh install

  • If logs where generated please post these here using code fences:

    openhab-cli showlogs

    ==> /var/log/openhab2/audit.log <==

    ==> /var/log/openhab2/events.log <==

    ==> /var/log/openhab2/openhab.log <==
    2019-12-23 23:36:47.959 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at removed because im not allowed more than 2 links as a new user?
    2019-12-23 23:36:47.983 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://10.0.0.106:8443
    2019-12-23 23:36:54.967 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007

This a completely fresh install of Pi/Linux and openHAB2

Just for kicks, did you try restarting the service after it installed? It is common after upgrades for a restart or two depending on the number of bindings, its been a while since I have ran through a fresh install did it prompt for a level (beginner, advance, expert; something along these lines)?

Yeah I stopped/started via systemd and rebooted the pi twice

No prompts were given.

The cli console seems to work. But this is my first go with openhab so I have no idea what im doing yet.

The first start can take 15 minutes or longer as it builds its cache and initializes its configuration.

Would accessing it too soon cause a configuration issue?

I’m still getting the same error over http/s

pi@habnode-master ~ % uptime
00:22:39 up 50 min,  1 user,  load average: 0.00, 0.00, 0.00

To your point @Bruce_Osborne the UI should display with a spinning circle while OH is doing its background work.

@k3mist This is what should display when you browse to the URL: https://www.openhab.org/docs/tutorial/1sttimesetup.html

You may need to hand edit this file to get the UI up and running - /etc/openhab2/services/addons.cfg
And just to confirm, what URL are you using trying to reach OH?

making some progress here

ran sudo apt purge openhab2 openhab2-addons

and sudo apt install openhab2
now im getting the welcome UI

does the addons package require config changes?

edit; im going to install the addons package, restart hab, see if it happens again

1 Like

I have never seen that. I usually install openHABian on Linux but I have installed the Pi image too.
I get the “not found” message and then the package selection screen.

issue does seem to be related to the addons package. ultimately my pi’s wont have internet access once setup. any ideas?

I haven’t done a fresh install since 2.2 days, if I do I end up copying my /etc/openhab2 folder back in place and fix errors as they arise; but this is usually with hardware changes.

There is an offline deb file that you can install and pull all the official bindings down; larger package but you would at least have everything for offline usage.

That is also mentioned in their link.
sudo apt-get install openhab2-addons

thats the package causing issues for me.

im not sure if its initializing like you said, maybe its getting stuck on some binding? but i cant possibly see it taking 50min+ to initialize/cache everything on a pi4

I have never installed that package personally.

I can confirm this bug!

running:

sudo apt purge openhab2 openhab2-addons
sudo apt install openhab2

did the trick!

I installed the debian buster-full multiple times on a Raspberry Pi 4 to narrow down the problem.
The install script I wrote looks like this:

$ vi install_openHAB_2.sh
--------------------------------------------------------------------------------
# install basic applications
sudo apt-get install --yes screen mc vim git htop
sudo apt-get install --yes software-properties-common apt-transport-https

# install Zulu Java 8 Platform
# Note: Make sure to install Zulu or Java 8, as openHAB is not yet compatible with Java 9
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
#sudo apt-add-repository 'deb http://repos.azulsystems.com/debian stable main'
echo 'deb http://repos.azulsystems.com/debian stable main' | sudo tee /etc/apt/sources.list.d/zulu.list
sudo apt-get update
sudo apt-get install --yes zulu-embedded-8

# install openHAB 2 stable|testing|unstable
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
#echo 'deb https://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
echo 'deb https://openhab.jfrog.io/openhab/openhab-linuxpkg testing main' | sudo tee /etc/apt/sources.list.d/openhab2.list
#echo 'deb https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
sudo apt-get update
sudo apt-get install --yes openhab2 openhab2-addons
#sudo apt-get install --yes openhab2-addons-legacy

# add privileges for common peripherals
sudo adduser openhab dialout
sudo adduser openhab tty
sudo adduser openhab bluetooth
sudo adduser openhab audio
sudo sed -i 's/EXTRA_JAVA_OPTS=""/EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=\/dev\/ttyUSB0:\/dev\/ttyS0:\/dev\/ttyS2:\/dev\/ttyACM0:\/dev\/ttyAMA0"/g' "/etc/default/openhab2"

# Java Network Permissions
# Some openHAB add-ons, like the Network or AmazonDash bindings, need elevated permissions to work.
sudo setcap 'cap_net_raw,cap_net_admin=+eip cap_net_bind_service=+ep' $(realpath /usr/bin/java)

# setup openHAB 2 service
sudo systemctl start openhab2.service
sudo systemctl status openhab2.service
sudo systemctl daemon-reload
sudo systemctl enable openhab2.service

# Note: The first start may take up to 15 minutes, this is a good time to reward yourself with hot coffee or a freshly brewed tea!
--------------------------------------------------------------------------------
$ ./install_openHAB_2.sh

My Raspberry Pi 4 Buster /boot/config.txt looks like this:

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=82

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
hdmi_enable_4kp60=1
gpu_mem=16
  • I first tried the stable repository of openHAB 2 same error.
  • Using openjdk-8-jdk also resulted in the same error.
  • Also waiting over 50 minutes did not bring up the dashboard.
  • Changing the the port number for the dashboard changed the used port accordingly but also resulted in the Page Not Found error when redirected to http://openhabpi:8080/start/index
HTTP ERROR 404
Problem accessing /start/index. Reason:

    Not Found
Powered by Jetty:// 9.4.20.v20190813

The error I get is:

pi@openhabpi:/boot $ journalctl -u openhab2
-- Logs begin at Tue 2019-12-24 04:49:55 CET, end at Tue 2019-12-24 05:25:05 CET. --
Dec 24 04:49:59 openhabpi systemd[1]: Started openHAB 2 - empowering the smart home.
Dec 24 05:04:45 openhabpi systemd[1]: Stopping openHAB 2 - empowering the smart home...
Dec 24 05:04:51 openhabpi karaf[443]: org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; type="
Dec 24 05:04:51 openhabpi karaf[443]:         at org.eclipse.osgi.container.Module.lockStateChange(Module.java:337)
Dec 24 05:04:51 openhabpi karaf[443]:         at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.asyncStop(EquinoxBu
Dec 24 05:04:51 openhabpi karaf[443]:         at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.stop(EquinoxBundle.java:262)
Dec 24 05:04:51 openhabpi karaf[443]:         at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.stop(EquinoxBundle.java:267)
Dec 24 05:04:51 openhabpi karaf[443]:         at org.eclipse.osgi.launch.Equinox.stop(Equinox.java:123)
Dec 24 05:04:51 openhabpi karaf[443]:         at org.apache.karaf.main.Main$2.run(Main.java:354)
Dec 24 05:04:51 openhabpi karaf[443]: Caused by: java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
Dec 24 05:04:51 openhabpi karaf[443]:         at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
Dec 24 05:04:51 openhabpi karaf[443]:         ... 5 more
Dec 24 05:04:56 openhabpi systemd[1]: openhab2.service: Succeeded.
Dec 24 05:04:56 openhabpi systemd[1]: Stopped openHAB 2 - empowering the smart home.
Dec 24 05:08:45 openhabpi systemd[1]: Started openHAB 2 - empowering the smart home.

So the problem of something in the addons package is that there is a timeout after 5 seconds because a lock could not be aquired. But I have no idea what exactly is causing the problem.

2 Likes

Why don’t you use openHABian ?
It provides the same but without the hassle for you and us to support individual setups like yours
(obviously Linux install instructions are generic and thus not tested/recommended on every platform).

If it is not tested nor recommended it should either be removed from the instructions or have a BIG disclaimer attached.

that worked with the addons package installed, thanks.

but these instructions are currently not working if you actually want to do a manual setup (which is what i attempted); https://www.openhab.org/docs/installation/rasppi.html#manual-setup

I did a manual install with snapshot 3.0.0 following those instructions you mentioned on Debian Buster: no problems at all :sunglasses:

not with these packages and not without running openHABian you didn’t

pi@habnode-master ~ %  dpkg -l | grep openhab2 
ii  openhab2                       2.5.0-1                             all          openhab2
ii  openhab2-addons                2.5.0-1                             all          openhab2-addons

i can replicate this issue 100% of the time

and @FL140 confirmed it here with detailed instructions to replicate it; Fresh install of openHAB2 via repository does not work (Linux)