Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning from Bicep results in failed action #126

Open
hansmbakker opened this issue Mar 7, 2023 · 5 comments
Open

Warning from Bicep results in failed action #126

hansmbakker opened this issue Mar 7, 2023 · 5 comments
Assignees
Labels
need-to-triage Requires investigation

Comments

@hansmbakker
Copy link

hansmbakker commented Mar 7, 2023

When setting bicepconfig.json to the following

{
  "experimentalFeaturesEnabled": {
    "userDefinedTypes": true
  }
}

Bicep will warn about using an experimental feature. However, the azure/arm-deploy action interprets this warning as an error and fails the whole run, even though the actual deployment went well:

Run azure/arm-deploy@v1
Changing subscription context...
Validating template...
Warning: WARNING: WARNING: Symbolic name support in ARM is experimental, and should be enabled for testing purposes only. Do not enable this setting for any production usage, or you may be unexpectedly broken at any time!


Creating deployment...
Error: WARNING: WARNING: Symbolic name support in ARM is experimental, and should be enabled for testing purposes only. Do not enable this setting for any production usage, or you may be unexpectedly broken at any time!


Error: Deployment process failed as some lines were written to stderr

Using failOnStdErr: false feels like a too harsh workaround because then there is no possibility anymore to distinguish between a warning and a real error.

@hansmbakker hansmbakker added the need-to-triage Requires investigation label Mar 7, 2023
@rdeveen
Copy link

rdeveen commented Aug 4, 2023

The same happen when there is an update of the Bicep CLI available. This warning should not result in an error.

Warning: WARNING: A new Bicep release is available: v0.20.4. Upgrade now by running "az bicep upgrade".

Creating deployment...
Error: WARNING: A new Bicep release is available: v0.20.4. Upgrade now by running "az bicep upgrade".

Error: Deployment process failed as some lines were written to stderr

@Kaloszer
Copy link

+1

@hoffe86
Copy link

hoffe86 commented Jan 16, 2024

+1

Any updates or workaround?

@jefedeltodos
Copy link

jefedeltodos commented Feb 4, 2024

+1
image

My only workaround to ignore this false fail is to add a continue-on-error: true, and the job will complete successfully.

The issue with this workaround is the job will still succeed even if a legitimate error happens with the deployment.

🤷

@anthony-c-martin
Copy link
Member

Using failOnStdErr: false feels like a too harsh workaround because then there is no possibility anymore to distinguish between a warning and a real error.

It should be safe to set this to false (in fact, I really think this should be the default, or we should just remove the option entirely).

We check the AzCLI exit code to determine failure, which is a more reliable source:

if (exitCode != 0) {
throw new Error("Deployment failed.");
}

arealmaas added a commit to digdir/dialogporten that referenced this issue Feb 7, 2024
<img width="888" alt="image"
src="https://github.com/digdir/dialogporten/assets/1777366/70c6fabb-8d0e-4376-b3b5-e744d6e58244">

Deployments are failing because of warnings about Bicep cli upgrades.
That's a tad too harsh.. But there doesn't seem to be a way to disable
just those types of warnings so we rather skip failing on warnings. Need
to add a different build step to catch these warning instead. Like a
validation deployment or something similar.

Azure/arm-deploy#126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-to-triage Requires investigation
Projects
None yet
Development

No branches or pull requests

8 participants