Skip to content

Panic in askStaticSite function #5524

@antonioau

Description

@antonioau

Title: Panic in askStaticSite function
Description: I am experiencing a panic in the askStaticSite function of the Copilot CLI tool. The panic is occurring on line 540 of the svc_init.go file. I have tried debugging the function, but I am unable to identify the root cause of the problem.

Steps to reproduce:

Run the copilot init svc command.
Select the "Static site" option.
The panic will occur when the tool prompts you for the static site URL.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x105360c14]

goroutine 1 [running]:
github.com/aws/copilot-cli/internal/pkg/cli.(*initSvcOpts).askStaticSite(0x14000174200)
        /codebuild/output/src1991231604/src/internal/pkg/cli/svc_init.go:540 +0x284
github.com/aws/copilot-cli/internal/pkg/cli.(*initSvcOpts).askSvcDetails(0x14000174200?)
        /codebuild/output/src1991231604/src/internal/pkg/cli/svc_init.go:457 +0x64
github.com/aws/copilot-cli/internal/pkg/cli.(*initSvcOpts).Ask(0x14000174200)
        /codebuild/output/src1991231604/src/internal/pkg/cli/svc_init.go:369 +0x114
github.com/aws/copilot-cli/internal/pkg/cli.(*initOpts).loadWkld(0x14000164300)
        /codebuild/output/src1991231604/src/internal/pkg/cli/init.go:441 +0xc0
github.com/aws/copilot-cli/internal/pkg/cli.(*initOpts).Run(0x14000164300)
        /codebuild/output/src1991231604/src/internal/pkg/cli/init.go:384 +0x12c
github.com/aws/copilot-cli/internal/pkg/cli.BuildInitCmd.func1(0x0?, {0x0?, 0x0?, 0x0?})
        /codebuild/output/src1991231604/src/internal/pkg/cli/init.go:634 +0x110
github.com/aws/copilot-cli/internal/pkg/cli.BuildInitCmd.runCmdE.func2(0x14000172300?, {0x1400044aeb0?, 0x4?, 0x10539057b?})
        /codebuild/output/src1991231604/src/internal/pkg/cli/cli.go:72 +0x88
github.com/spf13/cobra.(*Command).execute(0x14000352600, {0x1400044ae70, 0x1, 0x1})
        /go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0x82c
github.com/spf13/cobra.(*Command).ExecuteC(0x14000352300)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
main.main()
        /codebuild/output/src1991231604/src/cmd/copilot/main.go:34 +0x24

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugIssues that are bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions