Thanks to visit codestin.com
Credit goes to github.com

Skip to content

unable to use entviz : nil pointer dereference in atlas/sql #4

@timebis

Description

@timebis

I use entgo with a valid schema located in ./ent/schema
I am not able to use go run -mod=mod ariga.io/entviz ./ent/schema

Simple repro :

mkdir simpleRepro
go mod init entdemo
go run -mod=mod entgo.io/ent/cmd/ent new User
go run -mod=mod ariga.io/entviz ./ent/schema
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x91add3]

goroutine 1 [running]:
ariga.io/atlas/sql/internal/specutil.FromTable(0xc0003aa2c0, 0xf249e0, 0xf249a8, 0xf24a30, 0xf24758, 0xf24870)
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/sql/internal/specutil/convert.go:634 +0x513
ariga.io/atlas/sql/sqlite.tableSpec(0xc0003aa2c0)
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/sql/sqlite/sqlspec.go:173 +0x4a
ariga.io/atlas/sql/internal/specutil.FromSchema(0xc0003aa370, 0xc0003f7b28)
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/sql/internal/specutil/convert.go:542 +0x20a
ariga.io/atlas/sql/sqlite.schemaSpec(0x0?)
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/sql/sqlite/sqlspec.go:165 +0x3f
ariga.io/atlas/sql/internal/specutil.Marshal({0xe0d040, 0xc0003aa370}, {0x10116a0, 0xc0002fe140}, {0xf24a50?, 0xf24a68?})
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/sql/internal/specutil/spec.go:63 +0xfe
ariga.io/atlas/sql/sqlite.MarshalSpec(...)
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/sql/sqlite/sqlspec.go:69
ariga.io/atlas/sql/sqlite.init.func1({0xe0d040?, 0xc0003aa370?})
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/sql/sqlite/sqlspec.go:297 +0x39
ariga.io/atlas/schemahcl.MarshalerFunc.MarshalSpec(0x1?, {0xe0d040?, 0xc0003aa370?})
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/schemahcl/spec.go:414 +0x26
ariga.io/entviz/internal/entviz.HCL({0x10197a8, 0xc000344c40}, {{0x7ffc331f9de1, 0xc}, {0xe3e65b, 0x7}, {0xe9b128, 0x2d}, 0x0})
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/internal/entviz/entviz.go:105 +0x5a3
main.main()
        /home/thomas/go/pkg/mod/ariga.io/[email protected]/main.go:41 +0x293
exit status 2

do you have an idea, where does it come from ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions