Skip to content

[influxdb] OH5.2 persist with rest API gives error 500, also when using rules #21351

Description

@AndyMt

System configuration:

Hardware: Raspberry Pi5
Openhabian and OH 5.2.1
Persistence services: InfluxDB 1.12.4 (default), rrdj4 (few temporary stuff)

Current Behavior

When using the rest endpoint like this:
http://openhabian:8080/rest/persistence/items/EM_ForecastCorrection?time=2026-08-10T10%3A56%3A00.000Z&state=1.0

The API returns Error 500:
"{\\"error\\":{\\"http-code\\":500,\\"exception\\":{\\"class\\":\\"java.lang.NullPointerException\\"}}}"

The same happens in JavaScript rules:
items.EM_ForecastCorrection.persistence.persist()
results in the above exception
Same for DSL rules:
EM_ForecastCorrection.persist()

A call to EM_ForecastCorrection.persist("rrdj4") works! EM_ForecastCorrection.persist("influxdb") doesn't.
Items do persist correctly via persistence strategies.

Expected Behavior

API and scripts should be able to presist a value on request and not only rely on persistence strategies.
Both API and scripts worked in OH 5.1.4 up to OH 5.2 M1.

Steps to Reproduce (for Bugs)

Have influxdb 1.12.4 running and set up.
Create a simple script like the one mentioned above.

Investigations so far:

Installed earlier versions and milestones. The issue was introduced between 5.2 M1 and 5.2 M2.

Stack trace of exception:

 java.lang.NullPointerException: Error
	at <js>.doExecute(openhab.js:2)
	at org.graalvm.polyglot.Value.invokeMember(Value.java:1159)
	at com.oracle.truffle.host.adapters.SimpleRule$$Adapter.execute(Unknown Source)
	at org.openhab.automation.jsscripting.internal.threading.ThreadsafeSimpleRuleDelegate.execute(ThreadsafeSimpleRuleDelegate.java:79)
	at org.openhab.core.automation.module.script.rulesupport.shared.simple.SimpleRuleActionHandlerDelegate.execute(SimpleRuleActionHandlerDelegate.java:35)
	at org.openhab.core.automation.module.script.rulesupport.internal.delegates.SimpleActionHandlerDelegate.execute(SimpleActionHandlerDelegate.java:62)
	at org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1424)
	at org.openhab.core.automation.internal.RuleEngineImpl$RunRuleCallable.call(RuleEngineImpl.java:1828)
	at org.openhab.core.automation.internal.RuleEngineImpl$RunRuleCallable.call(RuleEngineImpl.java:1)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions