Unable to reach leader in group 1 - dir structures help

I backed up the files and ran:

badger flatten --dir ./p
...
panic:runtime: error: index out of range [7] with length 7

I’m guessing this is because our MaxLevels is set to 8, but I’m not sure how to override this with the badger flatten command.

I also ran:

badger stream -dir ./p ./new_p
...
Error: cannot open DB at ./p error: while opening memtables error: while opening fid: 1046240 error: while updating skiplist error: end offset 20 < 134217728 error: Log truncate required to run DB.  This might result in data loss

I suppose we need to truncate the file then?