cloudfoundry / cloudfoundry/cli

Uncatched index error at runtime

Open
#3,661 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.9k
Forks
990
Avg merge
1d 7h
Merged PRs (30d)
8

Description

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.
    • I am not sure

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

I tried to get the url of a html5 app from the html5 repo using the cf cli command as pointed out in https://help.sap.com/docs/bas/developing-html5-application/run-your-deployed-html5-application?locale=en-US.

I have installed the plugin for html5 repo.

I executed the following:

cf html5-list -di <my-destination-service-name> -u

What happened
A clear and concise description of what happen.

I received the following cli output:

Getting list of HTML5 applications available via destinations in org <my-org-name> / space <my-space-name> as <my-acount-email>...
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
cf-html5-apps-repo-cli-plugin/commands.(*HTML5Command).GetHTML5Context(0x1657960, {{0xc000018180, 0x15}, {0xc00018c090, 0x15}, {0xc0001c0510, 0x24}, {0xc0000163e0, 0xc}, {0xc00001a570, ...}})
        go/src/cf-html5-apps-repo-cli-plugin/commands/html5_base_command.go:272 +0x176a
cf-html5-apps-repo-cli-plugin/commands.(*ListCommand).ListDestinationApps(0x1657960, {0x205a97eed, 0x1375aa1}, 0x1, {0x0, 0x0})
        go/src/cf-html5-apps-repo-cli-plugin/commands/html5_list_command.go:207 +0x3e5
cf-html5-apps-repo-cli-plugin/commands.(*ListCommand).Execute(0x1657960, {0xc0000921b0, 0x3, 0x3})
        go/src/cf-html5-apps-repo-cli-plugin/commands/html5_list_command.go:161 +0xd3b
main.(*HTML5Plugin).Run(0x1372128, {0x13fd370, 0xc000186190}, {0xc0000921a0, 0x4, 0x4})
        go/src/cf-html5-apps-repo-cli-plugin/html5_plugin.go:46 +0x23d
cf-html5-apps-repo-cli-plugin/vendor/github.com/cloudfoundry/cli/plugin.Start({0x13f22a8, 0x1688570})
        go/src/cf-html5-apps-repo-cli-plugin/vendor/github.com/cloudfoundry/cli/plugin/plugin_shim.go:30 +0x2d8
main.main()
        go/src/cf-html5-apps-repo-cli-plugin/html5_plugin.go:68 +0x27

Expected behavior
A clear and concise description of what you expected to happen.

an output and no go error.

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

see above

Provide more context

  • platform and shell details
    • macOS 15.7.2 iTerm
  • version of the CLI you are running
    • cf version 8.17.0+7ea11c1.2025-11-19
  • version of the CC API Release you are on
    • I don't know

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with commands/html5_base_command.go at line 272, then trace the call from commands/html5_list_command.go lines 161 and 207 for cf html5-list -di <my-destination-service-name> -u. Reproduce the command if possible and determine why the reported index access panics; done means the command returns output without a Go runtime error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.