Upgrade from v3 to 4 and freebsd 13.2 to 14 issue

After I updated to v4 (from a late v3, forgot which exactly) and also updated FreeBSD from 13.2 to 14 at the same time due to other packages disappearing, I’m getting the following error when I try to start the service:

Starting openhab.
daemon: failed to set user environment

I had a look at the startup script(since I have to change the default port anyway) and I can’t see a change to the user/group, openhab, which does still exist so I’m at a loss.
Anyone on FreeBSD 14 that made it work?

On a systemd machine like a pi the user, group to be used in the service is defined in /usr/lib/systemd/system/openhab.service ( this then is linked to different other locations ) :

User=openhab
Group=openhab

In /etc/systemd/system/openhab.service.d/override.conf deviations from the default are defined.

I am not a FreeBSD user so I don’t know if there are ( big ) differences.

Did you install Java? OH3 was Java11, OH4 ist Java17.

It works similarly to that, you have /etc/rc.conf where you enable services and set/override the user and group and then the actual file that handles managing the service /usr/local/etc/rc.d/openhab where default values are set.
I checked and they haven’t changed. The way the service name is set has changed but the name itself hasn’t.

Hard to say. I shouldn’t have to deal with that since the package manager will take care of dependencies, but I’m having a hard time telling which version it uses so I’ll look more into it.

Edit: I have 8,11 and 17 installed and openhab is indeed set to use 17.

After messing around with a fresh install in a vm, I figured out that overwriting the user and group was causing that particular issue, which is odd since they’re the same but probably a freebsd issue.

Now I’m getting this openhab specific error when trying to start the service:

Could not resolve mvn:org.eclipse.platform/org.eclipse.osgi/3.17.200

And the log file isn’t giving me much more info:

2023-09-21 19:33:59.146 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'America/Toronto'.
2023-09-21 19:33:59.157 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'en_CA'.
2023-09-21 19:34:05.264 [INFO ] [.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2023-09-21 19:34:06.248 [INFO ] [org.openhab.ui.internal.UIService   ] - Started UI on port 8088
2023-09-21 19:34:06.601 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Started HABPanel at /habpanel
2023-09-21 19:34:06.985 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '127.0.0.1' with clientid eb5e4a59-1a9f-4405-b0e4-83cf97e5b061
2023-09-21 19:34:14.288 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.
2023-12-25 15:41:25.998 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Stopped HABPanel
2023-12-25 15:41:26.013 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2023-12-25 15:41:26.028 [INFO ] [org.openhab.ui.internal.UIService   ] - Stopped UI
2024-01-02 16:52:01.759 [SEVERE] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.RuntimeException: Could not resolve mvn:org.eclipse.platform/org.eclipse.osgi/3.17.200
        at org.apache.karaf.main.util.SimpleMavenResolver.resolve(SimpleMavenResolver.java:59)
        at org.apache.karaf.main.Main.createClassLoader(Main.java:519)
        at org.apache.karaf.main.Main.launch(Main.java:289)
        at org.apache.karaf.main.Main.main(Main.java:183)

2024-01-02 16:56:21.302 [SEVERE] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.RuntimeException: Could not resolve mvn:org.eclipse.platform/org.eclipse.osgi/3.17.200
        at org.apache.karaf.main.util.SimpleMavenResolver.resolve(SimpleMavenResolver.java:59)
        at org.apache.karaf.main.Main.createClassLoader(Main.java:519)
        at org.apache.karaf.main.Main.launch(Main.java:289)
        at org.apache.karaf.main.Main.main(Main.java:183)

2024-01-02 17:02:29.174 [SEVERE] [org.apache.karaf.main.Main] - Could not launch framework
java.lang.RuntimeException: Could not resolve mvn:org.eclipse.platform/org.eclipse.osgi/3.17.200
        at org.apache.karaf.main.util.SimpleMavenResolver.resolve(SimpleMavenResolver.java:59)
        at org.apache.karaf.main.Main.createClassLoader(Main.java:519)
        at org.apache.karaf.main.Main.launch(Main.java:289)
        at org.apache.karaf.main.Main.main(Main.java:183)

Any idea what could be the cause?

Edit: Seems to definitely be something inside my userdata folder that’s causing the issue.

I ended up deleting my userdata folder, reinstalling openhab, running it once just so it creates all the folders and then stopping it without doing anything on the UI.
Then copied the content of the jsondb folder from my backup to the newly created one in userdata and then started the service and completed the missing stuff for the config with the web UI.

Everything seems to have come back and no issue so far with 4.1.

1 Like