mibexsoftware / bamboo-plan-dsl-plugin

Configuration as code with a Groovy-based DSL or YAML for Atlassian Bamboo.
https://marketplace.atlassian.com/plugins/ch.mibex.bamboo.plandsl/
Other
40 stars 16 forks source link

Error creating bean with name 'ch.mibex.bamboo.plandsl.plugin.task.SeedTask' #62

Closed muchino closed 7 years ago

muchino commented 7 years ago

Hi Michael

is there a new issue with in Bamboo 6.0.0 with the newest version of our add-on.

The following error only happens in one project where we execute PLanDSL, other Plans are working but they are doing the same - the test plan just executes the plan definition for one sandbox project.

Any ideas?


05-Sep-2017 09:47:55 | Build Bitvoodoo Infrastructure - Test Bamboo Plans - Deploy Sandbox Plan #394 (BVINFRA-PLANDSLADDONDEVELOP-JOB1-394) started building on agent Elastic Agent on i-02a24728bb7092562
-- | --
05-Sep-2017 09:47:55 | Elastic agent on instance i-02a24728bb7092562
05-Sep-2017 09:47:55 | Build working directory is /home/bamboo/bamboo-agent-home/xml-data/build-dir/BVINFRA-PLANDSLADDONDEVELOP-JOB1
05-Sep-2017 09:47:55 | Executing build Bitvoodoo Infrastructure - Test Bamboo Plans - Deploy Sandbox Plan #394 (BVINFRA-PLANDSLADDONDEVELOP-JOB1-394)
05-Sep-2017 09:47:55 | Starting task 'Source Code Checkout' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
05-Sep-2017 09:47:55 | Build always requires a clean checkout
05-Sep-2017 09:47:55 | Cleaning build directory '/home/bamboo/bamboo-agent-home/xml-data/build-dir/BVINFRA-PLANDSLADDONDEVELOP-JOB1'
05-Sep-2017 09:47:55 | Updating source code to revision: d39683efd5f7ff09e244f16dbb8ae80ee485dcda
05-Sep-2017 09:47:55 | Fetching 'refs/heads/develop' from 'ssh://git@git.bitvoodoo.ch:9418/bv/dsl-build-plans.git'.
05-Sep-2017 09:47:55 | Warning: Permanently added '[127.0.0.1]:41059' (RSA) to the list of known hosts.
05-Sep-2017 09:47:56 | Checking out revision d39683efd5f7ff09e244f16dbb8ae80ee485dcda.
05-Sep-2017 09:47:56 | Creating local git repository in '/home/bamboo/bamboo-agent-home/xml-data/build-dir/BVINFRA-PLANDSLADDONDEVELOP-JOB1/.git'.
05-Sep-2017 09:47:56 | Cloning into '/home/bamboo/bamboo-agent-home/xml-data/build-dir/BVINFRA-PLANDSLADDONDEVELOP-JOB1'...
05-Sep-2017 09:47:56 | done.
05-Sep-2017 09:47:56 | Branch develop set up to track remote branch develop from origin.
05-Sep-2017 09:47:56 | Switched to a new branch 'develop'
05-Sep-2017 09:47:56 | Updated source code to revision: d39683efd5f7ff09e244f16dbb8ae80ee485dcda
05-Sep-2017 09:47:56 | Finished task 'Source Code Checkout' with result: Success
05-Sep-2017 09:47:56 | Running pre-build action: VCS Version Collector
05-Sep-2017 09:47:56 | Failed to execute the build 'BVINFRA-PLANDSLADDONDEVELOP-JOB1-394': Error creating bean with name 'ch.mibex.bamboo.plandsl.plugin.task.SeedTask': Unsatisfied dependency expressed through constructor argument with index 0 of type [com.atlassian.bamboo.applinks.ImpersonationService]: : No qualifying bean of type [com.atlassian.bamboo.applinks.ImpersonationService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.bamboo.applinks.ImpersonationService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
05-Sep-2017 09:47:56 | Successfully removed working directory at '/home/bamboo/bamboo-agent-home/xml-data/build-dir/BVINFRA-PLANDSLADDONDEVELOP-JOB1'
05-Sep-2017 09:47:56 | Finalising the build...
05-Sep-2017 09:47:56 | Stopping timer.
05-Sep-2017 09:47:56 | Build BVINFRA-PLANDSLADDONDEVELOP-JOB1-394 completed.
05-Sep-2017 09:47:56 | Running on server: post build plugin 'NCover Results Collector'
05-Sep-2017 09:47:56 | Running on server: post build plugin 'Build Hanging Detection Configuration'
05-Sep-2017 09:47:56 | Running on server: post build plugin 'Clover Delta Calculator'
05-Sep-2017 09:47:57 | Running on server: post build plugin 'Maven Dependencies Postprocessor'
05-Sep-2017 09:47:57 | All post build plugins have finished
05-Sep-2017 09:47:57 | Generating build results summary...
05-Sep-2017 09:47:57 | Saving build results to disk...
05-Sep-2017 09:47:57 | Logging substituted variables...
05-Sep-2017 09:47:57 | Indexing build results...
05-Sep-2017 09:47:57 | Finished building BVINFRA-PLANDSLADDONDEVELOP-JOB1-394.
mrueegg commented 7 years ago

@muchino Hi, I think the problem here is that the seed task was executed on a remote agent (i.e., elastic agent) which is not supported by the plug-in because all the important services to create plans, jobs, etc. are only available on local (server) agents. Could that be the problem?

muchino commented 7 years ago

Hi Michael

You are totally right - it was executed on an elastic agent - my fault. I configured the Default Bamboo Agent to be responsible for the Plan DSL Jobs - Thank you :)

mrueegg commented 7 years ago

Hi Oli,

You're very welcome. Glad to here that it is working now :-)

danhiris commented 6 years ago

Does that mean that in order to use DSL on any jobs, those jobs have to run on the server's agent? Can just the seed task run on a server agent but the rest of the job on a remote agent?

mrueegg commented 6 years ago

@danhiris Only the job which has the seed task needs to run on a local Bamboo server. All other jobs can run on (remote) agents.

AFAIK it is not possible to run only certain tasks on the server but others of the same job on a remote agent. All tasks of the job are run on the same agent.

danhiris commented 6 years ago

@mrueegg Not sure I understand. I define my groovy dsl file in the seed task of the job but then I want the tasks defined by it to run on remote agents. Will they be able to run on remote agents even though I ran the seed task on the server? Aren't those tasks part of the same job?

mrueegg commented 6 years ago

@danhiris Only the seed task needs to run on the local server. All the jobs and tasks you create with the DSL can then be run on the remote agent. They are not part of the same job. Normally, you would have a separate build plan for the seed task. This plan is only executed when you change the DSL. The plans and jobs the plug-in creates from the DSL are completely separate. Does that answer your question?

danhiris commented 6 years ago

@mrueegg yes, clear as mud. Was thinking about it wrong.