[JIRA] [text-file-operations-plugin] (JENKINS-32694) NullPointerException at CreateTextFile.CreateFileTask.call()

10 views
Skip to first unread message

manosnoam@gmail.com (JIRA)

unread,
Jan 31, 2016, 10:44:02 AM1/31/16
to jenkinsc...@googlegroups.com
Noam Manos created an issue
 
Jenkins / Bug JENKINS-32694
NullPointerException at CreateTextFile.CreateFileTask.call()
Issue Type: Bug Bug
Assignee: Sanketh PB
Components: text-file-operations-plugin
Created: 31/Jan/16 3:43 PM
Priority: Critical Critical
Reporter: Noam Manos

On Windows 2008, when setting File Path =
My_Config.txt

It fails with Null pointer exception.

To resolve I use:
$

{WORKSPACE}

/My_Config.txt

Trace is:

Building remotely on AUTOJEN1 (Win2008 Regression IE9) in workspace c:\jenkins-slave\workspace\Run_Test_Suite_debug
[EnvInject] - Executing scripts and injecting environment variables after the SCM step.
java.lang.NullPointerException
at hudson.FilePath.mkdirs(FilePath.java:2891)
at hudson.FilePath.access$800(FilePath.java:190)
at hudson.FilePath$37.invoke(FilePath.java:1904)
at hudson.FilePath$37.invoke(FilePath.java:1901)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.FilePath.write(FilePath.java:1901)
at com.etas.jenkins.plugins.CreateTextFile.CreateFileTask.call(CreateFileTask.java:94)
at com.etas.jenkins.plugins.CreateTextFile.CreateFileTask.call(CreateFileTask.java:38)
at hudson.remoting.UserRequest.perform(UserRequest.java:120)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:62)
at java.lang.Thread.run(Unknown Source)
at ......remote call to AUTOJEN1(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)
at hudson.remoting.Channel.call(Channel.java:781)
at com.etas.jenkins.plugins.CreateTextFile.CreateFileBuilder.perform(CreateFileBuilder.java:82)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at com.tikal.jenkins.plugins.multijob.MultiJobBuild$MultiJobRunnerImpl.run(MultiJobBuild.java:136)
at hudson.model.Run.execute(Run.java:1738)
at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:73)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Create/Update Text File' marked build as failure

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

manosnoam@gmail.com (JIRA)

unread,
Jan 31, 2016, 10:45:02 AM1/31/16
to jenkinsc...@googlegroups.com

goikhburg@gmail.com (JIRA)

unread,
Feb 29, 2016, 12:05:03 PM2/29/16
to jenkinsc...@googlegroups.com
Lior Goikhburg commented on Bug JENKINS-32694
 
Re: NullPointerException at CreateTextFile.CreateFileTask.call()

Having the same problem.

Only absolute path to file fixes the problem.
Please make the paths relative to $WORKSPACE

pbsanketh@gmail.com (JIRA)

unread,
Mar 1, 2016, 11:32:04 AM3/1/16
to jenkinsc...@googlegroups.com
Sanketh PB commented on Bug JENKINS-32694
 
Re: NullPointerException at CreateTextFile.CreateFileTask.call()

This was implemented to use absolute paths. Sure, I will fix this issue.

Thanks and Regards,
Sanketh

pbsanketh@gmail.com (JIRA)

unread,
Mar 1, 2016, 11:34:01 AM3/1/16
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Mar 19, 2016, 2:37:03 PM3/19/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-32694
 
Re: NullPointerException at CreateTextFile.CreateFileTask.call()

Code changed in jenkins
User: Sanketh P B
Path:
.project
pom.xml
src/main/java/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilder.java
src/main/java/com/etas/jenkins/plugins/CreateTextFile/CreateFileTask.java
src/main/resources/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilder/config.jelly
src/main/resources/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilder/help-useWorkspace.html
src/test/java/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilderTest.java
http://jenkins-ci.org/commit/text-file-operations-plugin/643305cb7b049ebfcaac928a20c2fc6b4adcb06d
Log:
Fixed https://issues.jenkins-ci.org/browse/JENKINS-33221 : Logging added, error handling fixed
Fixed https://issues.jenkins-ci.org/browse/JENKINS-32694 : If file path doesn't start with variable or not absolute then file is created at $

{WORKSPACE}

Fixed adding multiple end of line when existing file is modified

pbsanketh@gmail.com (JIRA)

unread,
Mar 19, 2016, 3:20:02 PM3/19/16
to jenkinsc...@googlegroups.com
Sanketh PB resolved as Fixed
 

