Repository: cloudfoundry/cli

Issue #1050: Push fails when simultaneously scaling app
Created: 2017-01-05T20:26:20Z
We are bad people and were doing this:
First: cf push dora
Shell 1: while true; do cf scale dora -i 2 && cf scale dora -i 1; done
Shell 2: cf push dora
Here is the output from the CLI:
		Command
		cf push dora

		CLI Version
		6.23.0+c7866be18

		Error
		runtime error: index out of range

		Stack Trace
			goroutine 1 [running]:
	code.cloudfoundry.org/cli/util/panichandler.HandlePanic()
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/util/panichandler/handler.go:19 +0xb5
	panic(0x77a340, 0xc420010130)
		/usr/local/Cellar/go/1.7.4/libexec/src/runtime/panic.go:458 +0x243
	code.cloudfoundry.org/cli/cf/api/appinstances.CloudControllerAppInstancesRepository.updateInstancesWithStats(0x1a53e38, 0xc420734a80, 0x1a54140, 0xc4200a64d0, 0x8f61f0, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, ...)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/api/appinstances/app_instances.go:103 +0x596
	code.cloudfoundry.org/cli/cf/api/appinstances.CloudControllerAppInstancesRepository.GetInstances(0x1a53e38, 0xc420734a80, 0x1a54140, 0xc4200a64d0, 0x8f61f0, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, ...)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/api/appinstances/app_instances.go:77 +0x43e
	code.cloudfoundry.org/cli/cf/api/appinstances.(*CloudControllerAppInstancesRepository).GetInstances(0xc4201765a0, 0xc4205b5260, 0x24, 0x0, 0xc4205e48d0, 0x8f3bdf, 0xc41fff1cc7, 0x0)
		<autogenerated>:1 +0x9e
	code.cloudfoundry.org/cli/cf/commands/application.Start.fetchInstanceCount(0xc387c0, 0xc420734a40, 0x1a53e38, 0xc420734a80, 0x1ac41d8, 0xc420108070, 0x0, 0x0, 0xc372e0, 0xc420176460, ...)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/commands/application/start.go:409 +0xf1
	code.cloudfoundry.org/cli/cf/commands/application.(*Start).waitForOneRunningInstance(0xc4202b0d80, 0xc4205b5260, 0x24, 0xc4203f89f0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/commands/application/start.go:371 +0xc5
	code.cloudfoundry.org/cli/cf/commands/application.(*Start).WatchStaging(0xc4202b0d80, 0xc4205b9230, 0x24, 0xc42045ef00, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/commands/application/start.go:194 +0x36d
	code.cloudfoundry.org/cli/cf/commands/application.(*Start).ApplicationStart(0xc4202b0d80, 0xc4205b9230, 0x24, 0xc42045ef00, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/commands/application/start.go:157 +0x15e
	code.cloudfoundry.org/cli/cf/commands/application.(*Push).restart(0xc4205a67e0, 0xc4205b9230, 0x24, 0xc42045ef00, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/commands/application/push.go:564 +0x3cb
	code.cloudfoundry.org/cli/cf/commands/application.(*Push).Execute(0xc4205a67e0, 0xc38fa0, 0xc4205a3500, 0xc38fa0, 0xc4205a3500)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/commands/application/push.go:301 +0x108a
	code.cloudfoundry.org/cli/cf/cmd.Main(0x0, 0x0, 0xc420086090, 0x3, 0x3)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/cmd/cmd.go:121 +0xd02
	code.cloudfoundry.org/cli/command/v2.PushCommand.Execute(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/command/v2/push_command.go:42 +0x76
	code.cloudfoundry.org/cli/command/v2.(*PushCommand).Execute(0xd22f28, 0xc4202d7a40, 0x1, 0x2, 0xc420734940, 0x0)
		<autogenerated>:158 +0xb1
	main.executionWrapper(0x1a8a450, 0xd22f28, 0xc4202d7a40, 0x1, 0x2, 0x0, 0x0)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/main.go:155 +0x254
	code.cloudfoundry.org/cli/vendor/github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc420015ce0, 0xc4200860a0, 0x2, 0x2, 0x90, 0xa0, 0xc4200b3400, 0x0, 0xd1e540)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/vendor/github.com/jessevdk/go-flags/parser.go:313 +0x89f
	main.parse(0xc4200860a0, 0x2, 0x2)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/main.go:35 +0xba
	main.main()
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/main.go:29 +0x86

	goroutine 17 [syscall, locked to thread]:
	runtime.goexit()
		/usr/local/Cellar/go/1.7.4/libexec/src/runtime/asm_amd64.s:2086 +0x1

	goroutine 19 [syscall]:
	os/signal.signal_recv(0x0)
		/usr/local/Cellar/go/1.7.4/libexec/src/runtime/sigqueue.go:116 +0x157
	os/signal.loop()
		/usr/local/Cellar/go/1.7.4/libexec/src/os/signal/signal_unix.go:22 +0x22
	created by os/signal.init.1
		/usr/local/Cellar/go/1.7.4/libexec/src/os/signal/signal_unix.go:28 +0x41

	goroutine 1351 [chan receive]:
	code.cloudfoundry.org/cli/cf/api/logs.(*NoaaLogsRepository).TailLogsFor.func3(0xc42013ebc0, 0xc4204cc050, 0xc4202ab200)
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/api/logs/noaa_logs_repository.go:117 +0x67
	created by code.cloudfoundry.org/cli/cf/api/logs.(*NoaaLogsRepository).TailLogsFor
		/Users/worker/concourse/containers/00000trljtg/tmp/build/254d4083/gopath/src/code.cloudfoundry.org/cli/cf/api/logs/noaa_logs_repository.go:120 +0x2ec


		Your Platform Details
		e.g. Mac OS X 10.11.6 (15G1108)

		Shell
		e.g. iTerm

Duplicate issue #1093: Bug in cf-cli: " Something unexpected happened."
Created: 2017-03-14T06:53:00Z
Command
cf app app-name
What occurred
Stack Trace
goroutine 1 [running]:
code.cloudfoundry.org/cli/utils/panichandler.generateBacktrace(0xc042044180, 0x3)
/tmp/build/80754af9/gopath/src/code.cloudfoundry.org/cli/utils/panichandler/handler.go:68 +0xa4
code.cloudfoundry.org/cli/utils/panichandler.HandlePanic()
/tmp/build/80754af9/gopath/src/code.cloudfoundry.org/cli/utils/panichandler/handler.go:54 +0x33a
panic(0xb7bf20, 0xc042004070)
/usr/local/go/src/runtime/panic.go:458 +0x251
code.cloudfoundry.org/cli/cf/api/appinstances.CloudControllerAppInstancesRepository.updateInstancesWithStats(0x3db4eb0, 0xc0421391d0, 0x3db5170, 0xc0420751e0, 0xcf5238, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, ...)
/tmp/build/80754af9/gopath/src/code.cloudfoundry.org/cli/cf/api/appinstances/app_instances.go:103 +0x59d
code.cloudfoundry.org/cli/cf/api/appinstances.CloudControllerAppInstancesRepository.GetInstances(0x3db4eb0, 0xc0421391d0, 0x3db5170, 0xc0420751e0, 0xcf5238, 0x1, 0x12a05f200, 0x0, 0x0, 0x0, ...)
/tmp/build/80754af9/gopath/src/code.cloudfoundry.org/cli/cf/api/appinstances/ap
What you expected to occur
I created a while true loop with the above command to be executed. Then i got this problem.
CLI Version
6.22.2+a95e24c
CC API Endpoint Version
API version: 2.74.0
CF Trace

Platform & Shell Details
Windows 8.1 64-bit

Closing comment (2017-03-14T23:00:17Z): This looks like the same issue reported in #1050. We have a fix in our code, will be part of our upcoming release.