I have updated my development system on a raspberry pi v3 from OH 3.4M5 to OH 3.4.0 and I am unable to have HABApp working. Previously the system was on OH 3.4M1.
The trouble is that HABApp is unable to access to the rest API. The log file is filled with status 401 as follows
2022-12-24 07:54:30.690 [INFO ] [HABApp ] - HABApp Version 1.0.6
2022-12-24 07:54:30.796 [INFO ] [HABApp.Config ] - Textual thing config disabled! Folder /etc/openhab/habapp/params does not exist!
2022-12-24 07:54:30.797 [INFO ] [HABApp.Config ] - Manual thing configuration disabled! Folder /etc/openhab/habapp/config does not exist!
2022-12-24 07:54:30.811 [INFO ] [HABApp.mqtt.connection ] - MQTT disabled
2022-12-24 07:54:31.743 [INFO ] [HABApp.openhab.connection ] - Connected to OpenHAB version 3.4.0 (Release Build)
2022-12-24 07:54:31.771 [WARN ] [HABApp.openhab.connection ] - Status 401 for GET http://localhost:8080/rest/systeminfo
2022-12-24 07:54:31.774 [INFO ] [HABApp.openhab.connection ] - Waiting for openHAB startup to be complete
2022-12-24 07:54:32.809 [WARN ] [HABApp.openhab.connection ] - Status 401 for GET http://localhost:8080/rest/systeminfo 20
I have read that this may be related to authentication problems and I have set the option Allow basic authentication
under the API security setting.
From the browser I get a similar error. When I type on the address bar of chrome
http://192.168.27.82:8080/rest/systeminfo
The output is
{"error":{"message":"Authentication required","http-code":401}}
If I add username and password to the https query nothing changes (I tried also with the edge browser). If I try with a simpler different query
http://192.168.27.82:8080/rest
it gives some result in both browsers
{"version":"5","locale":"en_US","measurementSystem":"SI","runtimeInfo":{"version":"3.4.0","buildString":"Release Build"},"links":[{"type":"profile-types","url":"https://192.168.27.82:8443/rest/profile-types"},{"type":"uuid","url":"https://192.168.27.82:8443/rest/uuid"},{"type":"spec","url":"https://192.168.27.82:8443/rest/spec"},{"type":"logging","url":"https://192.168.27.82:8443/rest/logging"},{"type":"ui","url":"https://192.168.27.82:8443/rest/ui"},{"type":"events","url":"https://192.168.27.82:8443/rest/events"},{"type":"thing-types","url":"https://192.168.27.82:8443/rest/thing-types"},{"type":"channel-types","url":"https://192.168.27.82:8443/rest/channel-types"},{"type":"config-descriptions","url":"https://192.168.27.82:8443/rest/config-descriptions"},{"type":"links","url":"https://192.168.27.82:8443/rest/links"},{"type":"sitemaps","url":"https://192.168.27.82:8443/rest/sitemaps"},{"type":"transformations","url":"https://192.168.27.82:8443/rest/transformations"},{"type":"discovery","url":"https://192.168.27.82:8443/rest/discovery"},{"type":"persistence","url":"https://192.168.27.82:8443/rest/persistence"},{"type":"systeminfo","url":"https://192.168.27.82:8443/rest/systeminfo"},{"type":"addons","url":"https://192.168.27.82:8443/rest/addons"},{"type":"items","url":"https://192.168.27.82:8443/rest/items"},{"type":"audio","url":"https://192.168.27.82:8443/rest/audio"},{"type":"inbox","url":"https://192.168.27.82:8443/rest/inbox"},{"type":"bindings","url":"https://192.168.27.82:8443/rest/bindings"},{"type":"voice","url":"https://192.168.27.82:8443/rest/voice"},{"type":"things","url":"https://192.168.27.82:8443/rest/things"},{"type":"iconsets","url":"https://192.168.27.82:8443/rest/iconsets"},{"type":"templates","url":"https://192.168.27.82:8443/rest/templates"},{"type":"module-types","url":"https://192.168.27.82:8443/rest/module-types"},{"type":"services","url":"https://192.168.27.82:8443/rest/services"},{"type":"auth","url":"https://192.168.27.82:8443/rest/auth"},{"type":"rules","url":"https://192.168.27.82:8443/rest/rules"}]}
Note that if I perform the systeminfo query from the API explorer it obviously works, and it gives
{
"systemInfo": {
"configFolder": "/etc/openhab",
"userdataFolder": "/var/lib/openhab",
"logFolder": "/var/log/openhab",
"javaVersion": "11.0.16",
"javaVendor": "Raspbian",
"osName": "Linux",
"osVersion": "5.15.76-v7+",
"osArchitecture": "arm",
"availableProcessors": 4,
"freeMemory": 123817024,
"totalMemory": 194904064,
"startLevel": 100
}
}
I have tried to clear openhab cache, restart openhab, reboot, uninstall and re-install habapp from openhabian-config but the behavior is always the same.
The only thing that I have not tried is to completely restart from scratch from a new openhabian image.
Is this an issue related to some change in 3.4 (possibly introduced before milestone 5)?
Thank you for your attention
Lionello