microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.5k stars 2.61k forks source link

[Helm Deploy] YAMLException: duplicated mapping key when upgrade #13910

Closed marcmognol closed 3 years ago

marcmognol commented 3 years ago

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: HelmDeploy@0

list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

Issue Description

While deploying a helm chart within my AKS cluster, I have the following warning message. I think it is due to the output of Helm command which return an unnecessary "null" text.

`

`

image

Task logs

`

2020-11-17T15:48:43.7701360Z ##[section]Starting: Helm install 2020-11-17T15:48:43.7712088Z ============================================================================== 2020-11-17T15:48:43.7713139Z Task : Package and deploy Helm charts 2020-11-17T15:48:43.7713906Z Description : Deploy, configure, update a Kubernetes cluster in Azure Container Service by running helm commands 2020-11-17T15:48:43.7714303Z Version : 0.177.0 2020-11-17T15:48:43.7715325Z Author : Microsoft Corporation 2020-11-17T15:48:43.7715621Z Help : https://aka.ms/azpipes-helm-tsg 2020-11-17T15:48:43.7716685Z ============================================================================== 2020-11-17T15:48:44.7342474Z [command]/usr/local/bin/helm upgrade --install --values /home/vsts/work/1/chart-values/staging-values.yaml --wait api-staging /home/vsts/work/1/helm-chart/api-0.2.0.tgz 2020-11-17T15:48:49.4929724Z Release "api-staging" has been upgraded. Happy Helming! 2020-11-17T15:48:49.4944536Z NAME: api-staging 2020-11-17T15:48:49.4959152Z LAST DEPLOYED: Tue Nov 17 15:48:46 2020 2020-11-17T15:48:49.4959459Z NAMESPACE: default 2020-11-17T15:48:49.4959692Z STATUS: deployed 2020-11-17T15:48:49.4959894Z REVISION: 12 2020-11-17T15:48:49.4960115Z TEST SUITE: None 2020-11-17T15:48:49.7732045Z ##[warning]Capturing deployment metadata failed with error: YAMLException: duplicated mapping key at line 94, column 17: null ^ 2020-11-17T15:48:49.7747336Z ##[section]Finishing: Helm install `

shigupt202 commented 3 years ago

@Heisenberg74 You can ignore the warning. This is something that the task is doing to collect metadata which will be used for better customer experience eventually.

marcmognol commented 3 years ago

Hi @shigupt202 ,

Thank you for your answer but it is something disturbing while checking our pipelines status.

Orange lines are something we don't want to see đŸ˜€

Do you think this issue can be solved ? Or at least, can we disable metadata collect ?

Thanks

shigupt202 commented 3 years ago

I'll discuss this within the team. @anraghun @ds-ms Can we introduce a boolean field to disable the metadata collection step?

thesattiraju commented 3 years ago

There's already a boolean at the project level for disabling this; don't you think that should suffice?

shigupt202 commented 3 years ago

I'm not sure if that controls this part of the code. I'll explore that option.

marcmognol commented 3 years ago

There's already a boolean at the project level for disabling this; don't you think that should suffice?

Hi,

Could you tell me where is this setting ?

Thank you

shigupt202 commented 3 years ago

The setting is present in Project Settings > Pipelines > Settings > Publish metadata from pipelines.

marcmognol commented 3 years ago

The setting is present in Project Settings > Pipelines > Settings > Publish metadata from pipelines.

Thanks

wasfree commented 3 years ago

Hi, since we have updated to latest helm task version we get similar issue, see below:

2020-11-24T11:34:37.5610968Z ##[warning]Capturing deployment metadata failed with error: YAMLException: duplicated mapping key at line 95, column 34:
              imagePullPolicy: Always
                                      ^

As mentioned before this could be prevented by disabling Publish metadata from pipelines. But it's already disabled and we still see this warning. ados

marcmognol commented 3 years ago

Ok, so we should wait for a fix.

Wittionary commented 1 year ago

I'm still getting this warning even with the toggle disabled. image

Using Helm Deploy version 0.214.0

Warning:

##[warning]Capturing deployment metadata failed with error: YAMLException: duplicated mapping key at line 257, column -58:
            securityContext:
            ^
keerthipriya54321 commented 1 year ago

Previously this used to be as a warning message. But, now it turned into ##[Error]Capturing deployment metadata failed with error: YAMLException: Do anyone have idea why it turned into error from warning.

miqm commented 1 year ago

seems related to #18846