5

I am building an Eclipse RCP-based product, and I am running into an issue where when I try to use the built-in p2 UI to install updates to the product, I get an error message in the dialog that "Insufficient access privileges to apply this update."

I have debugged into Eclipse and found that the 'root cause' is that there is a p2 .profile file that has xml that includes this snippet:

<iuProperties id='com.datical.db.ui.product' version='1.33.0.201412032223'>
  <properties size='4'>
    <property name='org.eclipse.equinox.p2.internal.inclusion.rules' value='STRICT'/>
    <property name='org.eclipse.equinox.p2.type.root' value='true'/>
    <property name='org.eclipse.equinox.p2.type.lock' value='3'/>
    <property name='org.eclipse.equinox.p2.base' value='true'/>
  </properties>
</iuProperties>

The relevant line is the one that says <property name='org.eclipse.equinox.p2.type.lock' value='3'/>

I'm not sure what I am doing wrong - I think I must have something awry in my product definition or my feature definition or in my install process that is causing this line to be there.

When I step through the Eclipse code (our target environment is 3.7/Indigo) I see that the profile is being written inside org.eclipse.equinox.internal.p2.engine:SurrogateProfileHandler:addSharedProfileBaseIUs (which is private static.) That is called from SurrogateProfileHandler:createProfile

The product's p2 repository is being built using the tycho plugins, version 0.15.

SteveDonie
  • 8,700
  • 3
  • 43
  • 43
  • Since p2 is a very specialized subject it may be worth asking this on the [Eclipse forums](https://eclipse.org/forums/) in the P2 forum. – greg-449 Dec 04 '14 at 08:18
  • The [Indigo documents](http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fequinox%2Fp2%2Fengine%2FIProfile.html) suggest valid values for that flag are 0 (LOCK_NONE), 1 (LOCK_UNINSTALL) or 2 (LOCK_UPDATE). No mention of what 3 means. Have you tried with a newer version of tycho? – Nick Wilson Dec 04 '14 at 09:44
  • The flags are OR'd together, so 3 indicates that it is locked for both update and uninstall. I haven't (yet) tried moving to a newer version of tycho, mainly out of FUD. greg-449, thanks for the ref to the forums - I'll try cross-posting there. – SteveDonie Dec 04 '14 at 14:45
  • 1
    I never heard of this problem so this may be a bug which has not yet been reported. If this is the case, you anyway would need to update to a newer p2 version, and since p2 is embedded in Tycho you need to update your Tycho version. – oberlies Dec 04 '14 at 17:51
  • Today I updated to tycho version 0.21.0 (latest) and I am seeing virtually identical behavior. The lock is still being set when I first run the product. I have hacked around this by manipulating the XML at install time. That allows me to run "Check for Updates" in the app and now I can actually select the updated version and apply it - which initially appears to work. However, when I dig deeper I am seeing things like both the old and new version of the feature showing up in the About Dialog on the features tab, and the plugins all with the 'old' version. – SteveDonie Dec 12 '14 at 19:23

3 Answers3

1

We finally discovered another piece of information that may be relevant. We were using a custom OSGI directory name. When we removed that, everything started working as expected.

SteveDonie
  • 8,700
  • 3
  • 43
  • 43
  • 1
    If you look at this page: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html which details eclipse configuration options, there is a mention of "-configuration (Main) equivalent to setting osgi.configuration.area to " – SteveDonie Feb 23 '15 at 00:34
0

It seems that you have a shared install where the product you would like to update is (potentially) used by many installations as a base - and therefore cannot be updated.

Peter
  • 46
  • 3
  • What would lead to something being marked as a shared install? The install process I am using is just to unzip the platform-specific zip file that is created by tycho's 'materialize-product' and 'archive-product' plugins into a directory that is in my home directory (in my case, on Ubuntu - /home/steve/product). I then run the executable with '-initialize', which is when I see the .profile.gz file get created with the lock. – SteveDonie Dec 10 '14 at 15:25
  • I tried -initialize with a newer eclipse product and it didn't add the lock. So, I suppose your best bet is to use a newer tycho version (and thus have a newer p2 version) as @oberlies pointed out. – Peter Dec 12 '14 at 08:38
  • BTW: Why would you use -initialize if it was not a read-only install? – Peter Dec 12 '14 at 08:39
  • I am using -initialize because that is what this page said I should do. http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Feclipse-install.html – SteveDonie Dec 12 '14 at 15:11
0

This kind of problem goes beyond what can be answered well on stackoverflow because you'd really need to provide an example project and exact steps to reproduce the problem.

The most plausible cause for the symptoms you are seeing is some kind of file system permission problem. This documentation mentions that you need write permission to the installation directory for running Eclipse with -initialize. Maybe you are lacking some permissions making some of the -initialize procedure fail and leave the installation in an inconsistent state.

oberlies
  • 11,503
  • 4
  • 63
  • 110
  • Putting together an example may be what I have to do. Unfortunately, right now I have already sunk about 2 weeks into this and can't justify spending more time on it right now. I do have write permissions on all the directories in question. – SteveDonie Dec 15 '14 at 17:54