cli icon indicating copy to clipboard operation
cli copied to clipboard

"index out of range" error while logging to Predix with CLI

Open AnandChapekar opened this issue 10 years ago • 6 comments

I am developing HellowWorld app for Predix as per link https://www.predix.io/resources/tutorials/tutorial-details.html?tutorial_id=1569&tag=1719&journey=Hello%20World&resources=1475,1569,1523

The command prompt in/out on my Windows 7 Professional SP1 64-bit laptop as below.

Please check. Thx, Anand

E:\GE-Predix\HelloWorld\predix-nodejs-starter>set CF_TRACE=true E:\GE-Predix\HelloWorld\predix-nodejs-starter>cf login -a API Endpoint API endpoint: API

REQUEST: [2016-06-19T20:47:11+05:30] GET /v2/info HTTP/1.1 Host: API Accept: application/json Content-Type: application/json User-Agent: go-cli 6.19.0+b29b4e0 / windows

REQUEST: [2016-06-19T20:47:17+05:30] GET /v2/info HTTP/1.1 Host: API Accept: application/json Content-Type: application/json User-Agent: go-cli 6.19.0+b29b4e0 / windows

    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://github.com/cloudfoundry/cli/releases

    Please create an issue at: https://github.com/cloudfoundry/cli/issues

    Include the below information when creating the issue:

            Command
            cf login -a API Endpoint

            CLI Version
            6.19.0+b29b4e0

            Error
            runtime error: index out of range

            Stack Trace
                    goroutine 1 [running]:
    main.generateBacktrace(0x0, 0x0)
   /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/main/main.go:189 +0xa0
    main.handlePanics(0x3342aa20, 0x11d39180, 0x3342a9f8, 0x11d17260)
            /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/main/main.go:173 +0x198
    panic(0xb15440, 0x1195c008)
            /usr/local/go/src/runtime/panic.go:443 +0x3fd
    github.com/cloudfoundry/cli/cf/net.getBaseDomain(0x11d15160, 0x12, 0x0, 0x0)
            /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/http_client.go:106 +0x101
    github.com/cloudfoundry/cli/cf/net.(*client).checkRedirect(0x119836b0, 0x11cfa0e0, 0x11c9a028, 0x1, 0x2, 0x0, 0x0)
            /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/http_client.go:53 +0x196
    github.com/cloudfoundry/cli/cf/net.(*client).(github.com/cloudfoundry/cli/cf/net.checkRedirect)-fm(0x11cfa0e0, 0x11c9a028, 0x1, 0x2, 0x0, 0x0)
            /tmp/build/80754af9/gopath/src/github.com/cloudfoundry/cli/cf/net/http_client.go:38 +0x4c
    net/http.(*Client).doFollowingRedirects(0x11d316c

Platform Details

Windows 7 Professional SP1 64-bit

Shell

Windows Command Prompt

AnandChapekar avatar Jun 19 '16 15:06 AnandChapekar

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

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

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

cf-gitbot avatar Jun 19 '16 15:06 cf-gitbot

Hi @AnandChapekar,

Did you actually type cf login -a API Endpoint or did you type a proper url for "API Endpoint"? If you did type a proper url, can you show what it looks like? (okay to obfuscate if you don't want it in public, but I'd like to know whether it start with api. and how many levels deep the domain is).

Cheers, Dies Koper CF CLI PM

dkoper avatar Jun 20 '16 02:06 dkoper

Hi Dies,

Thanks much for quick revert and apologies for my ignorance.

I used "API Endpoint" as VERBATIM command line input.

Please suggest if following default URL can be used for all Beta apps: https://api.system.aws-usw02-pr.ice.predix.io

Also please see if the user message for incorrect API endpoint can be more intuitive instead of cryptic "index out of range".

Hoping not to trouble you with more beginner issues..

Regards, Anand On 20 Jun 2016 08:04, "Dies Koper" [email protected] wrote:

Hi @AnandChapekar https://github.com/AnandChapekar,

Did you actually type cf login -a API Endpoint or did you type a proper url for "API Endpoint"? If you did type a proper url, can you show what it looks like? (okay to obfuscate if you don't want it in public, but I'd like to know whether it start with api. and how many levels deep the domain is).

Cheers, Dies Koper CF CLI PM

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cloudfoundry/cli/issues/865#issuecomment-227038841, or mute the thread https://github.com/notifications/unsubscribe/ATArIavTMq0U7hKo1dEyqwgdvJeLpHFXks5qNfw2gaJpZM4I5MPj .

AnandChapekar avatar Jun 20 '16 10:06 AnandChapekar

Hi @AnandChapekar

Yes, I'd like to use this oppportunity to add some validation to that field. Thanks for bringing it up!

dkoper avatar Jun 20 '16 21:06 dkoper

@AnandChapekar We could not reproduce this panic on windows using v6.19.0 of the CLI. Could you please provide the following additional information:

  • what is in your config.json file (this should be located in your .cf\config.json
  • any environment variables set for the CLI
  • what version of golang you have installed
  • also list any CLI commands that you ran prior to this panic (if any)
  • please include all lines of the stack trace (if not already there)

Also anything else you can think of related to this panic.

Thanks Difan and Nick

n4wei avatar Aug 08 '16 21:08 n4wei

Closing, as I believe the current output is good enough:

D:\Users\koperd\Downloads\bin>cf login -a API Endpoint
API endpoint: API

REQUEST: [2016-10-22T11:12:57+11:00]
GET /v2/info HTTP/1.1
Host: API
Accept: application/json
Connection: close
Content-Type: application/json
User-Agent: go-cli 6.22.1+b80ba27 / windows


FAILED
Error performing request: Get https://API/v2/info: Service Unavailable

dkoper avatar Oct 22 '16 00:10 dkoper