Karaf console: bundle:uninstall and bundle:update not running as expected!

@sihui Yes, you are right. Maybe I have time on next weekend to investigate this… But I only can test karaf console commands, what they are doing exactly. If there are any changes in programcode neccessary, someone else has to do this…

@sihui @Kai
Here are my investigations:

I tested on Window10,(32bit and 64bit) with the following builds:

  • 741 (=2.0.0-SNAPSHOT, there is no old 2.0.0 Online-Repo available anymore, but uninstall worked, leaving folder \userdata\tmp\mvn\org\openhab\binding\ untouched!)

  • 2.0.0.RC1

  • 798

  • 850

  • 858

  • 896

  • 903 (=with new Online-Repo!)

I tested 798,850,858,896 with “old url” of Online-Repo: --> latest installed version of a binding always was: 2.1.0.201704261428 ((if I e.g. manually deleted folder \userdata\tmp\mvn\org\openhab\binding\org.openhab.binding.harmonyhub before!))

Then I changed path to “new url” of Online-Repo: --> latest installed version of a binding: depending on the latest available build number (903,904,905,906,907,908,909), but it ever was the newest available!

All above builds have excatly the same behavior!

If a binding NEVER was installed before, both (“karaf console command” or PaperUI) installed the newest available version of the binding from Online-Repo!

But PaperUI does NOT recognize this if you use “karaf console commands” only!

Here are my examples with “HarmonyHub Binding”:

bundle:list
222 | Active   |  80 | 2.1.0.201705011011     | HarmonyHub Binding

bundle:update 222 https://openhab.jfrog.io/openhab/online-repo-snapshot/2.1/org/openhab/binding/org.openhab.binding.harmonyhub/2.1.0-SNAPSHOT/org.openhab.binding.harmonyhub-2.1.0-SNAPSHOT.jar

bundle:list
222 | Active   |  80 | 2.1.0.201705072117     | HarmonyHub Binding   <---newest version!

\userdata\cache\org.eclipse.osgi\222\3\ bundleFile (created with newest version)

\userdata\tmp\mvn\org\openhab\binding\org.openhab.binding.harmonyhub\2.1.0-SNAPSHOT\org.openhab.binding.harmonyhub-2.1.0-SNAPSHOT.jar (not updated or changed!)

bundle:uninstall 222

\userdata\cache\org.eclipse.osgi\222\3\ bundleFile <-- deleted
\userdata\cache\org.eclipse.osgi\222\3\ .delete (file created)

\userdata\tmp\mvn\org\openhab\binding\org.openhab.binding.harmonyhub\2.1.0-SNAPSHOT\org.openhab.binding.harmonyhub-2.1.0-SNAPSHOT.jar (not deleted, untouched!)

PaperUI:

HarmonyHub Binding recognized still as installed!

HarmonyHub Binding uninstalled (via PaperUI)
HarmonyHub Binding installed (via PaperUI)

bundle:list
249 | Active   |  80 | 2.1.0.201705011011     | HarmonyHub Binding	<---old version again, restored from \userdata\tmp\mvn\org\openhab\binding\org.openhab.binding.harmonyhub\2.1.0-SNAPSHOT\

PaperUI:

HarmonyHub Binding uninstalled (via PaperUI)

\userdata\cache\org.eclipse.osgi\249\ .delete (bundeFile deleted and .delete created)

Karaf console:

bundle:install https://openhab.jfrog.io/openhab/online-repo-snapshot/2.1/org/openhab/binding/org.openhab.binding.harmonyhub/2.1.0-NAPSHOT/org.openhab.binding.harmonyhub-2.1.0-SNAPSHOT.jar

bundle:list
250 | Installed |  80 | 2.1.0.201705072117     | HarmonyHub Binding

bundle:start 250
bundle:list

250 | Active   |  80 | 2.1.0.201705072117     | HarmonyHub Binding	<---newest version again!

\userdata\cache\org.eclipse.osgi\250\0\ bundleFile (created, newest version!)

\userdata\tmp\mvn\org\openhab\binding\org.openhab.binding.harmonyhub\2.1.0-SNAPSHOT\org.openhab.binding.harmonyhub-2.1.0-SNAPSHOT.jar (not deleted or overwritten!)

PaperUI:

HarmonyHub Binding recognized still as uninstalled!

HarmonyHub Binding installed (via PaperUI)

bundle:list
250 | Active    |  80 | 2.1.0.201705072117     | HarmonyHub Binding	(still the newest version, installed from karaf console!)
251 | Installed |  80 | 2.1.0.201705011011     | HarmonyHub Binding	(installed old version again, and it's doubled!!) <--this surely is wrong!!)

PaperUI:

HarmonyHub Binding uninstalled!

karaf console:

bundle:uninstall 250
bundle:list
both 250 and 251 are gone!

manually deleted folder
\userdata\tmp\mvn\org\openhab\binding\org.openhab.binding.harmonyhub\2.1.0-SNAPSHOT\

PaperUI:

HarmonyHub Binding installed!

bundle:list
252 | Active   |  80 | 2.1.0.201705072117     | HarmonyHub Binding	(installed with the newest version!)

\userdata\cache\org.eclipse.osgi\252\0\ bundleFile (created, newest version!)

\userdata\tmp\mvn\org\openhab\binding\org.openhab.binding.harmonyhub\2.1.0-SNAPSHOT\org.openhab.binding.harmonyhub-2.1.0-SNAPSHOT.jar (newest version!)

Conclusion:

karaf console commands do exactly what they should do.

bundle:uninstall (OK)
bundle:update (OK)
bundle:install (OK)

BUT, PaperUI does NOT recognize any changes!

PaperUI did an uninstalling, but newest version never was installed. It always installs version from “tmp”

\userdata\tmp\mvn\org\openhab\binding\org.openhab.binding.harmonyhub\2.1.0-SNAPSHOT\

If you delete this folder manually, the newest version is installed!

My recommendation if you want an update of a binding:

  • Use PaperUI to uninstall a binding.
  • Delete corresponding folder from \userdata\tmp\mvn\org\openhab\binding\
  • Use PaperUI to install the binding again.

I cannot confirm, that simply an uninstall/install of a binding via PaperUI or via addons.cfg (to do an update) ever worked before!

1 Like