java.util.NoSuchElementException when running plugin

Issue #50 resolved
Christophe Promé created an issue

Hello,

I want to configure a deploy job from a Bamboo hosted by Amazon to a dev JIRA hosted by Amazon.

Bamboo version : 5.9.1 JIRA version : 6.4.10

I have created a bamboo user with admin rights on my JIRA

You can see my job configuration in the attached screenshots.

When a run the Deploy job, I got a NoSuchElementException exception :

25-Aug-2015 11:34:56    
25-Aug-2015 11:34:56    Build working directory is /atlassian/bamboo/data/xml-data/build-dir/38371329-38469633
25-Aug-2015 11:34:56    Executing build Deployment of '5.3.3-SNAPSHOT' on ' JIRA Diplomatico'
25-Aug-2015 11:34:56    Starting task 'Clean working directory task' of type 'com.atlassian.bamboo.plugins.bamboo-artifact-downloader-plugin:cleanWorkingDirectoryTask'
25-Aug-2015 11:34:56    Cleaning working directory '/atlassian/bamboo/data/xml-data/build-dir/38371329-38469633'
25-Aug-2015 11:34:56    Finished task 'Clean working directory task' with result: Success
25-Aug-2015 11:34:56    Starting task 'Download release contents' of type 'com.atlassian.bamboo.plugins.bamboo-artifact-downloader-plugin:artifactdownloadertask'
25-Aug-2015 11:34:56    Preparing to download plan result MYPLUGIN-OCBC-157 artifact: Shared artifact: [myPlugin.obr], pattern: [myPlugin*.obr] anchored at: [plugin/target/]
25-Aug-2015 11:34:56    Artifact [myPlugin.obr] downloaded successfully in 0s to working directory
25-Aug-2015 11:34:56    Finished task 'Download release contents' with result: Success
25-Aug-2015 11:34:56    Starting task 'Deploy to JIRA' of type 'com.atlassian.bamboo.plugins.deploy.continuous-plugin-deployment:deploy-task'
25-Aug-2015 11:34:56    Starting plugin deployment task (v. 3.0.7)
25-Aug-2015 11:34:56    Deploying myPlugin-5.3.3-SNAPSHOT.obr to JIRA at http://1.2.3.4:8080
25-Aug-2015 11:34:56    SSL Certificate check: enabled
25-Aug-2015 11:34:56    Error occurred while running Task 'Deploy to JIRA(3)' of type com.atlassian.bamboo.plugins.deploy.continuous-plugin-deployment:deploy-task.
25-Aug-2015 11:34:56    java.util.NoSuchElementException
25-Aug-2015 11:34:56            at com.google.common.collect.AbstractIterator.next(AbstractIterator.java:154)
25-Aug-2015 11:34:56            at com.google.common.collect.Iterators.find(Iterators.java:722)
25-Aug-2015 11:34:56            at com.google.common.collect.Iterables.find(Iterables.java:643)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.plugins.confdeploy.upload.behaviour.ProductLoginRequestBehaviour.handleResponse(ProductLoginRequestBehaviour.java:90)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.plugins.confdeploy.upload.behaviour.ProductLoginRequestBehaviour.handleResponse(ProductLoginRequestBehaviour.java:31)
25-Aug-2015 11:34:56            at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1142)
25-Aug-2015 11:34:56            at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1076)
25-Aug-2015 11:34:56            at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1050)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.plugins.confdeploy.upload.http.DefaultHttpClientWrapper.execute(DefaultHttpClientWrapper.java:122)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.plugins.confdeploy.upload.DefaultUploadClient.executeRequest(DefaultUploadClient.java:170)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.plugins.confdeploy.upload.DefaultUploadClient.deploy(DefaultUploadClient.java:69)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.plugins.confdeploy.AutoDeployTask.run(AutoDeployTask.java:119)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.plugins.confdeploy.AutoDeployTask.execute(AutoDeployTask.java:76)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.task.TaskExecutorImpl$1.call(TaskExecutorImpl.java:268)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.task.TaskExecutorImpl$1.call(TaskExecutorImpl.java:264)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:200)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:264)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:106)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:196)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:124)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:115)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:114)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:118)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
25-Aug-2015 11:34:56            at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
25-Aug-2015 11:34:56            at java.lang.Thread.run(Thread.java:745)
25-Aug-2015 11:34:56    Finalising the build...
25-Aug-2015 11:34:56    Stopping timer.
25-Aug-2015 11:34:56    Build 38371329-38469633-38699011 completed.
25-Aug-2015 11:34:56    Finished processing deployment result Deployment of '5.3.3-SNAPSHOT' on ' JIRA Diplomatico'

Maybe there is something wrong with my configuration ?

Cheers, Christophe

Comments (7)

  1. Joe Clark

    Hi! Sorry for the extreme delay in investigating this issue. It fell off my task list for some reason.

    This exception is a logic bug which is masking a login failure. The code is looking for a response header from the authentication attempt with the name "X-Seraph-LoginReason"; this is the header from JIRA that contains the result of the authentication attempt. It should have the value "OK" to indicate successful login, but if it does not have this value, then this error occurs.

    @christopheprome I notice in your screenshot that you have credentials saved for the user "bamoo" - is this possibly a typo and it should be "bamboo"?

    At the very least, I can fix this bug so that it logs the actual error code to the build log, instead of this meaningless NoSuchElementException.

  2. Christophe Promé reporter

    Hello,

    Yes @troylarson I figured out how to fix it. As @jaysee00 mentioned, I had a typo in my username. Sorry, I forgot to update this issue.

    This bug is Minor, but indeed it would be nice to log the error code instead of the Exception.

    Cheers

  3. Log in to comment