upbound / up

The @upbound CLI
Apache License 2.0
52 stars 41 forks source link

Crossplane Language Server crashing with platform-ref-gcp #269

Open AaronME opened 1 year ago

AaronME commented 1 year ago

What happened?

Working in https://github.com/upbound/platform-ref-gcp with Visual Studio Code plugin v0.0.5.

Saw the following error:

image

Output:

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

goroutine 25 [running]:
github.com/crossplane/crossplane/controller/apiextensions/compositions.NewCompositionRevisionTransform(...)
    github.com/crossplane/crossplane/controller/apiextensions@v0.0.0-00010101000000-000000000000/compositions/revision.go:167
github.com/crossplane/crossplane/controller/apiextensions/compositions.NewCompositionRevisionPatch({{0x140006ba978, 0x14}, 0x14003788660, 0x0, 0x14003788690, 0x0, {0x140035fef00, 0x1, 0x4}, 0x14003788670})
    github.com/crossplane/crossplane/controller/apiextensions@v0.0.0-00010101000000-000000000000/compositions/revision.go:145 +0x3a4
github.com/crossplane/crossplane/controller/apiextensions/compositions.NewCompositionRevisionComposedTemplate({0x140037885d0, {{0x1400356b180, 0x4d, 0x50}, {0x0, 0x0}}, {0x1400009e780, 0x4, 0x4}, {0x0, ...}, ...})
    github.com/crossplane/crossplane/controller/apiextensions@v0.0.0-00010101000000-000000000000/compositions/revision.go:100 +0x1c4
github.com/crossplane/crossplane/controller/apiextensions/compositions.NewCompositionRevisionSpec({{{0x140035e22d0, 0x23}, {0x140035996f8, 0x3}}, {0x0, 0x0, 0x0}, {0x140035e8300, 0x6, 0x6}, ...}, ...)
    github.com/crossplane/crossplane/controller/apiextensions@v0.0.0-00010101000000-000000000000/compositions/revision.go:68 +0x2b8
github.com/crossplane/crossplane/controller/apiextensions/compositions.NewCompositionRevision(0x140004e3b00, 0x1589?, {0x0, 0x0})
    github.com/crossplane/crossplane/controller/apiextensions@v0.0.0-00010101000000-000000000000/compositions/revision.go:38 +0x154
github.com/upbound/up/internal/xpkg/snapshot.(*CompositionValidator).marshal(0x1400200f7e8?, {0x106c1e940?, 0x1400000e6c0?})
    github.com/upbound/up/internal/xpkg/snapshot/composition.go:125 +0x98
github.com/upbound/up/internal/xpkg/snapshot.(*CompositionValidator).Validate(0x1400350db00, {0x106c1e940?, 0x1400000e6c0?})
    github.com/upbound/up/internal/xpkg/snapshot/composition.go:69 +0x34
github.com/upbound/up/internal/xpkg/snapshot/validator.(*ObjectValidator).Validate(0x1068c10c0?, {0x106c1e940, 0x1400000e6c0})
    github.com/upbound/up/internal/xpkg/snapshot/validator/validator.go:80 +0x108
github.com/upbound/up/internal/xpkg/snapshot.(*Snapshot).Validate(0x14000221c00, {0x14001e27800?, 0x106740be0?})
    github.com/upbound/up/internal/xpkg/snapshot/snapshot.go:461 +0x2ec
github.com/upbound/up/internal/xpls/server.(*Server).DidOpen(0x140003795c0, {0x106c5ba70, 0x140001322f8}, 0x140035b3600)
    github.com/upbound/up/internal/xpls/server/server.go:193 +0x60
github.com/upbound/up/internal/xpls/dispatcher.(*Dispatcher).Dispatch(0x140004078a0, {0x106c5ba70, 0x140001322f8}, {0x106c5e870, 0x140003795c0}, 0x1069ea100?, 0x14000aa4f50)
    github.com/upbound/up/internal/xpls/dispatcher/dispatcher.go:100 +0x380
github.com/upbound/up/internal/xpls/handler.(*Handler).Handle(0x1400050ae58?, {0x106c5ba70?, 0x140001322f8?}, 0x104b30954?, 0x1400050ae78?)
    github.com/upbound/up/internal/xpls/handler/handler.go:69 +0x48
github.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0x14000919b00, {0x106c5ba70, 0x140001322f8})
    github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:553 +0x2d4
created by github.com/sourcegraph/jsonrpc2.NewConn
    github.com/sourcegraph/jsonrpc2@v0.1.0/jsonrpc2.go:334 +0x2a8
[Error - 4:17:39 PM] Connection to server got closed. Server will not be restarted.

Epic #

How can we reproduce it?

What environment did it happen in?

Up version: v0.14.0 VSCode plugin version: v0.0.5

Mac M1