Closed jochenehret closed 1 month ago
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/175814843
The labels on this github issue will be updated when the story is started.
Hello, I can reproduce this issue in the CLI version: 7.2.0+be4a5ce2b.2020-12-10 Is there any workaround? Of course besides changing the braces? I wonder why values of environment variables are treated as templates at the cf env command at all? Obviously, the cf push, cf set-env commands are NOT treating it as templates...
Same issue occurs with CLI v8.0.0 + with the following env variable:
env:
SOME-ENV: "{{\"my-json\":\"value\"}}"
Same here:
Command
cf env my_app_example
CLI Version
8.5.0+73aa161.2022-09-12
Error
template: Display Text:1: function "DmPd" not defined
Stack Trace
goroutine 1 [running]:
code.cloudfoundry.org/cli/util/panichandler.HandlePanic()
/Users/runner/work/cli/cli/util/panichandler/handler.go:19 +0x4c
panic({0x1011da520, 0x14000190ce0})
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/runtime/panic.go:838 +0x204
text/template.Must(...)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/text/template/helper.go:25
code.cloudfoundry.org/cli/util/ui.generateTranslationFunc.func1({0x140001c3950, 0x2f}, {0x14000379f90, 0x1, 0x140001945b0?})
/Users/runner/work/cli/cli/util/ui/i18n.go:119 +0x2bc
code.cloudfoundry.org/cli/util/ui.(*UI).TranslateText(...)
/Users/runner/work/cli/cli/util/ui/ui.go:409
code.cloudfoundry.org/cli/util/ui.(*UI).DisplayText(0x140001e02c0, {0x140001c3950, 0x2f}, {0x0?, 0x2?, 0xe?})
/Users/runner/work/cli/cli/util/ui/ui.go:248 +0x15c
code.cloudfoundry.org/cli/command/v7.EnvCommand.displayEnvGroup({{{0x1013ae4c8, 0x140001e02c0}, {0x1013af140, 0x140003bce00}, {0x1013a6d58, 0x14000089140}, {0x1013b1580, 0x1400044c9a0}, 0x14000458000, 0x1400058c5a0}, ...}, ...)
/Users/runner/work/cli/cli/command/v7/env_command.go:96 +0x138
code.cloudfoundry.org/cli/command/v7.EnvCommand.Execute({{{0x1013ae4c8, 0x140001e02c0}, {0x1013af140, 0x140003bce00}, {0x1013a6d58, 0x14000089140}, {0x1013b1580, 0x1400044c9a0}, 0x14000458000, 0x1400058c5a0}, ...}, ...)
/Users/runner/work/cli/cli/command/v7/env_command.go:67 +0x658
code.cloudfoundry.org/cli/util/command_parser.(*CommandParser).executionWrapper(0x140001912d0, {0x1020ae658, 0x101b05150}, {0x14000089120, 0x0, 0x2})
/Users/runner/work/cli/cli/util/command_parser/command_parser.go:93 +0x22c
github.com/jessevdk/go-flags.(*Parser).ParseArgs(0x140000cdc70, {0x14000192190, 0x2, 0x2})
/Users/runner/go/pkg/mod/github.com/jessevdk/go-flags@v1.4.1-0.20181221193153-c0795c8afcf4/parser.go:331 +0x704
code.cloudfoundry.org/cli/util/command_parser.(*CommandParser).parse(0x140001912d0, {0x14000192190?, 0x2, 0x2}, {0x1012056a0, 0x101b02760})
/Users/runner/work/cli/cli/util/command_parser/command_parser.go:224 +0xd0
code.cloudfoundry.org/cli/util/command_parser.(*CommandParser).ParseCommandFromArgs(...)
/Users/runner/work/cli/cli/util/command_parser/command_parser.go:57
main.main()
/Users/runner/work/cli/cli/main.go:41 +0x284
goroutine 18 [chan receive]:
k8s.io/klog/v2.(*loggingT).flushDaemon(0x0?)
/Users/runner/go/pkg/mod/k8s.io/klog/v2@v2.9.0/klog.go:1169 +0x60
created by k8s.io/klog/v2.init.0
/Users/runner/go/pkg/mod/k8s.io/klog/v2@v2.9.0/klog.go:420 +0x154
goroutine 665 [select]:
net/http.(*persistConn).writeLoop(0x14000000240)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/http/transport.go:2392 +0xa4
created by net/http.(*Transport).dialConn
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/http/transport.go:1751 +0x1240
goroutine 664 [IO wait]:
internal/poll.runtime_pollWait(0x1020c8e38, 0x72)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/runtime/netpoll.go:302 +0xa4
internal/poll.(*pollDesc).wait(0x140003cd300?, 0x14000462000?, 0x0)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/internal/poll/fd_poll_runtime.go:83 +0x2c
internal/poll.(*pollDesc).waitRead(...)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0x140003cd300, {0x14000462000, 0x7d38, 0x7d38})
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/internal/poll/fd_unix.go:167 +0x1e4
net.(*netFD).Read(0x140003cd300, {0x14000462000?, 0x14000480005?, 0x0?})
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/fd_posix.go:55 +0x2c
net.(*conn).Read(0x14000112068, {0x14000462000?, 0x140004f57c8?, 0x1004d8028?})
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/net.go:183 +0x38
crypto/tls.(*atLeastReader).Read(0x1400000c5a0, {0x14000462000?, 0x0?, 0x1004ce018?})
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/crypto/tls/conn.go:785 +0x44
bytes.(*Buffer).ReadFrom(0x140003bd778, {0x101396378, 0x1400000c5a0})
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/bytes/buffer.go:204 +0x94
crypto/tls.(*Conn).readFromUntil(0x140003bd500, {0x128f6e4d8?, 0x14000112068}, 0xa00000000003771?)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/crypto/tls/conn.go:807 +0xd8
crypto/tls.(*Conn).readRecordOrCCS(0x140003bd500, 0x0)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/crypto/tls/conn.go:614 +0xdc
crypto/tls.(*Conn).readRecord(...)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/crypto/tls/conn.go:582
crypto/tls.(*Conn).Read(0x140003bd500, {0x1400001a000, 0x1000, 0x0?})
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/crypto/tls/conn.go:1285 +0x180
net/http.(*persistConn).Read(0x14000000240, {0x1400001a000?, 0x1004c9060?, 0x1400053a240?})
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/http/transport.go:1929 +0x54
bufio.(*Reader).fill(0x140001a91a0)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/bufio/bufio.go:106 +0x100
bufio.(*Reader).Peek(0x140001a91a0, 0x1)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/bufio/bufio.go:144 +0x64
net/http.(*persistConn).readLoop(0x14000000240)
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/http/transport.go:2093 +0x148
created by net/http.(*Transport).dialConn
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/http/transport.go:1750 +0x11f4
goroutine 361 [chan receive]:
code.cloudfoundry.org/cli/util/configv3.catchSignal(0x0?, {0x1400011e1b0, 0x2b})
/Users/runner/work/cli/cli/util/configv3/write_config.go:64 +0x2c
created by code.cloudfoundry.org/cli/util/configv3.(*Config).WriteConfig
/Users/runner/work/cli/cli/util/configv3/write_config.go:41 +0x214
goroutine 360 [syscall]:
os/signal.signal_recv()
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/runtime/sigqueue.go:148 +0x30
os/signal.loop()
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/os/signal/signal_unix.go:23 +0x20
created by os/signal.Notify.func1.1
/Users/runner/hostedtoolcache/go/1.18.5/x64/src/os/signal/signal.go:151 +0x30
Your Platform Details
e.g. Mac OS X 10.11, Windows 8.1 64-bit, Ubuntu 14.04.3 64-bit
Shell
e.g. Terminal, iTerm, Powershell, Cygwin, gnome-terminal, terminator
Any info on this one? I will gladly pick it up when I find time if needed
Is this issue is going to be addressed? It happens also in our scenario see here: https://github.com/cloudfoundry/cli/issues/2381 in version 8.5.0. Is there a roadmap when it will be fixed?
CF_TRACE=1
to help debug the issue.Describe the bug and the command you saw an issue with We've run
cf7 env <appname>
and the command paniced with:Calling
cf6 env <appname>
worked. The problematic environment variable seems to be this one:The
app_router_url
is interpreted as function call by the GoLang template package. As it is nowhere defined, this call panics: https://github.com/cloudfoundry/cli/blob/b823ae53f394acf64ad7fb09f550c508a3c46e0a/util/ui/i18n.go#L119What happened (see description)
Expected behavior We expected the application's environment variables to be printed.
Exact Steps To Reproduce With CF CLI v7.1.0,
Provide more context Platform:
CF CLI versions: cf7 version 7.1.0+4c3168f9a.2020-09-09 (doesn't work) cf6 version 6.53.0+8e2b70a4a.2020-10-01 (works)
capi-release: 1.98.0
Notes regarding V6 and V7 CLI support: