[JIRA] [workflow-plugin] (JENKINS-31029) no known implementation of class jenkins.tasks.SimpleBuildWrapper

71 views
Skip to first unread message

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 11:14:01 AM10/19/15
to jenkinsc...@googlegroups.com
Daniel Doubrovkine created an issue
 
Jenkins / Bug JENKINS-31029
no known implementation of class jenkins.tasks.SimpleBuildWrapper
Issue Type: Bug Bug
Assignee: Jesse Glick
Components: workflow-plugin
Created: 19/Oct/15 3:13 PM
Environment: fails on OSX, works on Linux
Priority: Major Major
Reporter: Daniel Doubrovkine

A straightforward JUnit test is failing on OSX and succeeds on Linux, presumably this means the implementation will be broken on OSX as well.

public class AnsiColorBuildWrapperWorkflowTest {
@ClassRule
public static BuildWatcher buildWatcher = new BuildWatcher();

@Rule
public RestartableJenkinsRule story = new RestartableJenkinsRule();

@Test
public void testWorkflowWrap() throws Exception {
story.addStep(new Statement() {
@Override
public void evaluate() throws Throwable {
Assume.assumeTrue(!Functions.isWindows());
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition(
"node {\n"
+ " wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2])

Unknown macro: {n" + " sh("""#!/bin/bashn" + " echo -e '\\e[31mred\\e[0m'"""n" + " )n" + " }

\n"
+ "}"
));
story.j.assertBuildStatusSuccess(p.scheduleBuild2(0));
StringWriter writer = new StringWriter();
p.getLastBuild().getLogText().writeHtmlTo(0L, writer);
assertTrue(writer.toString().matches("(?s).<span style=\"color: #CD0000;\">red</span>."));
}
});
}

}

java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named AnsiColorBuildWrapper
at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:233)
at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:186)
at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:91)
at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:103)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133)

See https://github.com/dblock/jenkins-ansicolor-plugin/pull/60.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Oct 19, 2015, 12:29:02 PM10/19/15
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Cannot Reproduce
 

If it passes on Linux, there is probably something wrong with the Mac build environment. Without having a Mac, I cannot help you. Most likely the annotation processor for @Extension was not run for some reason (see target/classes/META-INF/annotations/hudson.Extension), perhaps because you neglected to do a clean build.

Change By: Jesse Glick
Status: Open Resolved
Resolution: Cannot Reproduce

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 12:50:01 PM10/19/15
to jenkinsc...@googlegroups.com
Daniel Doubrovkine commented on Bug JENKINS-31029
 
Re: no known implementation of class jenkins.tasks.SimpleBuildWrapper

Jesse Glick So you don't have a mac and just resolve this as "don't have a mac, therefore cannot reproduce"? Cmon.

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 12:50:03 PM10/19/15
to jenkinsc...@googlegroups.com
Daniel Doubrovkine edited a comment on Bug JENKINS-31029
[~jglick] So you don't have a mac and just resolve this as "don't have a mac, therefore cannot reproduce"? Cmon.  We have multiple people that have been looking at this and still cannot find the root cause.

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 12:51:03 PM10/19/15
to jenkinsc...@googlegroups.com

Also look at https://github.com/dblock/jenkins-ansicolor-plugin/pull/60, the same code works on a Linux CI and fails on OSX CI. I am going to call this a Jenkins bug.

jglick@cloudbees.com (JIRA)

unread,
Oct 19, 2015, 1:19:04 PM10/19/15
to jenkinsc...@googlegroups.com

Well you need to look harder: check the file I mentioned (the most likely problem), else open a debugger. It is possible this is a genuine bug in Jenkins core or Workflow plugin or ANSI Color plugin which for some reason manifests itself only on OS X, but my educated guess is that it is an environmental issue.

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 1:46:03 PM10/19/15
to jenkinsc...@googlegroups.com
Daniel Doubrovkine edited a comment on Bug JENKINS-31029
This isn't helpful. I've spent a lot of time  in the debugger, and  trying to understand what is going on with these extensions and plugins, what's loaded and what's not loaded and I cannot make heads or tails out of it.

We have a branch called `osx`, https://github.com/dblock/jenkins-ansicolor-plugin/tree/osx, `mvn test` succeeds on Linux and fails on OSX. There's no difference in environment between the two. You can compare on Travis-CI here:  https://travis-ci.org/dblock/dblock/jenkins-ansicolor-plugin/builds/86233935

If someone is reading this and is a Jenkins expert who actually cares, and is willing to check out the source on OSX and help us with a fix, that'd be ... helpful.

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 1:46:03 PM10/19/15
to jenkinsc...@googlegroups.com

This isn't helpful. I've spent a lot of time trying to understand what is going on with these extensions and plugins, what's loaded and what's not loaded and I cannot make heads or tails out of it.

