Skip to content

runtime error: index out of range (warningServerTypeDeprecated) #5682

Description

@frivoire

Description:

The CLI is "buggy", at least for my instance, cf below:

How to reproduce:

scw instance server get bd7de168-a479-4793-aa99-ddc7609fe315

Expected Behavior

It should return the details of my instance, without error ;)

Actual Behavior

But it just returns an error:

runtime error: index out of range [0] with length 0
stacktrace from panic:
goroutine 1 [running]:
runtime/debug.Stack()
        /opt/hostedtoolcache/go/1.26.4/x64/src/runtime/debug/stack.go:26 +0x5e
main.cleanup(0xf041a33d600)
        /home/runner/work/scaleway-cli/scaleway-cli/cmd/scw/main.go:45 +0xc5
panic({0x2393ae0?, 0xf041a2e3d70?})
        /opt/hostedtoolcache/go/1.26.4/x64/src/runtime/panic.go:860 +0x13a
github.com/scaleway/scaleway-cli/v2/internal/namespaces/instance/v1.warningServerTypeDeprecated({0x21b0920?, 0xf041a6070a8?}, 0xf041a718570?, 0xf0419f9f4a0)
        /home/runner/work/scaleway-cli/scaleway-cli/internal/namespaces/instance/v1/helpers_types.go:70 +0x9d
github.com/scaleway/scaleway-cli/v2/internal/namespaces/instance/v1.serverGetBuilder.func2({0x2608868, 0xf041a251a70}, {0x1fa9de0?, 0xf041a783cc0?}, 0x0?)
        /home/runner/work/scaleway-cli/scaleway-cli/internal/namespaces/instance/v1/custom_server.go:573 +0x8db
github.com/scaleway/scaleway-cli/v2/core.run.CombineCommandInterceptor.func3.1({0x2608868?, 0xf041a251a70?}, {0x0?, 0xf041a298008?})
        /home/runner/work/scaleway-cli/scaleway-cli/core/command_interceptor.go:34 +0x2e
github.com/scaleway/scaleway-cli/v2/core.sdkStdTypeInterceptor({0x2608868, 0xf041a251a70}, {0x1fa9de0?, 0xf041a783cc0?}, 0x48c929?)
        /home/runner/work/scaleway-cli/scaleway-cli/core/command_interceptor.go:150 +0x2f
github.com/scaleway/scaleway-cli/v2/core.run.CombineCommandInterceptor.func3.1({0x2608868?, 0xf041a251a70?}, {0x5333ef?, 0xf041a718540?})
        /home/runner/work/scaleway-cli/scaleway-cli/core/command_interceptor.go:34 +0x2e
github.com/scaleway/scaleway-cli/v2/core.sdkStdErrorInterceptor({0x2608868?, 0xf041a251a70?}, {0x1fa9de0?, 0xf041a783cc0?}, 0x28?)
        /home/runner/work/scaleway-cli/scaleway-cli/core/command_interceptor.go:49 +0x46
github.com/scaleway/scaleway-cli/v2/core.run.CombineCommandInterceptor.func3({0x2608868, 0xf041a251a70}, {0x1fa9de0, 0xf041a783cc0}, 0xf041a7e32c0)
        /home/runner/work/scaleway-cli/scaleway-cli/core/command_interceptor.go:30 +0xb9
github.com/scaleway/scaleway-cli/v2/core.run.CombineCommandInterceptor.func3({0x2608868, 0xf041a251a70}, {0x1fa9de0, 0xf041a783cc0}, 0xf041a785530)
        /home/runner/work/scaleway-cli/scaleway-cli/core/command_interceptor.go:30 +0xb9
github.com/scaleway/scaleway-cli/v2/core.run({0x2608868, 0xf041a251a70}, 0xf041a156608, 0xf0419f05a20, {0xf041a783ca0, 0x2, 0x2})
        /home/runner/work/scaleway-cli/scaleway-cli/core/cobra_utils.go:213 +0x3c4
github.com/scaleway/scaleway-cli/v2/core.(*cobraBuilder).hydrateCobra.cobraRun.func3(0xf041a156608, {0xf041a784ff0, 0x1, 0x1})
        /home/runner/work/scaleway-cli/scaleway-cli/core/cobra_utils.go:131 +0x8b8
github.com/spf13/cobra.(*Command).execute(0xf041a156608, {0xf041a784fb0, 0x1, 0x1})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1015 +0xb14
github.com/spf13/cobra.(*Command).ExecuteC(0xf0419f96608)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x465
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1071
github.com/scaleway/scaleway-cli/v2/core.Bootstrap({0x2608830, 0x3abe2a0}, 0xf041a607e68)
        /home/runner/work/scaleway-cli/scaleway-cli/core/bootstrap.go:281 +0x126c
main.mainNoExit()
        /home/runner/work/scaleway-cli/scaleway-cli/cmd/scw/main.go:87 +0x3b2
main.main()
        /home/runner/work/scaleway-cli/scaleway-cli/cmd/scw/main.go:68 +0x13

runtime error: index out of range [0] with length 0%  

Version

Version          2.56.3
BuildDate        2026-06-09T10:18:17Z
GoVersion        go1.26.4
GitBranch        HEAD
GitCommit        94a66f7a
GoArch           amd64
GoOS             linux
UserAgentPrefix  scaleway-cli

(inside WSL)

Don't hesitate to ask if you need more info

Metadata

Metadata

Assignees

Labels

instanceInstance issues, bugs and feature requests

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions