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.

HelmDeploy@0 does not play well with values that have spaces

See original GitHub issue

Required Information

Type: Bug

Enter Task Name: HelmDeploy@0

Environment

  • Server - Azure Pipelines

    • If using Azure Pipelines, provide the account name, team project name, build definition name/build number: simp-cloud/SaaS/pipelineId=50/buildId=1788
  • Agent - Private:

    • OS of the machine running the agent and the agent version: Ubuntu 18.04, agent 2.160.0

Issue Description

If you have values with spaces that you need to set, it is already very complicated to get this to work with helm, you end up having to use double quotes with single quotes, or escape the string (see this - still open - issue on the Helm repo).

The problem gets worse on Azure DevOps because the Helm task is removing quotes from the arguments.

Task logs

Here is a stripped down, commented and redacted version of the logs. Note that the quotes are being stripped, even though they appear on the arguments.

##[debug]found: '/agent/_works/c47a627d22eb/_tool/helm/2.14.3/x64/linux-amd64/helm'
##[debug]/(stripped))/helm arg: upgrade
(stripped for brevity)
##[debug]/(stripped))/helm arg: '--set=foo.ConnectionStrings__DefaultConnection="***"'
                                                                                ^^^^^
                                                                                quotes
##[debug]exec tool: /agent/_works/c47a627d22eb/_tool/helm/2.14.3/x64/linux-amd64/helm
##[debug]arguments:
(stripped for brevity)
##[debug]   '--set=foo.ConnectionStrings__DefaultConnection=***'

                                                            ^^^
                                                          no quotes

I suggest you battle test this scenario, as I guess it is a common one. Also the connection string is a Sql Connection string, and the spaces come from Initial Catalog and Connect Timeout.

If you need more info I’m glad to help. Right now I’m moving to a bash script to work around this.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
giggiocommented, Nov 27, 2019

I didn’t, the variable is the same, I only switched from the helm task to the script task, and it worked, and that shows me that the problem exists. I’m fine using scripts, so to me that is ok, I reported to let Microsoft aware. The problem will happen to other users, for sure.

1reaction
shigupt202commented, Nov 26, 2019

To test this scenario, I executed a simple Helm upgrade command with arguments as: –set=my-key=“$(my-val)” I’ve set the variable my-val as my value. There is a space in the variable, but the build is still successful. Although the quotes are stripped in the log, but that doesn’t affect the execution of the command. spaces_in_set_command

Read more comments on GitHub >

github_iconTop Results From Across the Web

HelmDeploy@0 task does not resolve variables - Stack Overflow
I would like the pipelines to use different variables in the Helm deployments depending on the branch. However, I have the problem that...
Read more >
Argument list too long on helmdeploy0 - Visual Studio Feedback
Good afternoon,. we are seeing the error "Argument list too long" on post-job of Helm deploy, Verison 0 with a hosted machine.
Read more >
Microsoft-hosted agents for Azure Pipelines
If your pipelines are in Azure Pipelines, then you've got a convenient option to run your jobs using a Microsoft-hosted agent.
Read more >
How to visualize free disk space available in Azure - SquaredUp
However, this may not be sufficient if you need the data on the dashboard to update more frequently than every 30 minutes. Power...
Read more >
Spaces - Octopus Deploy 2019.1
Your browser can't play this video. ... Our goal with Spaces is to help teams organize their Octopus servers better and focus on...
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