We have a branch called `osx`, https://github.com/dblock/jenkins-ansicolor-plugin/tree/osx, `mvn test` succeeds on Linux and fails on OSX. There's no difference in environment between the two. You can compare on Travis-CI here: https://travis-ci.org/dblock/dblock/jenkins-ansicolor-plugin/builds/86233935.

If someone is reading this and is a Jenkins expert who actually cares, and is willing to check out the source on OSX and help us with a fix, that'd be ... helpful.

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 1:47:01 PM10/19/15
to jenkinsc...@googlegroups.com

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 1:48:01 PM10/19/15
to jenkinsc...@googlegroups.com
 
Re: no known implementation of class jenkins.tasks.SimpleBuildWrapper

I am going to reopen this because it's an issue. I am also going to label it ansicolor-plugin since we don't know where the problem is. If Jesse Glick feels like closing it again I won't object.

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 1:48:01 PM10/19/15
to jenkinsc...@googlegroups.com
Daniel Doubrovkine reopened an issue
 
Change By: Daniel Doubrovkine
Resolution: Cannot Reproduce
Status: Resolved Reopened
Assignee: Jesse Glick Daniel Doubrovkine

jglick@cloudbees.com (JIRA)

unread,
Oct 19, 2015, 1:52:01 PM10/19/15
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-31029
 
Re: no known implementation of class jenkins.tasks.SimpleBuildWrapper

Can you reproduce locally? If so, you should first inspect the file I mentioned, to see if it in fact contains the indexed extension. If it does, then you will have to step through code starting in DescribableHelper.coerce until you find where it is failing to see the implementation.

The Travis build is probably the problem, since it is running (essentially) mvn -DskipTests install && mvn test rather than the simpler mvn install, or the faster and safer mvn -DskipTests install && mvn surefire:test or the safer if slower mvn -DskipTests install && mvn clean test. I have no hypothesis why the Linux build would pass if so.

tyler@monkeypox.org (JIRA)

unread,
Oct 19, 2015, 2:03:04 PM10/19/15
to jenkinsc...@googlegroups.com
R. Tyler Croy updated an issue
 
Change By: R. Tyler Croy
A straightforward JUnit test is failing on OSX and succeeds on Linux, presumably this means the implementation will be broken on OSX as well.

{ quote code }

public class AnsiColorBuildWrapperWorkflowTest {
@ClassRule
    public static BuildWatcher buildWatcher = new BuildWatcher();
    
    @Rule
    public RestartableJenkinsRule story = new RestartableJenkinsRule();

    @Test
    public void testWorkflowWrap() throws Exception {
        story.addStep(new Statement() {
            @Override
            public void evaluate() throws Throwable {
                Assume.assumeTrue(!Functions.isWindows());
                WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p");
                p.setDefinition(new CpsFlowDefinition(
                        "node {\n"
                        + "  wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2]) {\n"
                        + "    sh(\"\"\"#!/bin/bash\n"

                        + "      echo -e '\\\\e[31mred\\\\e[0m'\"\"\"\n"
                        + "    )\n"

                        + "  }\n"
                        + "}"
                ));
                story.j.assertBuildStatusSuccess(p.scheduleBuild2(0));
                StringWriter writer = new StringWriter();
                p.getLastBuild().getLogText().writeHtmlTo(0L, writer);
                assertTrue(writer.toString().matches("(?s).*<span style=\"color: #CD0000;\">red</span>.*"));                        
            }
        });
    }

}

{ quote code }

{
quote code }
java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named AnsiColorBuildWrapper

    at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:233)
    at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:186)
    at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:91)
    at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:103)
    at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133)

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 2:05:01 PM10/19/15
to jenkinsc...@googlegroups.com
Daniel Doubrovkine commented on Bug JENKINS-31029
 
Re: no known implementation of class jenkins.tasks.SimpleBuildWrapper

Yes, I can reproduce locally.

  • None of the mvn invocations change anything in the failure.
  • hudson.plugins.ansicolor.AnsiColorBuildWrapper$DescriptorImpl is found in target/classes/META-INF/annotations/hudson.Extension

I'll spend some time in the debugger ...

jglick@cloudbees.com (JIRA)

unread,
Oct 19, 2015, 2:05:01 PM10/19/15
to jenkinsc...@googlegroups.com

One thing I thought of is that Mac OS X uses a case-insensitive filesystem by default, so if your filenames do not match names used in code, a Mac test will pass but a Linux test will correctly fail. However that is the reverse of your problem so it is probably a red herring.

tyler@monkeypox.org (JIRA)

unread,
Oct 19, 2015, 2:08:01 PM10/19/15
to jenkinsc...@googlegroups.com

Daniel Doubrovkine, I think there was some missed context here which led to a misunderstanding. The link to the build in Travis definitely writes off the possibility for a developer-local environment problem IMHO.

