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

{{ in App Environment Variable values break the cf env command #2821

Closed
4 tasks done
cweibel opened this issue Mar 20, 2024 · 2 comments · Fixed by #3012
Closed
4 tasks done

{{ in App Environment Variable values break the cf env command #2821

cweibel opened this issue Mar 20, 2024 · 2 comments · Fixed by #3012
Labels

Comments

@cweibel
Copy link

cweibel commented Mar 20, 2024

Please fill out the issue checklist below and provide ALL the requested information.

  • I reviewed open and closed github issues that may be related to my problem.
  • I tried updating to the latest version of the CF CLI to see if it fixed my problem.
  • I attempted to run the command with CF_TRACE=1 to help debug the issue.
  • I am reporting a bug that others will be able to reproduce.

Describe the bug and the command you saw an issue with
I am attempting to run cf env to pull back the environment variables for an app with environment variables.

What happened
A clear and concise description of what happen.
The CLI returns back:

...
User-Provided:
TEST2: blah[]

		Something unexpected happened. This is a bug in cf.

		Please re-run the command that caused this exception with the environment
		variable CF_TRACE set to true.

		Also, please update to the latest cli and try the command again:
		https://code.cloudfoundry.org/cli/releases

		Please create an issue at: https://code.cloudfoundry.org/cli/issues

		Include the below information when creating the issue:

		Command
		cf env icu2

		CLI Version
		7.7.9+984062b.2024-03-07

		Error
		template: Display Text:1: function "blah5" not defined

Expected behavior
What should have been returned was:

User-Provided:
TEST2: blah[]
TEST3: blah{{blah5
TEST4: blah

Exact Steps To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:

Create an app manifest for any app that contains these three environment variables:

applications:
- name: icu2
  memory: 256M
  stack: cflinuxfs4
  buildpacks:
  - https://github.com/cloudfoundry/apt-buildpack/
  - https://github.com/cloudfoundry/ruby-buildpack/
  env:
    TEST2: blah[]
    TEST3: blah{{blah5
    TEST4: blah

cf push icu2
cf env icu2

Provide more context

  • MacOS, iTerm2 3.4.19
  • CF CLI 7.7.9+984062b.2024-03-07
  • CF API 3.160.0
@cweibel
Copy link
Author

cweibel commented Mar 20, 2024

This was found because a credhub password was generated with two { in it, I swear I wasn't trying to break this on purpose 😄

@gururajsh gururajsh added bug and removed bug labels Jun 20, 2024
@gururajsh
Copy link
Member

Thank you for reporting this :). I have created an entry in our tracker to look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants