openhab / openhab-distro

The binary distribution of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.3k stars 394 forks source link

OH tries to uninstall Regex transformation at each startup #342

Closed lolodomo closed 7 years ago

lolodomo commented 7 years ago

At each startup, I can see this error:

2016-12-02 00:17:04.169 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed uninstalling 'openhab-transformation-regex': Feature named 'openhab-transformation-regex/0.0.0' is not installed

Please note that the Regex transformation is marked as installed in Paper UI. This transformation was installed automatically when the MiOS binding was installed (required dependency). In my addons.cfg file, I have only:

transformation = map

and my file org.openhab.addons.cfg only contains:

transformation = map

It is something that was working well in the past, I was not forced to set regex as transformation.

BClark09 commented 7 years ago

With all these issues, have you tried commenting out each line in the addons.cfg so that it is not trying to override the org.openhab.addons.cfg file? And then setting them in paperUI?

lolodomo commented 7 years ago

No because I expect like before to be able using config files to setup what to be installed, without using Paper UI. I have no such issue with snapshot 607 which is my current (stable) reference.

kaikreuzer commented 7 years ago

Well, don't define a (strict) list of transformation services then. What is in addons.cfg is considered to be the truth of what you want. And if you say you do not want regex there, it will try to deinstall it. Simply comment out the transformation line or add regex to it.

lolodomo commented 7 years ago

Of course I can add regex in addons.cfg but a normal user will probably not do it because he will not know that this is something required by another binding. The user should not have to take care and know all hardcoded dependencies for bindings. And why changing that while it was working well before ?

kaikreuzer commented 7 years ago

Other people complained that if they remove something from addons.cfg, it still stays installed. So addons.cfg only works for adding stuff, not removing, which doesn't make much sense either.

Work in on the way to update the documentation. "normal" users should probably not use addons.cfg anymore at all.

ThomDietrich commented 7 years ago

We were talking about this topic at https://github.com/openhab/openhab-docs/issues/146#issuecomment-264204153 The way how @lolodomo misunderstood the addons.cfg file here (especially the change in concept) is clear to me. The file should contain more information regarding the absolute nature of the file and in regards to the other ticket, maybe we should give defaults like #ui = basic,paper,habpanel. @lolodomo if you want, please prepare a PullRequest.

lolodomo commented 7 years ago

Until recently the addons.cfg was a way to add features to the package. Now it is add and delete.

ThomDietrich commented 7 years ago

Instead of "add and delete" I would phrase it as "update". If you think about it, this is how it should be. Imagine you sell your Sonos speaker and do not need the binding any longer. What's the expected outcome of removing "sonos" from the binding = sonos,knx,zwave list? The recent change is a change to the better, it just has to be transported and documented correctly.

Would you take it upon you to update the phrasing inside the file?

lolodomo commented 7 years ago

In my current use case, that is MiOS binding requiring regex and map transformations, the user should not have to know that and these features should not be uninstalled because the user has requested to install another transformation. But I will not insist more because I know the workaround now. I will try it with the next snapshot I will install.

lolodomo commented 7 years ago

I will not change the file myself as there is no clear way to explain the current behavior.

ThomDietrich commented 7 years ago

I disagree. addons.cfg allows to define an absolute list of addons. Nothing more or less will be available. Straight and simple as that. I would go as far as to say that any other behavior would be wrong. If you want the comfort of automatic dependency management, use PaperUI. I am aware that recommendations regarding addons changed over the last few months. A lot happened to solve this unclear situation and we are now at a state where both paths are functional and allow users to follow their preferred addons management strategy. All that's needed is additional information in addons.cfg and apparently a note regarding the dependencies of the MiOS binding in its documentation article. Do you still disagree?

lolodomo commented 7 years ago

I agree even if I still think that's a pity to force the user dealing with hidden dependencies. Hopefully the uninstall is failing (why?) and the binding probably continues working. By the way, documenting the special case of the MiOS binding would be a minimum workaround.

lolodomo commented 7 years ago

Note that the new principle does not work with HABpanel.

kaikreuzer commented 7 years ago

the special case of the MiOS binding

I'd like to stress that this is indeed a very exceptional case, because no add-on should usually depend on another add-on. For MiOS, this is purely the case for historic reasons, being an 1.x binding.

kaikreuzer commented 7 years ago

Note that the new principle does not work with HABpanel.

What exactly do you mean?

lolodomo commented 7 years ago

I explaimed in issue #340. As HABpanel is not included in my ui= line, it should be uninstalled and not present in my dashboard.

dpackham commented 7 years ago

I see the same error

2017-01-23 13:57:53.656 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed uninstalling 'openhab-transformation-map': Feature named 'openhab-transformation-map/0.0.0' i s not installed 2017-01-23 13:57:53.668 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed uninstalling 'openhab-transformation-regex': Feature named 'openhab-transformation-regex/0.0. 0' is not installed

the addons file is stock

dpackham commented 7 years ago

I am using the MIOS binding that comes with the latest 2.0 release. BTW