# Snippet Generator not working

**URL:** <https://community.jenkins.io/t/snippet-generator-not-working/6565>\
**Category:** Using Jenkins\
**Tags:** question, pipeline\
**Created:** [March 30, 2023, 5:20pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565 "2023-03-30T17:20:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidA2014](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/davida2014/32/88_2.png) [@DavidA2014](https://community.jenkins.io/u/DavidA2014)\
**Post date:** [March 30, 2023, 5:20pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/1 "2023-03-30T17:20:42Z")

</div>

Jenkins 2.387.1.

The Snippet Generator is not working for us. For a given step, the correct fields appear but:

- The help ‘?’ tips don’t work
- The **Generate Pipeline Script** button generates no output.

Tested in Edge and Chrome - same negative results with both.

Any idea how to fix it please?

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [March 30, 2023, 5:54pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/2 "2023-03-30T17:54:01Z")

</div>

I can’t duplicate the problem as you’ve described it. Steps that I took:

- Install Jenkins 2.387.1 with [my plugins file](https://github.com/MarkEWaite/docker-lfs/blob/2928d47a1dc7fe9a3f82756ea2f13ef3ff330e0e/plugins.txt)
- Open the `/pipeline-syntax` and select `addErrorBadge` from the dropdown list
- Add short strings to each of the displayed fields
- Press the “Generate Pipeline Script” button and confirm that the expected script is generated

You’ll need to provide enough details so that others can duplicate the problem.

---

<div class="post-metadata">

**Author:** ![DavidA2014](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/davida2014/32/88_2.png) [@DavidA2014](https://community.jenkins.io/u/DavidA2014)\
**Post date:** [March 31, 2023, 7:47am UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/3 "2023-03-31T07:47:43Z")

</div>

Hi Mark,

Thanks for attempting to reproduce my problem.

It seems that I only see the problem for a few plugins:

- copyArtifacts
- recordIssues

For **copyArtifacts** , when I click **Generate Pipeline Script** I get a long exception starting:

```auto
Caught unhandled exception with ID d6ec59a6-5622-40d8-bc56-7f9bf77fbf20
java.lang.IllegalArgumentException: The frontend sent an unexpected list of classes (["hudson.plugins.copyartifact.StatusBuildSelector","hudson.plugins.copyartifact.SavedBuildSelector","hudson.plugins.copyartifact.TriggeredBuildSelector","hudson.plugins.copyartifact.DownstreamBuildSelector","hudson.plugins.copyartifact.LastBuildWithArtifactSelector","hudson.plugins.copyartifact.LastCompletedBuildSelector","hudson.plugins.copyartifact.PermalinkBuildSelector","hudson.plugins.copyartifact.SpecificBuildSelector","hudson.plugins.copyartifact.WorkspaceSelector","hudson.plugins.copyartifact.ParameterizedBuildSelector"]) rather than an expected single class. See https://www.jenkins.io/doc/developer/views/table-to-div-migration/ for more information.
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:748)
Caused: java.lang.IllegalArgumentException: Failed to instantiate class hudson.plugins.copyartifact.BuildSelector from {"stapler-class":["hudson.plugins.copyartifact.StatusBuildSelector","hudson.plugins.copyartifact.SavedBuildSelector","hudson.plugins.copyartifact.TriggeredBuildSelector","hudson.plugins.copyartifact.DownstreamBuildSelector","hudson.plugins.copyartifact.LastBuildWithArtifactSelector","hudson.plugins.copyartifact.LastCompletedBuildSelector","hudson.plugins.copyartifact.PermalinkBuildSelector","hudson.plugins.copyartifact.SpecificBuildSelector","hudson.plugins.copyartifact.WorkspaceSelector","hudson.plugins.copyartifact.ParameterizedBuildSelector"],"$class":["hudson.plugins.copyartifact.StatusBuildSelector","hudson.plugins.copyartifact.SavedBuildSelector","hudson.plugins.copyartifact.TriggeredBuildSelector","hudson.plugins.copyartifact.DownstreamBuildSelector","hudson.plugins.copyartifact.LastBuildWithArtifactSelector","hudson.plugins.copyartifact.LastCompletedBuildSelector","hudson.plugins.copyartifact.PermalinkBuildSelector","hudson.plugins.copyartifact.SpecificBuildSelector","hudson.plugins.copyartifact.WorkspaceSelector","hudson.plugins.copyartifact.ParameterizedBuildSelector"]}
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:769)
	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:549)
	at org.kohsuke.stapler.RequestImpl.injectSetters(RequestImpl.java:936)
	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:881)
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:766)

```

For **recordIssues** , when I click **Generate Pipeline Script** the exception starts:

```auto
Error while serving https://<snip>/pipeline-syntax/generateSnippet
java.lang.IllegalArgumentException: The frontend sent an unexpected list of classes (["io.jenkins.plugins.analysis.warnings.AcuCobol","io.jenkins.plugins.analysis.warnings.Gnat","io.jenkins.plugins.analysis.warnings.AndroidLint","io.jenkins.plugins.analysis.warnings.AnsibleLint","io.jenkins.plugins.analysis.warnings.AquaScanner","io.jenkins.plugins.analysis.warnings.Trivy","io.jenkins.plugins.analysis.warnings.ArmCc","io.jenkins.plugins.analysis.warnings.Ajc","io.jenkins.plugins.analysis.warnings.axivion.AxivionSuite","io.jenkins.plugins.analysis.warnings.BluePearl","io.jenkins.plugins.analysis.warnings.Brakeman","io.jenkins.plugins.analysis.warnings.Buckminster","io.jenkins.plugins.analysis.warnings.Ccm","io.jenkins.plugins.analysis.warnings.Cmake","io.jenkins.plugins.analysis.warnings.Cpd","io.jenkins.plugins.analysis.warnings.CppCheck","io.jenkins.plugins.analysis.warnings.CssLint","io.jenkins.plugins.analysis.warnings.Cadence","io.jenkins.plugins.analysis.warnings.Cargo","io.jenkins.plugins.analysis.warnings.CheckStyle","io.jenkins.plugins.analysis.warnings.Clair","io.jenkins.plugins.analysis.warnings.Clang","io.jenkins.plugins.analysis.warnings.ClangAnalyzer","io.jenkins.plugins.analysis.warnings.ClangTidy","io.jenkins.plugins.analysis.warnings.CodeAnalysis","io.jenkins.plugins.analysis.warnings.CodeGenerator","io.jenkins.plugins.analysis.warnings.CodeChecker","io.jenkins.plugins.analysis.warnings.CodeNarc","io.jenkins.plugins.analysis.warnings.Coolflux","io.jenkins.plugins.analysis.warnings.CppLint","io.jenkins.plugins.analysis.warnings.DScanner","io.jenkins.plugins.analysis.warnings.Dart","io.jenkins.plugins.analysis.warnings.Detekt","io.jenkins.plugins.analysis.warnings.DocFx","io.jenkins.plugins.analysis.warnings.DockerLint","io.jenkins.plugins.analysis.warnings.Doxygen","io.jenkins.plugins.analysis.warnings.DrMemory","io.jenkins.plugins.analysis.warnings.EsLint","io.jenkins.plugins.analysis.warnings.Eclipse","io.jenkins.plugins.analysis.warnings.EmbeddedEngineer","io.jenkins.plugins.analysis.warnings.Erlc","io.jenkins.plugins.analysis.warnings.ErrorProne","io.jenkins.plugins.analysis.warnings.FindBugs","io.jenkins.plugins.analysis.warnings.Flake8","io.jenkins.plugins.analysis.warnings.Flawfinder","io.jenkins.plugins.analysis.warnings.FlexSdk","io.jenkins.plugins.analysis.warnings.Fxcop","io.jenkins.plugins.analysis.warnings.GhsMulti","io.jenkins.plugins.analysis.warnings.Gcc4","io.jenkins.plugins.analysis.warnings.Gcc3","io.jenkins.plugins.analysis.warnings.GnuFortran","io.jenkins.plugins.analysis.warnings.Gendarme","io.jenkins.plugins.analysis.warnings.GoLint","io.jenkins.plugins.analysis.warnings.GoVet","io.jenkins.plugins.analysis.warnings.groovy.GroovyScript","io.jenkins.plugins.analysis.warnings.HadoLint","io.jenkins.plugins.analysis.warnings.IarCstat","io.jenkins.plugins.analysis.warnings.Iar","io.jenkins.plugins.analysis.warnings.Xlc","io.jenkins.plugins.analysis.warnings.IbLinter","io.jenkins.plugins.analysis.warnings.Infer","io.jenkins.plugins.analysis.warnings.Intel","io.jenkins.plugins.analysis.warnings.IdeaInspection","io.jenkins.plugins.analysis.warnings.JcReport","io.jenkins.plugins.analysis.warnings.JsLint","io.jenkins.plugins.analysis.warnings.JUnit","io.jenkins.plugins.analysis.warnings.Java","io.jenkins.plugins.analysis.warnings.JavaDoc","io.jenkins.plugins.analysis.warnings.JsHint","io.jenkins.plugins.analysis.warnings.KlocWork","io.jenkins.plugins.analysis.warnings.Kotlin","io.jenkins.plugins.analysis.warnings.KtLint","io.jenkins.plugins.analysis.warnings.MsBuild","io.jenkins.plugins.analysis.warnings.MavenConsole","io.jenkins.plugins.analysis.warnings.TagList","io.jenkins.plugins.analysis.warnings.MentorGraphics","io.jenkins.plugins.analysis.warnings.MetrowerksCodeWarrior","io.jenkins.plugins.analysis.warnings.MyPy","io.jenkins.plugins.analysis.warnings.NagFortran","io.jenkins.plugins.analysis.warnings.WarningsPlugin","io.jenkins.plugins.analysis.warnings.OTDockerLint","io.jenkins.plugins.analysis.warnings.OwaspDependencyCheck","io.jenkins.plugins.analysis.warnings.tasks.OpenTasks","io.jenkins.plugins.analysis.warnings.Invalids","io.jenkins.plugins.analysis.warnings.PcLint","io.jenkins.plugins.analysis.warnings.Pep8","io.jenkins.plugins.analysis.warnings.Php","io.jenkins.plugins.analysis.warnings.PhpStan","io.jenkins.plugins.analysis.warnings.PhpCodeSniffer","io.jenkins.plugins.analysis.warnings.Pit","io.jenkins.plugins.analysis.warnings.Pmd","io.jenkins.plugins.analysis.warnings.PreFast","io.jenkins.plugins.analysis.warnings.PVSStudio","io.jenkins.plugins.analysis.warnings.Perforce","io.jenkins.plugins.analysis.warnings.PerlCritic","io.jenkins.plugins.analysis.warnings.Polyspace","io.jenkins.plugins.analysis.warnings.ProtoLint","io.jenkins.plugins.analysis.warnings.PuppetLint","io.jenkins.plugins.analysis.warnings.PyDocStyle","io.jenkins.plugins.analysis.warnings.PyLint","io.jenkins.plugins.analysis.warnings.QacSourceCodeAnalyser","io.jenkins.plugins.analysis.warnings.QtTranslation","io.jenkins.plugins.analysis.warnings.RegisteredParser","io.jenkins.plugins.analysis.warnings.DupFinder","io.jenkins.plugins.analysis.warnings.ResharperInspectCode","io.jenkins.plugins.analysis.warnings.RevApi","io.jenkins.plugins.analysis.warnings.Robocopy","io.jenkins.plugins.analysis.warnings.RfLint","io.jenkins.plugins.analysis.warnings.RuboCop","io.jenkins.plugins.analysis.warnings.Sarif","io.jenkins.plugins.analysis.warnings.SunC","io.jenkins.plugins.analysis.warnings.Scala","io.jenkins.plugins.analysis.warnings.Simian","io.jenkins.plugins.analysis.warnings.SimulinkCheck","io.jenkins.plugins.analysis.warnings.SonarQube","io.jenkins.plugins.analysis.warnings.SphinxBuild","io.jenkins.plugins.analysis.warnings.SpotBugs","io.jenkins.plugins.analysis.warnings.StyleCop","io.jenkins.plugins.analysis.warnings.StyleLint","io.jenkins.plugins.analysis.warnings.SwiftLint","io.jenkins.plugins.analysis.warnings.TaskingVx","io.jenkins.plugins.analysis.warnings.Tnsdl","io.jenkins.plugins.analysis.warnings.TsLint","io.jenkins.plugins.analysis.warnings.TiCss","io.jenkins.plugins.analysis.warnings.VeraCodePipelineScanner","io.jenkins.plugins.analysis.warnings.DiabC","io.jenkins.plugins.analysis.warnings.XmlLint","io.jenkins.plugins.analysis.warnings.YuiCompressor","io.jenkins.plugins.analysis.warnings.YamlLint","io.jenkins.plugins.analysis.warnings.ZptLint","io.jenkins.plugins.analysis.warnings.OELintAdv"]) rather than an expected single class. See https://www.jenkins.io/doc/developer/views/table-to-div-migration/ for more information.
	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:748)

```

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [March 31, 2023, 12:08pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/4 "2023-03-31T12:08:47Z")

</div>

The output that says:

> [@DavidA2014](#):
>
> `java.lang.IllegalArgumentException: The frontend sent an unexpected list of classes`

indicates that you have one or more plugins installed that have not been updated to support the [configuration form modernization](https://www.jenkins.io/blog/2020/11/10/major-changes-in-weekly-releases/) that happened in Jenkins 2.277.1. The [“migrating Jenkins”](https://community.jenkins.io/t/migrating-jenkins/894/5) topic provides a detailed set of steps that you can follow to identify the plugin or plugins causing the issue.

---

<div class="post-metadata">

**Author:** ![DavidA2014](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/davida2014/32/88_2.png) [@DavidA2014](https://community.jenkins.io/u/DavidA2014)\
**Post date:** [March 31, 2023, 12:49pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/5 "2023-03-31T12:49:32Z")

</div>

Thanks Mark. I will have to read carefully the link you sent me. However, the controller was built recently and I think I have added only these plugins:

- Active Directory
- Copy Artifact
- Environment Injector
- ThinBackup
- Warnings Next Generation
- Subversion

Is it obvious which is the culprit?

---

<div class="post-metadata">

**Author:** ![DavidA2014](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/davida2014/32/88_2.png) [@DavidA2014](https://community.jenkins.io/u/DavidA2014)\
**Post date:** [April 12, 2023, 1:39pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/6 "2023-04-12T13:39:05Z")

</div>

Hi, I’m still struggling with this problem.

To recap, for some plugins (e.g. recordIssues and copyArtifacts) the Snippet Generator generates no pipeline script and the system log shows:

```auto
Caught unhandled exception with ID 7ac1b3fd-4b70-4d1c-b468-529dfe3b5d2f
java.lang.IllegalArgumentException: The frontend sent an unexpected list of classes (["io.jenkins.plugins.analysis.warnings.AcuCobol","io.jenkins.plugins.analysis.warnings.Gnat", <snip>

```

I have checked the plugins I installed against the [known broken plugins dashboard](https://issues.jenkins.io/secure/Dashboard.jspa?selectPageId=20741) and they are not listed there.

We also created a fresh instance of Jenkins with exactly the same plugins. The snippet generator works there as expected. So there is something different about the faulty two instances which are 6 months old. All 3 instances are on the latest LTS 2.387.2. The system info and env variables for the old and new instances are similar (only minor differences).

What could I try next to diagnose the problem?

---

<div class="post-metadata">

**Author:** ![DavidA2014](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/davida2014/32/88_2.png) [@DavidA2014](https://community.jenkins.io/u/DavidA2014)\
**Post date:** [April 13, 2023, 1:19pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/7 "2023-04-13T13:19:21Z")

</div>

@MarkEWaite May I ask you if you can offer any further advice on my issue please?

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [April 13, 2023, 2:10pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/8 "2023-04-13T14:10:07Z")

</div>

Unfortunately, I do not have any great ideas. You might compare the working system and the non-working system for things like:

- Is the context where the pipeline syntax generator is opened the same in the passing and the failing case? For example, is it failing when opened from a different URL in one case than in the other?
- Have you run the full set of [configuration form modernization checks](https://community.jenkins.io/t/migrating-jenkins/894/5) on both instances? If not, it may be worth running that complete set of checks, just in case you’ve found a new instance of a configuration form modernization problem
- What other differences are there between the working and non-working systems?

---

<div class="post-metadata">

**Author:** ![DavidA2014](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/davida2014/32/88_2.png) [@DavidA2014](https://community.jenkins.io/u/DavidA2014)\
**Post date:** [May 22, 2023, 1:51pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/9 "2023-05-22T13:51:53Z")

</div>

@MarkEWaite May I follow-up on this issue please?

As originally explained, we have several Jenkins controllers. In all but one of them, the Snippet Generator, in certain cases, fails to generate any code and an exception is raised when it is used. I examined all the plugins but could not find an appreciable difference between the working and non-working controllers (expect that the non-working ones use the ActiveDirectory plugin).

However, today I realised that there is a significant difference. The non-working controllers use the Nginx reverse proxy server. The working controller does not. We moved the working system over to Nginx and it, too, no longer works, i.e. the snippet generator fails to generate output and an exception is raised.

I have installed the **Strict Crumb Issuer Plugin** and, in **Configure Global Security \> CSRF Protection** I have:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/9/98074650f33f2e68e8cfc2390f84cfd94bcacc9d.png)

Do you think that the Nginx configuration could be causing the problem?

I notice that the exception trace includes:

```auto
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:154)

```

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [May 22, 2023, 3:23pm UTC](https://community.jenkins.io/t/snippet-generator-not-working/6565/10 "2023-05-22T15:23:28Z")

</div>

I’m reasonably confident that the nginx configuration is causing the problem. Compare your nginx configuration with the [nginx reverse proxy configuration instructions](https://www.jenkins.io/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/reverse-proxy-configuration-nginx/) and adapt your configuration to match the recommendations.

The video may also help, though I suspect that the detailed comparison of configuration settings is more important than the tutorial video.

[![](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/f/f8894fbbf52c0813e717cdea434339dd6b5edff7.jpeg "How To Configure Nginx as a Reverse Proxy for Jenkins") ](https://www.youtube.com/watch?v=yixMeJGtLFk)
