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

panic: runtime error: invalid memory address or nil pointer dereference #3380

Closed
elitan opened this issue Feb 12, 2025 · 4 comments
Closed
Assignees

Comments

@elitan
Copy link

elitan commented Feb 12, 2025

When running:

atlas schema apply \
  -u "postgres://postgres:$POSTGRES_PASSWORD@xxx:5432/yyy?sslmode=disable" \
  --to file://schema.sql \
  --dev-url "docker+postgres://ankane/pgvector/dev"
? Did you rename "people" column from "x" to "xx...
? Did you rename "people" column from "y" to "yy...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x30 pc=0x101671784]

goroutine 1 [running]:
ariga.io/atlas/sql/postgres.(*diff).generatedChanged.func1({0x140016a23c0?, 0x52?}, {0x140016a8280?, 0x1?})
	/Users/runner/work/atlas-enterprise/atlas-enterprise/sql/postgres/diff_ent.go:268 +0x24
ariga.io/atlas/sql/postgres.(*diff).generatedChanged(0x1400102f1e8, 0x1400170ef50, 0x1400170efc0?, 0x1400108cf40?)
	/Users/runner/work/atlas-enterprise/atlas-enterprise/sql/postgres/diff_ent.go:296 +0x214
ariga.io/atlas/sql/postgres.(*diff).ColumnChange(0x1400102f1e8, 0x140014187c0?, 0x1400170ef50, 0x1400170efc0, 0x0)
	/Users/runner/work/atlas-enterprise/atlas-enterprise/sql/postgres/diff_ent.go:151 +0x20c
ariga.io/atlas/sql/internal/sqlx.(*Diff).askForColumns(0x14000f765e0, 0x1400062b860, {0x14001301800, 0x13, 0x20}, 0x10166fcfc?)
	/Users/runner/work/atlas-enterprise/atlas-enterprise/sql/internal/sqlx/diff_ent.go:81 +0x56c
ariga.io/atlas/sql/internal/sqlx.(*Diff).columnDiff(0x14000f765e0, 0x1400062b860, 0x14001190410, 0x1400168c180)
	/Users/runner/work/atlas-enterprise/atlas-enterprise/sql/internal/sqlx/diff.go:416 +0x428
ariga.io/atlas/sql/internal/sqlx.(*Diff).tableDiff(0x14000f765e0, 0x1400062b860, 0x14001190410, 0x1400168c180)
	/Users/runner/work/atlas-enterprise/atlas-enterprise/sql/internal/sqlx/diff.go:320 +0x284
ariga.io/atlas/sql/internal/sqlx.(*Diff).schemaDiff(0x14000f765e0, 0x140012802c0, 0x14000ef93f0, 0x1400168c180)
	/Users/runner/work/atlas-enterprise/atlas-enterprise/sql/internal/sqlx/diff.go:218 +0x408
ariga.io/atlas/sql/internal/sqlx.(*Diff).RealmDiff(0x14000f765e0, 0x140012842d0, 0x14000f8e050, {0x14001407120, 0x2, 0x140010dce40?})
	/Users/runner/work/atlas-enterprise/atlas-enterprise/sql/internal/sqlx/diff.go:148 +0x2a4
ariga.io/atlas/cmd/atlas/internal/cmdapi.computeDiff({0x1040bc1d8, 0x140010dce40}, 0x14000f158c0, 0x14000f5cec0, 0x140011cc400, {0x14001407120, 0x2, 0x2})
	/Users/runner/work/atlas-enterprise/atlas-enterprise/cmd/atlas/internal/cmdapi/schema.go:622 +0x158
ariga.io/atlas/cmd/atlas/internal/cmdapi.schemaApplyRun(0x14000f23208, {{0x16ef0a796, 0x5a}, {0x16ef0a812, 0x25}, {0x0, 0x0, 0x0}, {0x14000d30b90, 0x1, ...}, ...}, ...)
	/Users/runner/work/atlas-enterprise/atlas-enterprise/cmd/atlas/internal/cmdapi/schema_ent.go:488 +0x61c
ariga.io/atlas/cmd/atlas/internal/cmdapi.schemaApplyRunE(0x14000f23208, {0x0?, 0x0?, 0x0?}, 0x140004deb40)
	/Users/runner/work/atlas-enterprise/atlas-enterprise/cmd/atlas/internal/cmdapi/schema_ent.go:429 +0x98
ariga.io/atlas/cmd/atlas/internal/cmdapi.schemaApplyCmd.func1(0x0?, {0x140010decc0?, 0x0?, 0xdcbaca1400000000?})
	/Users/runner/work/atlas-enterprise/atlas-enterprise/cmd/atlas/internal/cmdapi/schema.go:111 +0x24
ariga.io/atlas/cmd/atlas/internal/cmdapi.schemaApplyCmd.RunE.func2(0x14000f23208, {0x140010decc0?, 0x4?, 0x102ff765a?})
	/Users/runner/work/atlas-enterprise/atlas-enterprise/cmd/atlas/internal/cmdapi/cmdapi.go:138 +0x2c
github.com/spf13/cobra.(*Command).execute(0x14000f23208, {0x140010dec60, 0x6, 0x6})
	/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0x834
github.com/spf13/cobra.(*Command).ExecuteC(0x105a67680)
	/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/Users/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1032
main.main()
	/Users/runner/work/atlas-enterprise/atlas-enterprise/cmd/atlas/main.go:57 +0x158
@a8m a8m self-assigned this Feb 12, 2025
@a8m
Copy link
Member

a8m commented Feb 12, 2025

Thanks for reporting this, @elitan.

I'll check this ASAP.

@a8m
Copy link
Member

a8m commented Feb 12, 2025

Just before I check this, what Atlas version do you use?

@elitan
Copy link
Author

elitan commented Feb 12, 2025

❯ atlas version
atlas version v0.30.1-980b47e-canary
https://github.com/ariga/atlas/releases/latest

@a8m a8m closed this as completed Feb 13, 2025
@a8m a8m closed this as completed Feb 13, 2025
@a8m
Copy link
Member

a8m commented Feb 13, 2025

Renaming a column and changing its generation expression caused this issue. The issue was resolved and a new patch version should be released soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants