cli icon indicating copy to clipboard operation
cli copied to clipboard

Unexpected error in CF CLI v8

Open IvanBorislavovDimitrov opened this issue 3 years ago • 1 comments

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

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

Describe the bug and the command you saw an issue with Executing: "cf curl v3/service_offerings" This results in a "panic" in the cf cli. Check stacktrace at the end. The strangest thing is the when I enable debbuing "export CF_TRACE=1", the command is successful. Response content size is: 155.27KB, time 2.48s (via curl)

What happened Unhandled exception in CF CLI

Expected behavior Not failing, should return the correct response from "cf curl"

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

  1. Run cf curl v3/service_offerings ` 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 curl v3/service_offerings
    
     CLI Version
     8.5.0+73aa161.2022-09-12
    
     Error
     template: Display Text:1: function "app_router_url" 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({0x10598a520, 0x1400069a0c0}) /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({0x140008f2000, 0x26a39}, {0x1400069a010, 0x1, 0x0?}) /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(0x14000420000, {0x140008f2000, 0x26a39}, {0x0?, 0x1400075f858?, 0x0?}) /Users/runner/work/cli/cli/util/ui/ui.go:248 +0x15c code.cloudfoundry.org/cli/command/v7.CurlCommand.Execute({{{0x105b5e4c8, 0x14000420000}, {0x105b5f140, 0x1400041aa80}, {0x105b56d58, 0x140003d73e0}, {0x105b61580, 0x1400052c230}, 0x14000530000, 0x1400013ad80}, ...}, ...) /Users/runner/work/cli/cli/command/v7/curl_command.go:58 +0x210 code.cloudfoundry.org/cli/util/command_parser.(*CommandParser).executionWrapper(0x14000719f80, {0x10d746a38, 0x1062b4158}, {0x140003d73c0, 0x0, 0x2}) /Users/runner/work/cli/cli/util/command_parser/command_parser.go:93 +0x22c github.com/jessevdk/go-flags.(*Parser).ParseArgs(0x14000013570, {0x1400003a070, 0x2, 0x2}) /Users/runner/go/pkg/mod/github.com/jessevdk/[email protected]/parser.go:331 +0x704 code.cloudfoundry.org/cli/util/command_parser.(*CommandParser).parse(0x14000719f80, {0x1400003a070?, 0x2, 0x2}, {0x1059b56a0, 0x1062b2760}) /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 6 [chan receive]: k8s.io/klog/v2.(*loggingT).flushDaemon(0x0?) /Users/runner/go/pkg/mod/k8s.io/klog/[email protected]/klog.go:1169 +0x60 created by k8s.io/klog/v2.init.0 /Users/runner/go/pkg/mod/k8s.io/klog/[email protected]/klog.go:420 +0x154

    goroutine 647 [IO wait]: internal/poll.runtime_pollWait(0x10d548f28, 0x72) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/runtime/netpoll.go:302 +0xa4 internal/poll.(*pollDesc).wait(0x14000760300?, 0x14000550000?, 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(0x14000760300, {0x14000550000, 0xa00c, 0xa00c}) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/internal/poll/fd_unix.go:167 +0x1e4 net.(*netFD).Read(0x14000760300, {0x14000550000?, 0x14000390005?, 0x104d80b06?}) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/fd_posix.go:55 +0x2c net.(*conn).Read(0x14000306020, {0x14000550000?, 0x1068705b8?, 0x6?}) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/net.go:183 +0x38 crypto/tls.(*atLeastReader).Read(0x14000302180, {0x14000550000?, 0x0?, 0x104c7e018?}) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/crypto/tls/conn.go:785 +0x44 bytes.(*Buffer).ReadFrom(0x1400018c278, {0x105b46378, 0x14000302180}) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/bytes/buffer.go:204 +0x94 crypto/tls.(*Conn).readFromUntil(0x1400018c000, {0x10d6088d8?, 0x14000306020}, 0xa000000000000e1?) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/crypto/tls/conn.go:807 +0xd8 crypto/tls.(*Conn).readRecordOrCCS(0x1400018c000, 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(0x1400018c000, {0x1400053c000, 0x1000, 0x140001afbb0?}) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/crypto/tls/conn.go:1285 +0x180 net/http.(*persistConn).Read(0x140003ddc20, {0x1400053c000?, 0x104c79060?, 0x140003f03c0?}) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/net/http/transport.go:1929 +0x54 bufio.(*Reader).fill(0x1400068c4e0) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/bufio/bufio.go:106 +0x100 bufio.(*Reader).Peek(0x1400068c4e0, 0x1) /Users/runner/hostedtoolcache/go/1.18.5/x64/src/bufio/bufio.go:144 +0x64 net/http.(*persistConn).readLoop(0x140003ddc20) /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 649 [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

    goroutine 633 [chan receive]: code.cloudfoundry.org/cli/util/configv3.catchSignal(0x0?, {0x140001a6060, 0x27}) /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 648 [select]: net/http.(*persistConn).writeLoop(0x140003ddc20) /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

     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**
    

`

Provide more context

  • platform and shell details: MacOS Monterey 12.6
  • version of the CLI you are running: cf version 8.5.0+73aa161.2022-09-12
  • version of the CC API Release you are on: API endpoint: https://api.cf.sap.hana.ondemand.com API version: 3.124.0

Notes regarding V6 and V7 CLI support:

  • V6:
    • Minimum supported version of CF Deployment: v7.0.0 (CAPI Release: 1.74.0 (APIs 2.128.0 and 3.63.0))
    • Maximum supported version of CF Deployment: v13.4.0 (CAPI Release: 1.94.0 (APIs 2.149.0 and 3.84.0))
  • V7:
    • Minimum supported version of CF Deployment: v13.5.0 (CAPI Release: 1.95.0 (APIs 2.150.0 and 3.85.0))

IvanBorislavovDimitrov avatar Oct 24 '22 11:10 IvanBorislavovDimitrov

👋 @IvanBorislavovDimitrov. V6 is now out of support. As for V7 and V8, I tried locally but could not reproduce your issue on the latest cf-deployment. Can you please tell us a bit more about https://api.cf.sap.hana.ondemand.com/ ?

$ cf8 curl v3/service_offerings -v

REQUEST: [2023-04-11T09:55:06-07:00]
GET /v3/service_offerings HTTP/1.1
Host: api.redcola.cf-app.com
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: cf8/8.6.1+b5a352a.2023-02-27 (go1.19.6; amd64 darwin)

RESPONSE: [2023-04-11T09:55:06-07:00]
HTTP/1.1 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Content-Type: application/json; charset=utf-8
Date: Tue, 11 Apr 2023 16:55:06 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: nginx
Vary: Accept
Via: 1.1 google
X-B3-Spanid: 7e5ea0680f2ace69
X-B3-Traceid: 7fc5789aadd2ea0d7e5ea0680f2ace69
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Runtime: 0.004661
X-Vcap-Request-Id: 80935f5d-50fd-4444-7767-b8b8307e4720::5d170b79-7de9-48a3-85ac-7ae2b88b9378
X-Xss-Protection: 1; mode=block
{
  "pagination": {
    "first": {
      "href": "https://api.redcola.cf-app.com/v3/service_offerings?page=1&per_page=50"
    },
    "last": {
      "href": "https://api.redcola.cf-app.com/v3/service_offerings?page=1&per_page=50"
    },
    "next": null,
    "previous": null,
    "total_pages": 1,
    "total_results": 0
  },
  "resources": []
}
$ cf7 curl v3/service_offerings -v 

REQUEST: [2023-04-11T09:55:10-07:00]
GET /v3/service_offerings HTTP/1.1
Host: api.redcola.cf-app.com
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: go-cli 7.6.0+d1110f2.2023-02-27 / darwin


RESPONSE: [2023-04-11T09:55:10-07:00]
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Content-Type: application/json; charset=utf-8
Date: Tue, 11 Apr 2023 16:55:10 GMT
Referrer-Policy: strict-origin-when-cross-origin
Server: nginx
Vary: Accept
Via: 1.1 google
X-B3-Spanid: 34a8c6b99002e586
X-B3-Traceid: 5d965c1180cd164634a8c6b99002e586
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Runtime: 0.005611
X-Vcap-Request-Id: b5b7f9c0-5550-490c-6faa-b9747727738c::e2fd75e8-d095-462a-b80d-97530265b5cb
X-Xss-Protection: 1; mode=block

11a
{"pagination":{"total_results":0,"total_pages":1,"first":{"href":"https://api.redcola.cf-app.com/v3/service_offerings?page=1\u0026per_page=50"},"last":{"href":"https://api.redcola.cf-app.com/v3/service_offerings?page=1\u0026per_page=50"},"next":null,"previous":null},"resources":[]}
0

a-b avatar Apr 11 '23 16:04 a-b