Introduced "Create at Workspace" checkbox. If this is enabled the specified file will be created at workspace directory.
It is allowed to create file at network drive or fixed drive, so I cannot by default create the file at workspace directory always.

Change By: Sanketh PB
Status: Open Resolved
Assignee: Sanketh PB Noam Manos
Resolution: Fixed

pbsanketh@gmail.com (JIRA)

unread,
Mar 19, 2016, 3:20:03 PM3/19/16
to jenkinsc...@googlegroups.com
Introduced "Create at Workspace" checkbox. If this is enabled the specified file will be created at workspace directory. 
It is allowed to create file at network drive or fixed drive, so I cannot by default create the file at workspace directory always.


Fix is available in 1.3.0 release.

goikhburg@gmail.com (JIRA)

unread,
Mar 21, 2016, 11:00:01 AM3/21/16
to jenkinsc...@googlegroups.com
Lior Goikhburg commented on Bug JENKINS-32694
 
Re: NullPointerException at CreateTextFile.CreateFileTask.call()

This change is unusable in UNIX-like systems, such as Linux where directory delimeter is a slash and not a backslash () like it is in Windows.
Currently the plugin assumes the OS is Windows and the delimiter is backslash ().

File Path: context/Dockerfile.ubuntu-14.04-extended
Create at Workspace: True
results in :

17:49:02 Creating/updating file at '/var/lib/jenkins/jobs/ubuntu-14.04-extended/workspace\context/Dockerfile.ubuntu-14.04-extended'
17:49:02 File does not exist at '/var/lib/jenkins/jobs/ubuntu-14.04-extended/workspace\context/Dockerfile.ubuntu-14.04-extended', new file will be created.
17:49:02 File successfully created/updated at /var/lib/jenkins/jobs/ubuntu-14.04-extended/workspace\context/Dockerfile.ubuntu-14.04-extended

This creates a direcotry named "workspace\context/" inside job.
Please fix.

goikhburg@gmail.com (JIRA)

unread,
Mar 21, 2016, 11:01:05 AM3/21/16
to jenkinsc...@googlegroups.com

goikhburg@gmail.com (JIRA)

unread,
Mar 21, 2016, 11:01:05 AM3/21/16
to jenkinsc...@googlegroups.com
Lior Goikhburg edited a comment on Bug JENKINS-32694
 
Re: NullPointerException at CreateTextFile.CreateFileTask.call()
This change is unusable in UNIX-like systems, such as Linux where directory delimeter is a slash  {noformat}  (/) {noformat}  and not a backslash  {noformat}  (\) {noformat}  like it is in Windows.
Currently the plugin assumes the OS is Windows and the delimiter is backslash
 {noformat}  (\) {noformat} .


File Path: context/Dockerfile.ubuntu-14.04-extended
Create at Workspace: True
results in :

{noformat}

17:49:02 Creating/updating file at '/var/lib/jenkins/jobs/ubuntu-14.04-extended/workspace\context/Dockerfile.ubuntu-14.04-extended'
17:49:02 File does not exist at '/var/lib/jenkins/jobs/ubuntu-14.04-extended/workspace\context/Dockerfile.ubuntu-14.04-extended', new file will be created.
17:49:02 File successfully created/updated at /var/lib/jenkins/jobs/ubuntu-14.04-extended/workspace\context/Dockerfile.ubuntu-14.04-extended
{noformat}


This creates a direcotry named "workspace\context/" inside job.
Please fix.

pbsanketh@gmail.com (JIRA)

unread,
Mar 26, 2016, 10:26:02 AM3/26/16
to jenkinsc...@googlegroups.com
Sanketh PB assigned an issue to Noam Manos
Change By: Sanketh PB
Assignee: Sanketh PB Noam Manos

pbsanketh@gmail.com (JIRA)

unread,
Mar 26, 2016, 10:26:03 AM3/26/16
to jenkinsc...@googlegroups.com

manosnoam@gmail.com (JIRA)

unread,
Apr 4, 2016, 1:01:07 PM4/4/16
to jenkinsc...@googlegroups.com
Noam Manos reopened an issue
 

Trying to use Plugin version 1.3.1, I'm getting on this file:
$

{WORKSPACE}

/3M_Custom_Data.properties

*Failed to create/update file.
null*

I tried with or without WORKSPACE option, with slash and backslash.

System is Windows 2008, Jenkins 1.647

$

{3M_Custom_Data}
Change By: Noam Manos
Resolution: Fixed
Status: Resolved Reopened

manosnoam@gmail.com (JIRA)

unread,
Apr 4, 2016, 1:03:02 PM4/4/16
to jenkinsc...@googlegroups.com
Trying to use Plugin version 1.3.1, I'm getting on this file:
${WORKSPACE}/ 3M_Custom_Data Custom_Data .properties


