[JIRA] (JENKINS-41476) Jenkinsfile fails with BOM

9 views
Skip to first unread message

larsskj@java.net (JIRA)

unread,
Jan 26, 2017, 7:21:01 AM1/26/17
to jenkinsc...@googlegroups.com
larsskj created an issue
 
Jenkins / Bug JENKINS-41476
Jenkinsfile fails with BOM
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline
Created: 2017/Jan/26 12:20 PM
Environment: Tested with a fresh, default install of Jenkins 2.42
Priority: Minor Minor
Reporter: larsskj

A Multibranch Pipeline fails reading a Jenkinsfile if the file is encoded in UTF-8 and includes a BOM (Byte order mark).

The error depends on the content of the file, but often shows as a variant of 'No such DSL method XX found'.

If the BOM is removed, the file works fine.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

andrew.bayer@gmail.com (JIRA)

unread,
Feb 10, 2017, 2:40:04 PM2/10/17
to jenkinsc...@googlegroups.com
Andrew Bayer updated an issue
Change By: Andrew Bayer
Component/s: workflow-cps-plugin
Component/s: pipeline

andrew.bayer@gmail.com (JIRA)

unread,
Feb 26, 2018, 11:47:03 AM2/26/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-41476
 
Re: Jenkinsfile fails with BOM

Can you attach a Jenkinsfile that's failing for you?

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

eric@louvard.de (JIRA)

unread,
Feb 28, 2018, 3:11:02 AM2/28/18
to jenkinsc...@googlegroups.com

I could reproduce this Issue with Jenkins 2.109 and the attached file Jenkinsfile
Regards.

eric@louvard.de (JIRA)

unread,
Feb 28, 2018, 3:11:03 AM2/28/18
to jenkinsc...@googlegroups.com
Éric Louvard updated an issue
Change By: Éric Louvard
Attachment: Jenkinsfile

andrei.mitin@gmail.com (JIRA)

unread,
Dec 13, 2018, 4:32:02 AM12/13/18
to jenkinsc...@googlegroups.com
Andrei Mitin updated an issue
Change By: Andrei Mitin
Comment: Version 2.46.3 has the same problem
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

andrei.mitin@gmail.com (JIRA)

unread,
Dec 13, 2018, 4:32:02 AM12/13/18
to jenkinsc...@googlegroups.com

Version 2.46.3 has the same problem

jenkins@albersweb.de (JIRA)

unread,
Jun 21, 2019, 4:45:02 AM6/21/19
to jenkinsc...@googlegroups.com
Harald Albers updated an issue
Change By: Harald Albers
Attachment: Jenkinsfile

jenkins@albersweb.de (JIRA)

unread,
Jun 21, 2019, 4:49:17 AM6/21/19
to jenkinsc...@googlegroups.com

I could reproduce this with a simple Jenkinsfile that just contains "echo 'Hello-World!'".
See attached file Jenkinsfile.

Steps to reproduce

  1. Add the attached Jenkinsfile to a GIT repo.
  2. Create a Pipeline Job.
  3. Set Definition to "Pipeline script from SCM".
  4. Set "SCM "to "Git", configure the repository and point "Script Path" to the Jenkinsfile.

If the file has a UTF-8-BOM, the Job fails with

java.lang.NoSuchMethodError: No such DSL method 'echo' found among steps [archive, bat, ... zip] or globals [currentBuild, docker, env, params, pipeline, scm]

Remove the BOM, check in, push and the job will run as expected.

jenkins@albersweb.de (JIRA)

unread,
Jun 21, 2019, 4:52:04 AM6/21/19
to jenkinsc...@googlegroups.com
Harald Albers updated an issue
Change By: Harald Albers
Priority: Minor Major

jenkins@albersweb.de (JIRA)

unread,
Jun 21, 2019, 4:57:03 AM6/21/19
to jenkinsc...@googlegroups.com

I increased priority for this issue because it now has a wider scope: any pipeline job can be affected, and the cause can be hard to find.

As an example, the job might also fail with

groovy.lang.MissingPropertyException: No such property:  for class: groovy.lang.Binding

jenkins@albersweb.de (JIRA)

unread,
Jun 21, 2019, 4:59:02 AM6/21/19
to jenkinsc...@googlegroups.com
Harald Albers edited a comment on Bug JENKINS-41476
I could reproduce this with a simple Jenkinsfile that just contains "echo 'Hello-World!'".
See attached file [^Jenkinsfile].

*Steps to reproduce*

# Add the attached Jenkinsfile to a GIT repo.
# Create a Pipeline Job.
# Set Definition to "Pipeline script from SCM".
# Set "SCM "to "Git", configure the repository and point "Script Path" to the Jenkinsfile.


If the file has a UTF-8-BOM, the Job fails with
{code:java}

java.lang.NoSuchMethodError: No such DSL method 'echo' found among steps [archive, bat, ... zip] or globals [currentBuild, docker, env, params, pipeline, scm]
{code}


Remove the BOM, check in, push and the job will run as expected.


Tested with Jenkins ver. 2.176.1

jenkins@albersweb.de (JIRA)

unread,
Jun 21, 2019, 5:22:02 AM6/21/19
to jenkinsc...@googlegroups.com
Harald Albers edited a comment on Bug JENKINS-41476
I increased priority for this issue because it now has a wider scope: any pipeline job can be affected, and the cause can be hard to find.

As an example, the I have a production job might also fail that fails with
{code:java}

groovy.lang.MissingPropertyException: No such property:  for class: groovy.lang.Binding
{code}
Reply all
Reply to author
Forward
0 new messages