5 Replies Latest reply on Feb 19, 2010 11:47 AM by mark4

    Error while updating a custom plugin

    gerrie

      Uploading the plugin works fine:

       

      2010-01-20 12:19:19,380 INFO  [org.rhq.enterprise.gui.admin.plugin.InstalledPluginsUIBean] A new plugin [jopr-mirage-plugin-1.0.3.jar] has been uploaded to [C:\WINDOWS\TEMP\36f68642-1264b2b3bdb--7ffd57969.upload]

       

      2010-01-20 12:19:19,400 INFO  [org.rhq.enterprise.gui.admin.plugin.InstalledPluginsUIBean] A new plugin has been deployed [D:\jopr-server-2.3.1\jbossas\server\default\deploy\rhq.ear\rhq-downloads\rhq-plugins\jopr-mirage-plugin-1.0.3.jar]. A scan is required now in order to register it.

       

      Then I do a 'Scan For Updates" and its seems that the tx cannot aquire a lock (ORA-02049):

       

      2010-01-20 12:19:44,928 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] Rediscovered agent plugin [Mirage]

       

      2010-01-20 12:19:44,928 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] Newer version of [Mirage] plugin found (version 1.0.3) - older version (1.0.2) will be ignored.

       

      2010-01-20 12:19:44,938 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] Deploying [1] new or updated agent plugins: [Mirage]

       

      2010-01-20 12:19:44,938 INFO  [org.rhq.core.clientapi.agent.metadata.PluginDependencyGraph] Optional plugin [JBossAS5] was requested by plugins [[Hibernate]] but it does not exist in the dependency graph yet and will be ignored

      2010-01-20 12:19:44,938 INFO  [org.rhq.core.clientapi.agent.metadata.PluginDependencyGraph] Optional plugin [JBossAS5] was requested by plugins [[Hibernate]] but it does not exist in the dependency graph yet and will be ignored

      2010-01-20 12:19:44,938 INFO  [org.rhq.core.clientapi.agent.metadata.PluginDependencyGraph] Optional plugin [JBossAS5] was requested by plugins [[Hibernate]] but it does not exist in the dependency graph yet and will be ignored

       

      2010-01-20 12:19:46,871 INFO  [org.rhq.enterprise.server.resource.ResourceManagerBean] User [org.rhq.core.domain.auth.Subject[id=1,name=admin]] is marking resource [Resource[id=11171, type=Mirage dashboard MBean, key=mirage:name=dashboard, name=mirage:name=dashboard, parent=devmirage JBossAS 4.2.2.GA mirage (devmirage:1099)]] for asychronous deletion


      2010-01-20 12:20:47,461 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 2049, SQLState: 42000

       

      2010-01-20 12:20:47,461 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-02049: Time-out: distributed tx waits for lock


      2010-01-20 12:20:47,461 ERROR [org.rhq.enterprise.server.resource.ResourceManagerBean] Bulk named query delete error for 'InstalledPackage.deleteByResources' for [11171]: org.hibernate.exception.SQLGrammarException: could not execute update query

       

      I already restarted the Jopr server but the problem persists. Is there a workaround for this problem? E.g. remove the plugin and install it for scratch, but you can't seem to remove a plugin ...

       

      Gerrie

        • 1. Re: Error while updating a custom plugin
          tall_male

          Happened to me as well, I cannot remove a plugin. Whatever I do, remove it from the plugin directory, restart the server; the plgin keeps coming back and stays in the plugin overview.

           

          How to get rid of a (broke) plugin.....?

          • 2. Re: Error while updating a custom plugin
            ips

            Removal/undeployment of plugins is something that was not supported in RHQ/Jopr until very recently. This feature is tracked by https://bugzilla.redhat.com/show_bug.cgi?id=RHQ-2, a fix for which is now in the RHQ git master branch. the RHQ 3.0.0.B03 milestone release will be released in the next week or so and will include this feature.

            • 3. Re: Error while updating a custom plugin
              mazz

              Today, you cannot remove plugins. Code was recently added (is probably gonna be in the next beta release tomorrow) that lets you disable a plugin if you no longer want it ( https://bugzilla.redhat.com/show_bug.cgi?id=535894 ).

               

              In this case, it looks like a plugin had bad metadata and caused something screwy to happen. I assume you are doing this within a development environment - in these cases, I would recommend that you clean your database and rebuild it (i.e. "mvn -Ddbsetup" from the modules/core/dbutils directory).

               

              There are some things that cannot be modified or updated in new versions of plugins. IIRC, changing the names of <server> and <service> resource types might cause problems. Most other things should be updatable (I remember Heiko doing alot of work in this area to get plugins to be better updatable - maybe he can chime in here for his thoughts).

               

              One other thing:

               

              2010-01-20 12:20:47,461 ERROR [org.rhq.enterprise.server.resource.ResourceManagerBean] Bulk named query delete error for 'InstalledPackage.deleteByResources' for [11171]: org.hibernate.exception.SQLGrammarException: could not execute update query

               

              That looks bad. It looks like you asked to delete a resource from inventory, but the deletion code tried to use a JPQL query that was not valid. The query is:

               

              "DELETE FROM InstalledPackage ip WHERE ip.resource.id IN ( :resourceIds ) )"

               

              Duh - I wonder how that got in there. Extra ")". That has to be relatively new - otherwise, I can't see how uninventorying a resource could ever have completed successfully before.

              • 4. Re: Error while updating a custom plugin
                gerrie

                The plug-in metadata seems to be fine. The strange thing is that I've update our custom plug-in several times without any issues. And then suddenly the ORA-02049 problem was there to stay. We plan to clear the database asap. I will now keep track of any further changes made on the plug-in, so maybe we can track back to a possible cause (should this error ever happen again).

                 

                Concerning the query syntax error, we are using:

                Jopr version: 2.3.1

                build number: 1212

                • 5. Re: Error while updating a custom plugin
                  mark4

                  I screwed up a plugin somehow, and jopr (2.3.1) was continually complaining about

                   

                  javax.ejb.EJBException: javax.persistence.EntityNotFoundException: deleted entity passed to persist: [org.rhq.core.domain.resource.ResourceType#<null>]

                   

                  causing my plugin updates to go ignored.

                   

                  I seem to have had some luck by

                  - uninventorying all agents (this is a development sandbox)

                  - shutting down jopr server and agent (just one agent for testing)

                  - Removing jopr-server-2.3.1/jbossas/server/default/deploy/rhq.ear/rhq-downloads/rhq-plugins/screwed-up-plugin-1.0.0.jar

                  - Removing rhq-agent-1.3.1/plugins/screwed-up-plugin-1.0.0.jar from my one agent

                  - delete from rhq_plugin where path = 'screwed-up-plugin-1.0.0.jar' (well, the postgres edit-data select-and-delete version)

                   

                  A bit heavy-handed, but it seems to have worked.