*Failed to create/update file.
null*


The file content is:
${My_Custom_Data}

I tried with or without WORKSPACE option, with slash and backslash.

System is Windows 2008, Jenkins 1.647

${3M_Custom_Data}

manosnoam@gmail.com (JIRA)

unread,
Apr 4, 2016, 3:22:02 PM4/4/16
to jenkinsc...@googlegroups.com
Noam Manos edited a comment on Bug JENKINS-32694
Trying to use Plugin version 1.3.1, I'm getting on this file:
\ ${WORKSPACE} \ /Custom_Data.properties

* Failed to create/update file.
null
*


The file content is:
\ ${My_Custom_Data}

I tried with or without WORKSPACE option, with slash and backslash.
System is Windows 2008, Jenkins 1.647



manosnoam@gmail.com (JIRA)

unread,
Apr 4, 2016, 3:23:01 PM4/4/16
to jenkinsc...@googlegroups.com
Noam Manos edited a comment on Bug JENKINS-32694
Trying to use Plugin version 1.3.1, I'm getting on this file:
\
$ \ {WORKSPACE } \ } /Custom_Data.properties


Failed to create/update file.
null


The file content is:
\ $ \ {My_Custom_Data \ }

I tried with or without WORKSPACE option, with slash and backslash.
System is Windows 2008, Jenkins 1.647



manosnoam@gmail.com (JIRA)

unread,
Apr 6, 2016, 10:56:01 AM4/6/16
to jenkinsc...@googlegroups.com
Noam Manos assigned an issue to Sanketh PB
Change By: Noam Manos
Assignee: Noam Manos Sanketh PB

goikhburg@gmail.com (JIRA)

unread,
Apr 6, 2016, 11:29:01 AM4/6/16
to jenkinsc...@googlegroups.com
Lior Goikhburg commented on Bug JENKINS-32694
 
Re: NullPointerException at CreateTextFile.CreateFileTask.call()

Using "create at workspace" with relative path or just specifying $

{WORKSPACE}

/path .... both ways work well in ver 1.3.1 in Linux.

goikhburg@gmail.com (JIRA)

unread,
Apr 6, 2016, 11:29:02 AM4/6/16
to jenkinsc...@googlegroups.com
Lior Goikhburg edited a comment on Bug JENKINS-32694
 
Re: NullPointerException at CreateTextFile.CreateFileTask.call()
Using "create at workspace" with relative path or just specifying  {noformat}  ${WORKSPACE}/path {noformat}  .... both ways work well in ver 1.3.1 in Linux.

manosnoam@gmail.com (JIRA)

unread,
Apr 7, 2016, 4:16:02 AM4/7/16
to jenkinsc...@googlegroups.com
Noam Manos edited a comment on Bug JENKINS-32694
 
Re: NullPointerException at CreateTextFile.CreateFileTask.call()
So it is probably related to Windows.
Also happens on
 with  Jenkins 1.656.

manosnoam@gmail.com (JIRA)

unread,
Apr 7, 2016, 4:16:02 AM4/7/16
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Apr 8, 2016, 1:06:02 PM4/8/16
to jenkinsc...@googlegroups.com


User: Sanketh P B
Path:

src/main/java/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilder.java
src/main/java/com/etas/jenkins/plugins/CreateTextFile/CreateFileTask.java
src/test/java/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilderTest.java
http://jenkins-ci.org/commit/text-file-operations-plugin/246f5a0ff1aedba561a32df77a913f28c712d9a6
Log:
Fixed JENKINS-33899 and JENKINS-32694
logging caused null exception. Improvements in exception logging.

pbsanketh@gmail.com (JIRA)

unread,
Apr 8, 2016, 1:13:02 PM4/8/16
to jenkinsc...@googlegroups.com

pbsanketh@gmail.com (JIRA)

unread,
Apr 8, 2016, 1:13:03 PM4/8/16
to jenkinsc...@googlegroups.com

pbsanketh@gmail.com (JIRA)

unread,
Apr 8, 2016, 1:24:03 PM4/8/16
to jenkinsc...@googlegroups.com
Sanketh PB resolved as Fixed
Change By: Sanketh PB
Status: Reopened Resolved
Resolution: Fixed

manosnoam@gmail.com (JIRA)

unread,
Apr 19, 2016, 3:33:03 PM4/19/16
to jenkinsc...@googlegroups.com
Noam Manos commented on Bug JENKINS-32694
 
Re: NullPointerException at CreateTextFile.CreateFileTask.call()

Yep, now working.
Thank you, great plugin!

Reply all
Reply to author
Forward
0 new messages