question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Declarative pipelines don't work with any overrides

See original GitHub issue

I am using the version of the plugin 1.23 with Jenkins 2.176.2. I have a cloud associated with a template and the plugin starts ECS agents correctly when called with an agent { label 'ecs-label'} and also from a freestyle project with using the same label and restrictions. Then I am trying a very simple declarative pipeline:

pipeline {
    agent {
        ecs {
            inheritFrom 'ecs-label'
        }
    }

  stages {
    stage('Test') {
        steps {
            sh 'echo hello'
        }
    }
  }
}

Which results in the error message

ERROR: Not allowed to override inheritFrom. Allowed overrides are 
Finished: FAILURE

The peculiar part is that this worked correctly with version 1.22 until I created a second cloud in a different region and I have not managed to run an agent { ecs { } } block with any configuration since. I have tried reinstalling the plugin. I upgrade to the latest version - 1.22 - deleted all the clouds and recreated them all resulting in the same error. I used to get a list of supported allowed overrides, at the moment I only get an empty string for allowed overrides.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
StoyanIvanovIcommented, Nov 22, 2019

I can confirm that was indeed the problem. Putting all is the only option that works however. Would have been helpful to be given information or at least to have been pointed at the documentation. I think this needs to be made much clearer in the README.

1reaction
StoyanIvanovIcommented, Nov 12, 2019

So, I have some progress. You have to manually say which values are overridable for each cluster. Under Advanced for each cluster you can find the Allowed declarative settings. The description of the filed says

Settings allowed to be used in the declarative pipeline. Use all for unrestricted use. Always include label, otherwise no agent can be defined. The default is none for security reasons, which fully disables the use of declarative settings.

I will test that next week and will report if that was my problem. This should not be buried in the advanced settings if it is so critical for the plugin’s operation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[JENKINS-54655] declarative library fails to override implicitly ...
If the declarative syntax is used for loading a shared library it fails to override the impliciliy loaded global library.
Read more >
Declarative pipeline - override pipeline level agent
I am having trouble defining agents for my build pipeline. I need to use 2 docker images as agents for entire pipe. first...
Read more >
How to override my global agent to have a specific stage run ...
i want to run two pipelines both on different agents to make both jobs run parallely. But i want one stage to execute...
Read more >
Jenkins Environment Variables: Ultimate Guide - phoenixNAP
The Jenkins pipeline allows users to override environment variables, changing the current value of the variable with a new one. The override ......
Read more >
Parameter Overrides - Declarative GitOps CD for Kubernetes
This provides flexibility in having most of the application manifests defined in Git, while leaving room for some parts of the k8s manifests...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found