When trying to uninstall a feature that is installed, started, but not marked
as required, we get an error.

For example:

admin@root()> feature:list| grep platform-api
platform-api                                    │ 2.12.0.SNAPSHOT  │         
│ Started     │ platform-app-2.12.0-SNAPSHOT           │
admin@root()> feature:uninstall platform-api
Error executing command: Feature named 'platform-api/0.0.0' is not installed
admin@root()> feature:uninstall platform-api/2.12.0.SNAPSHOT
Error executing command: Feature named 'platform-api/2.12.0.SNAPSHOT' is not
installed

Even trying to uninstall this feature programmatically via the
FeaturesService.uninstallFeature() fails with the same error. That is true
even after verifying the feature is installed via
FeaturesService.isInstalled() and after having the feature returned to us
via FeaturesService.listInstalledFeatures().

Digging through the code in the class FeaturesServiceImpl, you can see that
it ends up checking the state.requirements table and if not defined in
there, it later reports the feature is not installed. This table seems to be
used to determine if a feature is required or not as per the implementation
for FeaturesServiceImpl.isRequired() whereas
FeaturesServiceImpl.isInstalled() checks the state.installedFeatures table.

Is this a known bug or should I open a ticket?

I was able to circumvent the problem by updating the requirements for the
feature and after having done that, the uninstall goes through successfully.

Regards,

Patrick



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html

Reply via email to