I think making the component ansicolor-plugin until we can isolate it further is a good plan.

I thought this might be a JDK issue since owenmehegan mentioned in this comment that things fail for him when running on OS X with Java 6? A while back we moved the core JRE requirement from JRE6 to JRE7 but it looks like Travis is using JDK7 (java version "1.7.0_45")

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 2:11:01 PM10/19/15
to jenkinsc...@googlegroups.com

dblock@dblock.org (JIRA)

unread,
Oct 19, 2015, 2:12:01 PM10/19/15
to jenkinsc...@googlegroups.com
Daniel Doubrovkine commented on Bug JENKINS-31029
 
Re: no known implementation of class jenkins.tasks.SimpleBuildWrapper

R. Tyler Croy Thanks. I've changed the component for this bug, no problem. If you have OSX give this a try, I am not very familiar with Jenkins internals and this is taking a lot of time just to grok

jglick@cloudbees.com (JIRA)

unread,
Oct 19, 2015, 2:39:01 PM10/19/15
to jenkinsc...@googlegroups.com

So you need to see whether DescribableHelper.getDescriptorList includes the instance of AnsiColorBuildWrapper.DescriptorImpl. If so, check findSubtypes and thence coerce. If not, you need to see what is going on in ExtensionList.create and load.

davidkarlsen@java.net (JIRA)

unread,
Jan 24, 2016, 5:47:06 PM1/24/16
to jenkinsc...@googlegroups.com
davidkarlsen assigned an issue to davidkarlsen
 
Change By: davidkarlsen
Assignee: Daniel Doubrovkine davidkarlsen

davidkarlsen@java.net (JIRA)

unread,
Jan 29, 2016, 4:22:05 PM1/29/16
to jenkinsc...@googlegroups.com
davidkarlsen assigned an issue to Daniel Doubrovkine
Change By: davidkarlsen
Assignee: davidkarlsen Daniel Doubrovkine

mh@quernus.co.uk (JIRA)

unread,
Apr 4, 2016, 7:11:02 AM4/4/16
to jenkinsc...@googlegroups.com
Matt Hamilton commented on Bug JENKINS-31029
 
Re: no known implementation of class jenkins.tasks.SimpleBuildWrapper

I'm getting the same error here on our build servers. I've just tried to move to Jenkins 2, and need to get ANSI colour working again. Tried to use this build wrapper, but getting the same error as above. The build slave is OSX:

iosbuilds$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

iosbuilds$ uname -a
Darwin Goram.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

Let me know if I can help in any way.

-Matt

mh@quernus.co.uk (JIRA)

unread,
Apr 4, 2016, 7:22:03 AM4/4/16
to jenkinsc...@googlegroups.com
Matt Hamilton edited a comment on Bug JENKINS-31029
-- I'm getting the same error here on our build servers. I've just tried to move to Jenkins 2, and need to get ANSI colour working again. Tried to use this build wrapper, but getting the same error as above. The build slave is  OSX:


iosbuilds$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

iosbuilds$ uname -a
Darwin Goram.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

Let me know if I can help in any way.

-Matt --

So seems that case sensitivity may be the issue. Using the wrapper declaration:

{{wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2]) {
}}

Seems to work on OSX.

-Matt

mh@quernus.co.uk (JIRA)

unread,
Apr 4, 2016, 7:22:05 AM4/4/16
to jenkinsc...@googlegroups.com
Matt Hamilton edited a comment on Bug JENKINS-31029
- I'm getting the same error here on our build servers. I've just tried to move to Jenkins 2, and need to get ANSI colour working again. Tried to use this build wrapper, but getting the same error as above. The build slave is  OSX:

iosbuilds$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

iosbuilds$ uname -a
Darwin Goram.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

Let me know if I can help in any way.

-Matt
-

EDIT:

So seems that case sensitivity may be the issue. Using the wrapper declaration:

{{wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2]) {
}}

Seems to work on OSX.

-Matt

mh@quernus.co.uk (JIRA)

unread,
Apr 4, 2016, 7:22:05 AM4/4/16
to jenkinsc...@googlegroups.com
Matt Hamilton edited a comment on Bug JENKINS-31029
- - I'm getting the same error here on our build servers. I've just tried to move to Jenkins 2, and need to get ANSI colour working again. Tried to use this build wrapper, but getting the same error as above. The build slave is  OSX:


iosbuilds$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

iosbuilds$ uname -a
Darwin Goram.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

Let me know if I can help in any way.

-Matt- -

So seems that case sensitivity may be the issue. Using the wrapper declaration:

{{wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2]) {
}}

Seems to work on OSX.

-Matt

tpeters@adobe.com (JIRA)

unread,
Jan 25, 2017, 6:47:02 PM1/25/17
to jenkinsc...@googlegroups.com

This still reproduces on OSX for me, even with the recommendation above.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages