Error Creation of the rule refused

Tags: #<Tag:0x00007fc900c86c90>

Hi,

i have a problem saving rules and scripts. Openhab dosen’t save rules and scripts. In the logfiel i found following entries:

2021-04-07 21:47:15.913 [WARN ] [utomation.rest.internal.RuleResource] - Creation of the rule is refused: null
2021-04-07 21:47:17.178 [WARN ] [utomation.rest.internal.RuleResource] - Creation of the rule is refused: Cannot add element, because an element with same UID (ap0001) already exists.
2021-04-07 21:54:26.791 [WARN ] [utomation.rest.internal.RuleResource] - Creation of the rule is refused: null
2021-04-07 21:54:31.584 [WARN ] [utomation.rest.internal.RuleResource] - Creation of the rule is refused: Cannot add element, because an element with same UID (2cc7d4ef15) already exists.

I have treid the tipps from [SOLVED] OH3 Issue: unable to create rules, scripts, schedules but it dosen’t work for my instalation.

I have tried to use a the uid opnehab has filled un and i have tried a self genereated uid,
Nothing works.

Has anybody a idea?

My system:
openjdk version “11.0.10” 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

openHAB 3.1.0.M3

Ubuntu 20.04 LTS / Linux/5.4.0-70-generic (amd64)

Well, do those element IDs already exist?

No. I haven’t defined any rules or scripts up to now. ‘Settings’ → ‘rules’ or ‘scripts’ is empty.

What about Items or Things? Any of them have those UIDs?

There are no other things or items with these uids.

I have found a solution for me:

  • stop service openhab
  • delete /var/lib/openhab/jsondb/automation_rules.json and the corespondending backup files in directory backup
  • start openhab

And now it works.

That’s wired. I can’t reproduce the errors… It works now.