facebookarchive / rocks-strata

Other
133 stars 24 forks source link

strata should handle arguments in a more predictable way #12

Open nerakhon opened 8 years ago

nerakhon commented 8 years ago

After running a sucessful backup to my S3 bucket (I see all the files there) when running show backups the tool panics with no replica and show replica-ids turns out empty.

the command was as follows

strata -b mybucket1 --username= --password= backup --replica-id=first

after sucessful backup

strata -b mybucket1 show replica-ids turns out empty:

strata -b mybucket1 show replica-ids
2016/04/11 19:12:40 Starting strata driver Replicas with backups in remote storage: 2016/04/11 19:12:40 Driver finished cleanly.

and show backups panics:

2016/04/11 18:57:49 Starting strata driver panic: not found: first

goroutine 1 [running]: panic(0x8c7f80, 0xc820396940) /usr/lib/go-1.6/src/runtime/panic.go:464 +0x3e6 github.com/facebookgo/rocks-strata/strata.(_ShowBackupsCommand).Execute(0xc820013040, 0xc8200eb500, 0x0, 0x7, 0x0, 0x0) /go/src/github.com/facebookgo/rocks-strata/strata/driver.go:387 +0x124 github.com/jessevdk/go-flags.(_Parser).ParseArgs(0xc820010aa0, 0xc82000a110, 0x7, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0) /go/src/github.com/jessevdk/go-flags/parser.go:301 +0xa10 github.com/jessevdk/go-flags.(*Parser).Parse(0xc820010aa0, 0x0, 0x0, 0x0, 0x0, 0x0) /go/src/github.com/jessevdk/go-flags/parser.go:175 +0x9b github.com/facebookgo/rocks-strata/strata.RunCLI(0x7f34f7fb7b28, 0xc8200ea460) /go/src/github.com/facebookgo/rocks-strata/strata/driver.go:424 +0x68c main.main() /go/src/github.com/facebookgo/rocks-strata/strata/cmd/mongo/lreplica_s3storage_driver/strata/main.go:17 +0x88

nerakhon commented 8 years ago

OK never mind, I found the source of the problem the option parsing explicitly requires "=" in the strings otherwise the backups and other tasks break. I am re-categorizing the bug as strata should better handle arguments.