You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using rsync to upload/list/download backups, if remote is empty, custom list command get empty, then the final output shows:
0B 01/01/0001 00:00:00 remote
look into this code pkg/custom/list_custom.go, when strings.TrimRight(out, "\n") got empty string, strings.Split("", "\n") got []string{""} , but we expect it as []string{}.
outLines := strings.Split(strings.TrimRight(out, "\n"), "\n")
backupList := make([]storage.Backup, len(outLines))
for i, line := range outLines {
if len(line) > 0 {
if err = json.Unmarshal([]byte(line), &backupList[i]); err != nil {
return nil, fmt.Errorf("JSON parsing '%s' error: %v ", line, err)
}
}
}
and this result to backupList got []storage.Backup{ storage.Backup{} }, which contains only one empty struct item. and lead to the problem above.
The text was updated successfully, but these errors were encountered:
straysh
pushed a commit
to straysh/clickhouse-backup
that referenced
this issue
Jul 29, 2024
when using rsync to upload/list/download backups, if remote is empty, custom list command get empty, then the final output shows:
look into this code
pkg/custom/list_custom.go
, whenstrings.TrimRight(out, "\n")
got empty string,strings.Split("", "\n")
got[]string{""}
, but we expect it as[]string{}
.and this result to
backupList
got[]storage.Backup{ storage.Backup{} }
, which contains only one empty struct item. and lead to the problem above.The text was updated successfully, but these errors were encountered: