6 Replies Latest reply on May 21, 2011 11:53 AM by mkannapa

    RHQ4: Handling plugin updates

    genman

      I was wondering the appropriate workflow for developing new plugins. I'm pretty new and have been making lots of mistakes.

       

      Should I delete (&purge) the old version, then upload the new version? Or upload the new version? (I have run into exceptions in the logs, i.e. unique constraint exceptions with Oracle doing this.)

       

      If I upload a plugin with the same version, e.g 1.0-SNAPSHOT, will it know to update?

       

      How do I ensure the new version of a plugin is pushed out? I'm not seeing this happen going from 1.0 to 1.1. Is there a way with the embedded agent to tell it to update? (I don't know how to invoke its CLI interface.)

       

      RHQ 4's UI is pretty spiffy, but isn't providing much explanation on what's going on. And the logs are sometimes a bit misleading. For example, if the plugin fails to load on the agent side, the server side indicates some sort of resource is missing.

        • 1. RHQ4: Handling plugin updates
          genman

          Just to be clear, I was running into this doing delete/add:

           

          2011-05-05 13:22:11,019 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 1, SQLState: 23000

          2011-05-05 13:22:11,020 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: unique constraint (RHQ.RHQ_PLUGIN_NAME_DEPLOY_IDX) violated

           

          2011-05-05 13:22:11,020 WARN  [org.hibernate.util.JDBCExceptionReporter] SQL Error: 1, SQLState: 23000

          2011-05-05 13:22:11,020 ERROR [org.hibernate.util.JDBCExceptionReporter] ORA-00001: unique constraint (RHQ.RHQ_PLUGIN_NAME_DEPLOY_IDX) violated

           

          2011-05-05 13:22:11,020 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session

          org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update

                  at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)

          • 2. RHQ4: Handling plugin updates
            mazz

            Unsure if this will answer all your questions, but the "Adding and Updating Agent Plugins" wiki page talks about some of this stuff.

             

            If I'm developing a plugin, I don't delete/purge it after every change. I'm usually OK by just uploading a new plugin (or just copying the new jar in the "plugins" dropbox directory) and having the server find it on its next scan. Usually, the plugin update on the server will "just work" and I then command my agents to download the new plugins.

             

            Follow steps 1-5 on that wiki to update the plugins.

             

            On that wiki page, see the blue box titled, "Plugin Versioning" to answer your question about what happens if the plugin has the same version.

             

            The bottom of that wiki talks about deleting plugins (so if you want to purge a plugin and start anew, follow those instructions).

            • 3. RHQ4: Handling plugin updates
              mazz

              I've never seen that constraint violation happen before. That happens if we try to add a new agent plugin with the same name as a plugin that already exists. I'm not sure how that would happen unless you are trying to deploy two  plugins at the same time that have the same name??? That doesn't seem right either, but, I dunno - I'm not sure how that violation can happen. I've never seen it before.

               

              See if that wiki page I mentioned earlier can clarify anything.

              • 4. RHQ4: Handling plugin updates
                genman

                John,

                 

                I've been experimenting with adding my own plugin based on the Script plugin, so the constraint violation may have come from not modifying (as appropriate) the rhq-plugin.xml file.

                 

                The Wiki page was helpful. I think some of the docs are a little hard to follow since the UI for RHQ4 has changed a bit. Again, it would be helpful if exceptions generated by the update process would appear in the UI, or at least if there was a page that displayed captured system exceptions...I suppose one could be created through RHQ itself...

                 

                Thanks for your help.

                • 5. RHQ4: Handling plugin updates
                  mazz

                  Elias Ross wrote:

                   

                  I think some of the docs are a little hard to follow since the UI for RHQ4 has changed a bit

                  Yeah, we do need to go through our wiki and update all our screenshots. The majority of the UI is now completely different (its using GWT now, not JSF). I created a BZ just so we don't forget to do this at some point.

                  • 6. RHQ4: Handling plugin updates
                    mkannapa

                    If you have changed the plugin name (this is JOPR/RHQ 3.0) then it will throw the unique constraint violation. Since in

                    3.0 it is really hard to delete a plugin, you have to be very careful with the name.