planetscale/cli

Runtime error restoring mydumper backup with pscale db restore-dump

Closed this issue · 1 comments

jgreet commented

I made a backup with mydumper that contained a file named employees-schema-triggers.sql. The triggers file is empty, there are no triggers in the origin database. Maybe mydumper creates this file by default.

When I attempt to restore the backup via pscale I get this error every time:

~$ pscale db restore-dump employees main --dir minimal
Starting to restore database employees from folder minimal
⠇ Restoring database ...panic: runtime error: index out of range [1] with length 1

goroutine 54 [running]:
github.com/planetscale/cli/internal/dumper.(*Loader).restoreTable(0xc0001b6a50, {0xc0002c6360, 0x27}, 0xc0002bc168)
	github.com/planetscale/cli/internal/dumper/loader.go:244 +0x996
github.com/planetscale/cli/internal/dumper.(*Loader).Run.func1()
	github.com/planetscale/cli/internal/dumper/loader.go:88 +0x85
golang.org/x/sync/errgroup.(*Group).Go.func1()
	golang.org/x/sync@v0.2.0/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
	golang.org/x/sync@v0.2.0/errgroup/errgroup.go:72 +0xa5

If I remove the employees-schema-triggers.sql file the restore succeeds.

Here's a dump directory that reproduces the issue: minimal.zip

jgreet commented

Fixed in #698