diff --git a/internal/cmd/fetch/fetch.go b/internal/cmd/fetch/fetch.go index 296f162..73f082c 100644 --- a/internal/cmd/fetch/fetch.go +++ b/internal/cmd/fetch/fetch.go @@ -139,7 +139,8 @@ func run() { err := sidecarClient.DownloadSnapshotFile(ctx, ".", file_.FileName) if err != nil { log.Error("Download failed", - zap.String("snapshot", file_.FileName)) + zap.String("snapshot", file_.FileName), + zap.String("error", err.Error())) } return err }) diff --git a/internal/fetch/sidecar.go b/internal/fetch/sidecar.go index 90e1d11..b8d186c 100644 --- a/internal/fetch/sidecar.go +++ b/internal/fetch/sidecar.go @@ -90,7 +90,7 @@ func (c *SidecarClient) ListSnapshots(ctx context.Context) (infos []*types.Snaps // The returned response is guaranteed to have a valid ContentLength. // The caller has the responsibility to close the response body even if the error is not nil. func (c *SidecarClient) StreamSnapshot(ctx context.Context, name string) (res *http.Response, err error) { - snapURL := c.resty.HostURL + "/v1/snapshot/" + url.PathEscape(name) + snapURL := "http://" + c.resty.HostURL + "/v1/snapshot/" + url.PathEscape(name) // TODO: Don't hardcode scheme c.log.Info("Downloading snapshot", zap.String("snapshot_url", snapURL)) req, err := http.NewRequestWithContext(ctx, http.MethodGet, snapURL, nil) if err != nil {