Quantcast

[JIRA] (JENKINS-15008) NPE

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
Issue Type: Bug Bug
Assignee: Slide-O-Mix
Components: email-ext
Created: 31/Aug/12 10:43 AM
Description:

For sender i have "${EMAIL_VAR} [hidden email]" and have NPE.
Probably problem appeared after upgrading to
Email was triggered for: Success
Email was triggered for: Fixed
Trigger Success was overridden by another trigger and will not send an email.
Sending email for trigger: Fixed
ERROR: Could not send email as a part of the post-build publishers.
java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
at java.util.regex.Matcher.reset(Matcher.java:291)
at java.util.regex.Matcher.<init>(Matcher.java:211)
at java.util.regex.Pattern.matcher(Pattern.java:888)
at hudson.plugins.emailext.plugins.ContentBuilder$Tokenizer.<init>(ContentBuilder.java:171)
at hudson.plugins.emailext.plugins.ContentBuilder.replaceTokensWithContent(ContentBuilder.java:106)
at hudson.plugins.emailext.plugins.ContentBuilder.replaceTokensWithContent(ContentBuilder.java:124)
at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:88)
at hudson.plugins.emailext.ExtendedEmailPublisher.getContent(ExtendedEmailPublisher.java:540)
at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:363)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:273)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:265)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:225)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:717)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:692)
at hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
at hudson.model.Run.execute(Run.java:1546)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
Finished: SUCCESS

Environment: jenkins 1.477
email-ext 2.24.1
Project: Jenkins
Priority: Major Major
Reporter: Kanstantsin Shautsou
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
Change By: Kanstantsin Shautsou (31/Aug/12 10:43 AM)
Description: For sender i have "${EMAIL_VAR} [hidden email]" and have NPE.
Probably problem appeared after upgrading to
 2.24.1 and token plugin...  
Email was triggered for: Success
Email was triggered for: Fixed
Trigger Success was overridden by another trigger and will not send an email.
Sending email for trigger: Fixed
ERROR: Could not send email as a part of the post-build publishers.
java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
at java.util.regex.Matcher.reset(Matcher.java:291)
at java.util.regex.Matcher.<init>(Matcher.java:211)
at java.util.regex.Pattern.matcher(Pattern.java:888)
at hudson.plugins.emailext.plugins.ContentBuilder$Tokenizer.<init>(ContentBuilder.java:171)
at hudson.plugins.emailext.plugins.ContentBuilder.replaceTokensWithContent(ContentBuilder.java:106)
at hudson.plugins.emailext.plugins.ContentBuilder.replaceTokensWithContent(ContentBuilder.java:124)
at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:88)
at hudson.plugins.emailext.ExtendedEmailPublisher.getContent(ExtendedEmailPublisher.java:540)
at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:363)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:273)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:265)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:225)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:717)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:692)
at hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
at hudson.model.Run.execute(Run.java:1546)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
Finished: SUCCESS
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Slide-O-Mix commented on Bug JENKINS-15008

What are you expecting to happen? What is the value of ${EMAIL_VAR}?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Just in ${var} just array of mails. "[hidden email] [hidden email]". This var is entered in global jenkins settings and space separated.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Slide-O-Mix commented on Bug JENKINS-15008

I have the exact same setup and don't have this issue. Can you upload an example config.xml for a job (scrubbed of any personal/company info) so I can see if there is anything amiss?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

config

Change By: Kanstantsin Shautsou (23/Sep/12 5:54 PM)
Attachment: config.xml
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

This construction work ok in other jobs, but in this i not found reason of NPE.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Slide-O-Mix commented on Bug JENKINS-15008

Can you isolate on which token is causing the issue? I don't think its the item in the recipient list. It could be the FILE or ENV tokens.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

It seems i found the problem: i have input string parameter $hWorkspace + custom workspace set to this variable. Current workspace browser shows $JENKINS_HOME content, so i think something variables overload.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
 
Kanstantsin Shautsou edited a comment on Bug JENKINS-15008

It seems i found the problem: i have input string parameter $hWorkspace + custom workspace set to this variable. Current workspace browser shows $JENKINS_HOME content, so i think something wrong with variables overload.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Hehe
Job A has parametrized build plugin that executes Job B with variable WORKSPACE=$WORKSPACE, it's ok passed.
Job B has input string $fWorkspace + custom workspace set to $fWorkspace (this variable wasn't passed to job B, but WORKSPACE was injected). After all i got in build.xml workspace = "/opt/jenkins" (it's $JENKINS_HOME). But, job B's shell execution work correctly with $WORKSPACE variable

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

So, there are 2 problems:
1) how parametrized build plugin work with vars
2) NPE on ${FILE, path="file_on_fs"} gives NPE if there file doesn't exist.

Can you try reproduce/check on your jenkins 2) ?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Slide-O-Mix commented on Bug JENKINS-15008

I can't say anything about the parameterized build plugin works, but I can look at the NPE if the file doesn't exist.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Yeap, skip 1), i also not know all nuances.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Slide-O-Mix commented on Bug JENKINS-15008

Your file is relative to the root of the workspace, correct?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

yes, ext-email plugin calculates it from workspace... But workspace tag in build.xml was different from WORKSPACE, because of variable overload...

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Slide-O-Mix commented on Bug JENKINS-15008

variable overload? apparently, the content token for FILE is meant to return a null if the file doesn't exist or something similar (if the file can't be accessed in the workspace for some reason). I'll see if I can change it so that it just returns an error string saying that the item doesn't exist, does this work?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Code changed in jenkins
User: Alex Earl
Path:
src/main/java/hudson/plugins/emailext/plugins/content/WorkspaceFileContent.java
src/test/java/hudson/plugins/emailext/plugins/content/WorkspaceFileContentTest.java
http://jenkins-ci.org/commit/email-ext-plugin/33dbcc6d4248098314959809695276bf2bcf5e80
Log:
Fix JENKINS-15008

Make the message clear as to what is missing

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

I mean that i not sure what absolute path ${FILE} tried to load because my workspace path was strange.
Yes, there shouldn't be NPE, if file doesn't exist. Btw, ${ENV} doesn't show anything in output if var=$VAR not exist.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15008) NPE

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Slide-O-Mix commented on Bug JENKINS-15008

I'd rather put an error in so the user knows that the file was not found correctly in the path and what path they were trying to access.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12
Loading...