NullPointerException

Issue #3 resolved
Marcel Pociot created an issue

I'm receiving a NullPointerException when trying to get the PHP Code Sniffer results:

08-Nov-2016 23:56:19    Error occurred while running Task '(7)' of type eu.markusschulte.atlassian.bamboo.plugin.basic-metrics-bundle:checkstyleJobTask.
08-Nov-2016 23:56:19    java.lang.NullPointerException
08-Nov-2016 23:56:19            at eu.markusschulte.atlassian.bamboo.plugin.report.checkstyle.result.representation.CheckstyleXmlRootElement.getTotalCount(CheckstyleXmlRootElement.java:13)
08-Nov-2016 23:56:19            at eu.markusschulte.atlassian.bamboo.plugin.report.checkstyle.result.representation.PHPCodeSniffer.getTotalCount(PHPCodeSniffer.java:45)
08-Nov-2016 23:56:19            at eu.markusschulte.atlassian.bamboo.plugin.report.xml.task.core.ReportXmlJobTask.execute(ReportXmlJobTask.java:65)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$200(TaskExecutorImpl.java:313)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:246)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:313)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:122)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:74)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:215)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:139)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:130)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:221)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:129)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:137)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:51)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
08-Nov-2016 23:56:19            at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
08-Nov-2016 23:56:19            at java.lang.Thread.run(Thread.java:745)

This results in the build to fail - even though the Checkstyle result tab looks good and is able to show results

Comments (5)

  1. Markus Schulte repo owner

    Thanks for reporting this bug-report.

    I have an idea about the reason for this to happen. Could you please attach your CodeSniffer-file?

    Furthermore, your specific environment could be interesting: - What version of CodeSniffer are you using? - What version of Bamboo are you using? - Are you using remote Bamboo-agents for building?

  2. Paul Bailey

    Same issue here. Currently running PHPCS 1.5.6

    Result file below:

    <?xml version="1.0" encoding="UTF-8"?>
    <checkstyle version="1.5.6">
    </checkstyle>
    

    In our instance, it's also unable to render the Checkstyle results tab.

    Screen Shot 2017-01-05 at 5.28.16 AM.png

  3. Log in to comment