Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nil pointer dereference panic on bad import with ingress #1828

Closed
gak opened this issue Jun 19, 2024 · 1 comment
Closed

nil pointer dereference panic on bad import with ingress #1828

gak opened this issue Jun 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gak
Copy link
Contributor

gak commented Jun 19, 2024

This module has a missing ftl/builtin import, but FTL is crashing.

package chicken

import (
	"context"

	"github.com/TBD54566975/ftl/go-runtime/ftl"
)

type FuncRequest struct {
}

type FuncResponse struct {
}

//ftl:ingress GET /url/path
func Func(ctx context.Context, req builtin.HttpRequest[FuncRequest]) (builtin.HttpResponse[FuncResponse, string], error) {
	// TODO: Implement
	return builtin.HttpResponse[FuncResponse, string]{
		Status: 200,
		Body: ftl.Some(FuncResponse{}),
	}, nil
}
info: Starting FTL with 1 controller(s)
info:controller0: Web console available at: http://localhost:8892
info:controller0: HTTP ingress server listening on: http://localhost:8891
info:chicken: Building module
info:database: Building module
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x30 pc=0x102a91660]

goroutine 4273 [running]:
github.com/TBD54566975/ftl/backend/schema.Visit.func1()
	/Users/gak/src/ftl/backend/schema/visit.go:6 +0x20
github.com/TBD54566975/ftl/go-runtime/schema/finalize.hasFailedRef.func1({0x0?, 0x0?}, 0x14000fb5b01?)
	/Users/gak/src/ftl/go-runtime/schema/finalize/analyzer.go:125 +0x130
github.com/TBD54566975/ftl/backend/schema.Visit({0x0, 0x0}, 0x140003d47a0)
	/Users/gak/src/ftl/backend/schema/visit.go:5 +0x8c
github.com/TBD54566975/ftl/go-runtime/schema/finalize.hasFailedRef({0x0, 0x0}, {0x104370110, 0x140003d4480})
	/Users/gak/src/ftl/go-runtime/schema/finalize/analyzer.go:122 +0x9c
github.com/TBD54566975/ftl/go-runtime/schema/finalize.propagateTypeErrors(0x1400028ed20, 0x140014014a0?, {0x104370110, 0x140003d4480})
	/Users/gak/src/ftl/go-runtime/schema/finalize/analyzer.go:107 +0x140
github.com/TBD54566975/ftl/go-runtime/schema/finalize.combineExtractorResults(0x1400028ed20, {0x1400013d0c4, 0x7})
	/Users/gak/src/ftl/go-runtime/schema/finalize/analyzer.go:90 +0x250
github.com/TBD54566975/ftl/go-runtime/schema/finalize.Run(0x1400028ed20)
	/Users/gak/src/ftl/go-runtime/schema/finalize/analyzer.go:46 +0xb8
github.com/TBD54566975/golang-tools/go/analysis/internal/checker.(*action).execOnce(0x14001098460)
	/Users/gak/go/pkg/mod/github.com/!t!b!d54566975/[email protected]/go/analysis/internal/checker/checker.go:828 +0x890
sync.(*Once).doSlow(0x14000fb5fa8?, 0x102c8b910?)
	/Users/gak/Library/Caches/hermit/pkg/go-1.22.4/src/sync/once.go:74 +0x100
sync.(*Once).Do(...)
	/Users/gak/Library/Caches/hermit/pkg/go-1.22.4/src/sync/once.go:65
github.com/TBD54566975/golang-tools/go/analysis/internal/checker.(*action).exec(...)
	/Users/gak/go/pkg/mod/github.com/!t!b!d54566975/[email protected]/go/analysis/internal/checker/checker.go:743
github.com/TBD54566975/golang-tools/go/analysis/internal/checker.execAll.func1(0x0?)
	/Users/gak/go/pkg/mod/github.com/!t!b!d54566975/[email protected]/go/analysis/internal/checker/checker.go:731 +0x4c
created by github.com/TBD54566975/golang-tools/go/analysis/internal/checker.execAll in goroutine 386
	/Users/gak/go/pkg/mod/github.com/!t!b!d54566975/[email protected]/go/analysis/internal/checker/checker.go:737 +0x144
[Error - 10:33:56] Server process exited with code 2.
@gak gak added the bug Something isn't working label Jun 19, 2024
@github-actions github-actions bot added the triage Issue needs triaging label Jun 19, 2024
@ftl-robot ftl-robot mentioned this issue Jun 19, 2024
@deniseli deniseli added next Work that will be be picked up next and removed triage Issue needs triaging labels Jun 20, 2024
@github-actions github-actions bot removed the next Work that will be be picked up next label Jun 20, 2024
@worstell
Copy link
Contributor

worstell commented Jul 2, 2024

i think this was fixed with the changes here - it's not reproing for me

@worstell worstell closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants