Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48116

Jenkins 2.91 breaks builds which require Ruby

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core, ruby-runtime-plugin
    • Labels:
    • Environment:
      Jenkins 2.91, ruby-runtime 0.12, Rvm 0.6, rbenv plugin 0.0.17, Linux HOSTNAME 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    • Similar Issues:

      Description

      After updating from 2.90 to 2.91 we are experiencing the following issue on Jobs which require either rbenv or rvm:

      As soon as enabling rvm and setting it to Ruby 2.3.1 we get the following error in the console log

      FATAL: (NoMethodError) undefined method `<<' for #<Jenkins::Plugin::OpaqueJavaObject:0x27ac28ca>
       org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `<<' for #<Jenkins::Plugin::OpaqueJavaObject:0x27ac28ca>
       at RUBY.setup(/virtual/jenkins/plugins/rvm/WEB-INF/classes/models/rvm_wrapper.rb:33)
       at RUBY.setUp(/virtual/jenkins/plugins/rvm/WEB-INF/classes/vendor/gems/bundler/../gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/model/environment_proxy.rb:8)

      With ebenv we get a very similar issue:

      FATAL: (NoMethodError) undefined method `<<' for #<Jenkins::Plugin::OpaqueJavaObject:0x15176737>
      org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `<<' for #<Jenkins::Plugin::OpaqueJavaObject:0x15176737>
      	at RUBY.install!(/virtual/jenkins/plugins/rbenv/WEB-INF/classes/lib/rbenv.rb:46)
      	at RUBY.setup!(/virtual/jenkins/plugins/rbenv/WEB-INF/classes/lib/rbenv.rb:20)
      	at RUBY.setup(/virtual/jenkins/plugins/rbenv/WEB-INF/classes/models/rbenv_wrapper.rb:65)
      	at RUBY.setUp(/virtual/jenkins/plugins/rbenv/WEB-INF/classes/vendor/gems/bundler/../gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/model/environment_proxy.rb:8)

       
      Current workaround is to downgrade to 2.90, which obviously is not a good solution.

        Attachments

          Issue Links

            Activity

            martinkim Martin Kim Dung-Pham created issue -
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I doubt it has anything to do with the Jenkins core.
            There is no Ruby-related logic in the core itself, and the changes are not obviously related.

            I would suppose there is a sporadic issue in the Ruby Runtime Plugin

            Show
            oleg_nenashev Oleg Nenashev added a comment - I doubt it has anything to do with the Jenkins core. There is no Ruby-related logic in the core itself, and the changes are not obviously related. I would suppose there is a sporadic issue in the Ruby Runtime Plugin
            oleg_nenashev Oleg Nenashev made changes -
            Field Original Value New Value
            Component/s ruby-runtime-plugin [ 16320 ]
            Hide
            danielbeck Daniel Beck added a comment -

            Going by https://github.com/jenkinsci/rvm-plugin/blob/master/models/rvm_wrapper.rb#L33 this seems to be caused by the recent changes to TaskListener that moved behavior into Java 8 default methods.

            I'm surprised it took this long for the ruby-runtime to break.

            Show
            danielbeck Daniel Beck added a comment - Going by https://github.com/jenkinsci/rvm-plugin/blob/master/models/rvm_wrapper.rb#L33 this seems to be caused by the recent changes to TaskListener that moved behavior into Java 8 default methods. I'm surprised it took this long for the ruby-runtime to break.
            Hide
            danielbeck Daniel Beck added a comment -

            Perhaps as https://github.com/jenkinsci/jenkins.rb/blob/master/ruby-runtime/lib/jenkins/model/listener.rb seems to assume every object it gets is an AbstractTaskListener, and that's no longer the case?

            Show
            danielbeck Daniel Beck added a comment - Perhaps as https://github.com/jenkinsci/jenkins.rb/blob/master/ruby-runtime/lib/jenkins/model/listener.rb seems to assume every object it gets is an AbstractTaskListener, and that's no longer the case?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Seems so. Thanks for digging into Daniel Beck. I think the valid fix would be to restore binary compatibility in the core. Generally this issue has been captured in https://github.com/jenkinsci/jenkins/pull/3122 by reviews, but after 2 weeks there was no extra votes from code reviewers. So I went forward and merged it. Not the first time we get into "ridiculous" use-cases, so probably the ultra-conservative approach is the only way while we have no API deprecation policy.

            P.S: I will stop merging BC-breaking things at all. If somebody wants to push them into the core, he/she has to find another person to merge iton the API deprecation policy.

            Show
            oleg_nenashev Oleg Nenashev added a comment - Seems so. Thanks for digging into Daniel Beck . I think the valid fix would be to restore binary compatibility in the core. Generally this issue has been captured in https://github.com/jenkinsci/jenkins/pull/3122 by reviews, but after 2 weeks there was no extra votes from code reviewers. So I went forward and merged it. Not the first time we get into "ridiculous" use-cases, so probably the ultra-conservative approach is the only way while we have no API deprecation policy. P.S: I will stop merging BC-breaking things at all. If somebody wants to push them into the core, he/she has to find another person to merge iton the API deprecation policy.
            oleg_nenashev Oleg Nenashev made changes -
            Assignee Oleg Nenashev [ oleg_nenashev ]
            oleg_nenashev Oleg Nenashev made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            oleg_nenashev Oleg Nenashev made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            oleg_nenashev Oleg Nenashev made changes -
            Labels regression
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Created https://github.com/jenkinsci/jenkins/pull/3154 . Ruby Runtime plugin still needs to be fixed IMHO, but a hotfix for the core seems to be reasonable

            Show
            oleg_nenashev Oleg Nenashev added a comment - Created https://github.com/jenkinsci/jenkins/pull/3154 . Ruby Runtime plugin still needs to be fixed IMHO, but a hotfix for the core seems to be reasonable
            oleg_nenashev Oleg Nenashev made changes -
            Remote Link This issue links to "https://github.com/jenkinsci/jenkins/pull/3154 (Web Link)" [ 18125 ]
            oleg_nenashev Oleg Nenashev made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "acceptance-test-harness PR 383 (Web Link)" [ 18130 ]
            Hide
            jglick Jesse Glick added a comment -

            I looked into patching jenkins.rb but it does not look simple. Apparently every actual Jenkins plugin bundles its own copy, for example rvm.hpi!/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/model/listener.rb. I tried replacing AbstractTaskListener with TaskListener there, without success. Do not really follow how Jenkins::Plugin::Proxies works. Too much black magic. Perhaps we should just block the whole Ruby runtime subsystem from the update center, since I do not think any core developers actually know how to support it, besides Kohsuke Kawaguchi and we cannot bother him.

            Show
            jglick Jesse Glick added a comment - I looked into patching jenkins.rb but it does not look simple. Apparently every actual Jenkins plugin bundles its own copy, for example rvm.hpi!/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/model/listener.rb . I tried replacing AbstractTaskListener with TaskListener there, without success. Do not really follow how Jenkins::Plugin::Proxies works. Too much black magic. Perhaps we should just block the whole Ruby runtime subsystem from the update center, since I do not think any core developers actually know how to support it, besides  Kohsuke Kawaguchi  and we cannot bother him.
            Hide
            jglick Jesse Glick added a comment - - edited

            Filed a PR switching to StreamTaskListener (more correct anyway, to the extent I understand this craziness), but as previously mentioned, to actually release the fix would apparently require 20 different repositories (acc. to fgrep ruby-runtime */*.pluginspec) to be patched and then released.

            Show
            jglick Jesse Glick added a comment - - edited Filed a PR switching to StreamTaskListener (more correct anyway, to the extent I understand this craziness), but as previously mentioned, to actually release the fix would apparently require 20 different repositories (acc. to fgrep ruby-runtime */*.pluginspec ) to be patched and then released.
            jglick Jesse Glick made changes -
            Remote Link This issue links to "jenkins.rb PR 122 (Web Link)" [ 18131 ]
            Hide
            danielbeck Daniel Beck added a comment -

            There are just five plugins updated in the last two years or with at least 1000 installations. If it weren't for gitlab-hook's 8000 installs I'd just recommend we blacklist all of this mess for being broken.

            Show
            danielbeck Daniel Beck added a comment - There are just five plugins updated in the last two years or with at least 1000 installations. If it weren't for gitlab-hook's 8000 installs I'd just recommend we blacklist all of this mess for being broken.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/test/acceptance/plugins/rvm/Rvm.java
            src/test/java/plugins/RvmPluginTest.java
            http://jenkins-ci.org/commit/acceptance-test-harness/3b8f705d3e9789932d2ab428013c5fd428912900
            Log:
            JENKINS-48116 Smoke test for the rvm plugin.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/test/acceptance/plugins/rvm/Rvm.java src/test/java/plugins/RvmPluginTest.java http://jenkins-ci.org/commit/acceptance-test-harness/3b8f705d3e9789932d2ab428013c5fd428912900 Log: JENKINS-48116 Smoke test for the rvm plugin.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            src/main/java/org/jenkinsci/test/acceptance/plugins/rvm/Rvm.java
            src/test/java/plugins/RvmPluginTest.java
            http://jenkins-ci.org/commit/acceptance-test-harness/76b759b39891c348fe937d6028b4d0bc5fdbd39a
            Log:
            Merge pull request #383 from jglick/rvm

            JENKINS-48116 Smoke test for the rvm plugin

            Compare: https://github.com/jenkinsci/acceptance-test-harness/compare/66229eecdfcf...76b759b39891

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/org/jenkinsci/test/acceptance/plugins/rvm/Rvm.java src/test/java/plugins/RvmPluginTest.java http://jenkins-ci.org/commit/acceptance-test-harness/76b759b39891c348fe937d6028b4d0bc5fdbd39a Log: Merge pull request #383 from jglick/rvm JENKINS-48116 Smoke test for the rvm plugin Compare: https://github.com/jenkinsci/acceptance-test-harness/compare/66229eecdfcf...76b759b39891
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/util/AbstractTaskListener.java
            core/src/main/java/hudson/util/LogTaskListener.java
            core/src/main/java/hudson/util/StreamTaskListener.java
            http://jenkins-ci.org/commit/jenkins/60085a0f10409265aa6d028ed5ae9a3b7b9e30f2
            Log:
            JENKINS-48116 - Restrore AbstractTaskListener binary compatibility in the core.

            Since we have the confirmed regression due to the binary compatibility change, I think we need to restore the compatibility.
            OTOH, I restricted the class, so all users will be forced to stop using it when they updgrade the core.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/util/AbstractTaskListener.java core/src/main/java/hudson/util/LogTaskListener.java core/src/main/java/hudson/util/StreamTaskListener.java http://jenkins-ci.org/commit/jenkins/60085a0f10409265aa6d028ed5ae9a3b7b9e30f2 Log: JENKINS-48116 - Restrore AbstractTaskListener binary compatibility in the core. Since we have the confirmed regression due to the binary compatibility change, I think we need to restore the compatibility. OTOH, I restricted the class, so all users will be forced to stop using it when they updgrade the core.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/util/AbstractTaskListener.java
            core/src/main/java/hudson/util/LogTaskListener.java
            core/src/main/java/hudson/util/StreamTaskListener.java
            http://jenkins-ci.org/commit/jenkins/f33506f4f6b428a49aeef4574df00ce483a65257
            Log:
            Merge pull request #3154 from oleg-nenashev/bug/JENKINS-48116

            JENKINS-48116 - Restore AbstractTaskListener binary compatibility in the core.

            Compare: https://github.com/jenkinsci/jenkins/compare/b431eb422a8f...f33506f4f6b4

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/util/AbstractTaskListener.java core/src/main/java/hudson/util/LogTaskListener.java core/src/main/java/hudson/util/StreamTaskListener.java http://jenkins-ci.org/commit/jenkins/f33506f4f6b428a49aeef4574df00ce483a65257 Log: Merge pull request #3154 from oleg-nenashev/bug/ JENKINS-48116 JENKINS-48116 - Restore AbstractTaskListener binary compatibility in the core. Compare: https://github.com/jenkinsci/jenkins/compare/b431eb422a8f...f33506f4f6b4
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            The fix has been integrated towards 2.92

            Show
            oleg_nenashev Oleg Nenashev added a comment - The fix has been integrated towards 2.92
            oleg_nenashev Oleg Nenashev made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            danielbeck Daniel Beck added a comment -

            Oleg Nenashev Do we need separate issues for plugins to migrate off this ticking time bomb? We can't let core be shackled to faulty assumptions from 5 years ago.

            Show
            danielbeck Daniel Beck added a comment - Oleg Nenashev Do we need separate issues for plugins to migrate off this ticking time bomb? We can't let core be shackled to faulty assumptions from 5 years ago.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Daniel Beck I think we "just" need an EPIC for creating "ruby-runtime-api" plugin and then migrating the dependent plugins. And yeah, we need a hero who is ready to work on it.

            Show
            oleg_nenashev Oleg Nenashev added a comment - Daniel Beck I think we "just" need an EPIC for creating "ruby-runtime-api" plugin and then migrating the dependent plugins. And yeah, we need a hero who is ready to work on it.
            Hide
            martinkim Martin Kim Dung-Pham added a comment -

            Oleg Nenashev @all thanks for your efforts on this, very much appreciated!

            Show
            martinkim Martin Kim Dung-Pham added a comment - Oleg Nenashev @all thanks for your efforts on this, very much appreciated!
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-56211 [ JENKINS-56211 ]

              People

              • Assignee:
                oleg_nenashev Oleg Nenashev
                Reporter:
                martinkim Martin Kim Dung-Pham
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: