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

Reading Old Version of Privilege File with Newer version of Dolt causes Panic #3859

Closed
jycor opened this issue Jul 19, 2022 · 1 comment
Closed

Comments

@jycor
Copy link
Contributor

jycor commented Jul 19, 2022

v0.40.05 includes some changes the reformats privs.json to be in flatbutter format

In newer versions of dolt, there is no error handling for JSON formatter privilege files (old).

Workaround: there's probably a mysql.db file laying around somewhere (if you ran dolt on v0.40.05; if you just rename that to privs.json or change your config to use mysql.db, it'll probably work.

@druvv
Copy link
Contributor

druvv commented Jul 19, 2022

Stack trace for the panic:

panic: runtime error: slice bounds out of range [1934959227:2193]
goroutine 1 [running]:
github.com/google/flatbuffers/go.(*Table).GetSOffsetT(...)
        /go/pkg/mod/github.com/google/flatbuffers@v2.0.6+incompatible/go/table.go:139
github.com/google/flatbuffers/go.(*Table).Offset(0xc0005bac30?, 0xac00?)
        /go/pkg/mod/github.com/google/flatbuffers@v2.0.6+incompatible/go/table.go:15 +0xf0
github.com/dolthub/go-mysql-server/sql/mysql_db/serial.(*MySQLDb).UserLength(0xc00075abd8)
        /go/pkg/mod/github.com/dolthub/go-mysql-server@v0.12.1-0.20220715220455-74cc955d9dfc/sql/mysql_db/serial/mysql_db.go:689 +0x25
github.com/dolthub/go-mysql-server/sql/mysql_db.(*MySQLDb).LoadData(0xc00043fc40, 0xc000050038?, {0xc0002bc000?, 0x0?, 0x4?})
        /go/pkg/mod/github.com/dolthub/go-mysql-server@v0.12.1-0.20220715220455-74cc955d9dfc/sql/mysql_db/mysql_db.go:144 +0xe5
github.com/dolthub/dolt/go/cmd/dolt/commands/engine.NewSqlEngine({0x217c248, 0xc0004c4100}, 0xc0004c5180, 0x0, 0xc00075b498)
        /src/cmd/dolt/commands/engine/sqlengine.go:110 +0x754
github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver.Serve({0x217c248, 0xc0004c4100}, {0x1dddff5, 0x7}, {0x21980a0, 0xc0007a8700}, 0x1?, 0xc0005bc120)
        /src/cmd/dolt/commands/sqlserver/server.go:143 +0x953
github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver.startServer({0x217c248, 0xc0004c4100}, {0x1dddff5, 0x7}, {0xc0007049d0, 0xf}, {0xc00004c220, 0x2, 0x2}, 0xc0005bc120, ...)
        /src/cmd/dolt/commands/sqlserver/sqlserver.go:219 +0x5aa
github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver.SqlServerCmd.Exec({{0x1dddff5?, 0xc0003de240?}}, {0x217d320?, 0xc0000b5580}, {0xc0007049d0, 0xf}, {0xc00004c220, 0x2, 0x2}, 0xc0005bc120)
        /src/cmd/dolt/commands/sqlserver/sqlserver.go:173 +0x285
github.com/dolthub/dolt/go/cmd/dolt/cli.SubCommandHandler.handleCommand({{0x1dd9cd4, 0x4}, {0x1df4c09, 0x11}, {0x0, 0x0}, {0xc000714300, 0x2e, 0x2e}, 0x0}, ...)
        /src/cmd/dolt/cli/command.go:237 +0x502
github.com/dolthub/dolt/go/cmd/dolt/cli.SubCommandHandler.Exec({{0x1dd9cd4, 0x4}, {0x1df4c09, 0x11}, {0x0, 0x0}, {0xc000714300, 0x2e, 0x2e}, 0x0}, ...)
        /src/cmd/dolt/cli/command.go:186 +0x47f
main.runMain()
        /src/cmd/dolt/dolt.go:366 +0x6c5
main.main()
        /src/cmd/dolt/dolt.go:138 +0x19

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