cloudfoundry / cli

The official command line client for Cloud Foundry
https://docs.cloudfoundry.org/cf-cli
Apache License 2.0
1.75k stars 929 forks source link

cf login issue with terminal #1891

Closed cah-sai-madaupu closed 1 month ago

cah-sai-madaupu commented 4 years ago

Please fill out the issue checklist below and provide ALL the requested information. When trying to do a cf login from terminal I get this error
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:

Describe the bug and the command you saw an issue with Provide details on what you were trying to do (and why).

Command cf login -a https://api.system.cf.np.gc.cahcloud.net --sso

    CLI Version
    6.49.0+d0dfa93bb.2020-01-07

    Error
    runtime error: invalid memory address or nil pointer dereference

Stack Trace goroutine 1 [running]: code.cloudfoundry.org/cli/util/panichandler.HandlePanic() /Users/pivotal/concourse/volumes/live/0f11c0a4-8615-4a2a-6b67-d6b283919f2c/volume/gopath/src/code.cloudfoundry.org/cli/util/panichandler/handler.go:19 +0x81 panic(0x1a7bf40, 0x24ff780) /usr/local/Cellar/go/1.13.4/libexec/src/runtime/panic.go:679 +0x1b2 code.cloudfoundry.org/cli/command/v6.(LoginCommand).determineAPIEndpoint(0x2529588, 0x203000, 0x203000, 0x61c06f0, 0x0, 0x8, 0x0) /Users/pivotal/concourse/volumes/live/0f11c0a4-8615-4a2a-6b67-d6b283919f2c/volume/gopath/src/code.cloudfoundry.org/cli/command/v6/login_command.go:283 +0x19b code.cloudfoundry.org/cli/command/v6.(LoginCommand).Execute(0x2529588, 0xc000589d40, 0x0, 0x2, 0x0, 0x0) /Users/pivotal/concourse/volumes/live/0f11c0a4-8615-4a2a-6b67-d6b283919f2c/volume/gopath/src/code.cloudfoundry.org/cli/command/v6/login_command.go:127 +0x88 main.executionWrapper(0x6300708, 0x2529588, 0xc000589d40, 0x0, 0x2, 0x0, 0x0) /Users/pivotal/concourse/volumes/live/0f11c0a4-8615-4a2a-6b67-d6b283919f2c/volume/gopath/src/code.cloudfoundry.org/cli/main.go:263 +0x26e code.cloudfoundry.org/cli/vendor/github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc0005fb960, 0xc0000c0190, 0x2, 0x2, 0x8, 0x10, 0xc0004242f0, 0x1b826a0, 0xc0000f5080) /Users/pivotal/concourse/volumes/live/0f11c0a4-8615-4a2a-6b67-d6b283919f2c/volume/gopath/src/code.cloudfoundry.org/cli/vendor/github.com/jessevdk/go-flags/parser.go:331 +0x89c main.parse(0xc0000c0190, 0x2, 0x2, 0x1a813e0, 0x2526be0, 0xc000523f50) /Users/pivotal/concourse/volumes/live/0f11c0a4-8615-4a2a-6b67-d6b283919f2c/volume/gopath/src/code.cloudfoundry.org/cli/main.go:61 +0xaa main.main() /Users/pivotal/concourse/volumes/live/0f11c0a4-8615-4a2a-6b67-d6b283919f2c/volume/gopath/src/code.cloudfoundry.org/cli/main.go:49 +0xae

goroutine 19 [syscall]:
os/signal.signal_recv(0x0)
    /usr/local/Cellar/go/1.13.4/libexec/src/runtime/sigqueue.go:144 +0x96
os/signal.loop()
    /usr/local/Cellar/go/1.13.4/libexec/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
    /usr/local/Cellar/go/1.13.4/libexec/src/os/signal/signal_unix.go:29 +0x41

goroutine 640 [chan receive]:
code.cloudfoundry.org/cli/util/configv3.catchSignal(0xc000450180, 0xc000362000, 0x34)
    /Users/pivotal/concourse/volumes/live/0f11c0a4-8615-4a2a-6b67-d6b283919f2c/volume/gopath/src/code.cloudfoundry.org/cli/util/configv3/write_config.go:55 +0x34
created by code.cloudfoundry.org/cli/util/configv3.(*Config).WriteConfig
    /Users/pivotal/concourse/volumes/live/0f11c0a4-8615-4a2a-6b67-d6b283919f2c/volume/gopath/src/code.cloudfoundry.org/cli/util/configv3/write_config.go:40 +0x2c9

    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
    %                                                                            

What happened A clear and concise description of what happen. Unable to login.

Expected behavior A clear and concise description of what you expected to happen. I expect to see a request for me to put the sso token so that I get logged in via the CLI.

To Reproduce Steps to reproduce the behavior; include the exact CLI commands and verbose output: From a MacOS Catalina version 10.15.3 install CF CLI
Then do a cf login -a {URL} --sso

Provide more context

Note: As of January 2019, we no longer support API versions older than CF Release v284/CF Deployment v1.7.0 (CAPI Release: 1.46.0 (APIs 2.100.0 and 3.35.0).

Note: In order to complete the v7 beta cf CLI in a timely matter, we develop and test against the latest CAPI release candidate. When v7 cf CLI is generally available, we will start supporting official CC API releases again. image

cf-gitbot commented 4 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/171158146

The labels on this github issue will be updated when the story is started.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed.

a-b commented 1 month ago

Thank you for your submission. If you still run into this issue with the latest CLI v8, please open a new ticket.