Skip to content

Commit 286104a

Browse files
committed
add debug log for file not found
1 parent 5617353 commit 286104a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

code/go/0chain.net/blobbercore/filestore/storage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (fs *FileStore) WriteFile(allocID, conID string, fileData *FileInputData, i
106106
_ = os.Remove(tempFilePath)
107107
return nil, common.NewError("file_size_mismatch", "File size is greater than expected")
108108
}
109-
logging.Logger.Info("temp_file_write: ", zap.String("filePath", fileData.Path), zap.Int64("currentSize", currentSize), zap.Int64("initialSize", initialSize), zap.Int64("writtenSize", writtenSize), zap.Int64("offset", fileData.UploadOffset), zap.Bool("ChunkUploaded", fileRef.ChunkUploaded))
109+
logging.Logger.Info("temp_file_write: ", zap.String("filePath", fileData.Path), zap.Int64("currentSize", currentSize), zap.Int64("initialSize", initialSize), zap.Int64("writtenSize", writtenSize), zap.Int64("offset", fileData.UploadOffset), zap.String("tempFilePath", tempFilePath))
110110
fileRef.Size = writtenSize
111111
fileRef.Name = fileData.Name
112112
fileRef.Path = fileData.Path
@@ -398,7 +398,7 @@ func (fs *FileStore) DeleteTempFile(allocID, conID string, fd *FileInputData) er
398398
return common.NewError("invalid_allocation_id", "Allocation id cannot be empty")
399399
}
400400
fileObjectPath := fs.getTempPathForFile(allocID, fd.Name, encryption.Hash(fd.Path), conID)
401-
401+
logging.Logger.Info("deleting_temp_file", zap.String("fileObjectPath", fileObjectPath), zap.String("allocation_id", allocID), zap.String("connection_id", conID))
402402
finfo, err := os.Stat(fileObjectPath)
403403
if err != nil {
404404
if errors.Is(err, os.ErrNotExist) {

code/go/0chain.net/blobbercore/filestore/tree_validation.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ func (c *CommitHasher) Start(ctx context.Context, connID, allocID, fileName, fil
427427
tempFilePath := GetFileStore().GetTempFilePath(allocID, connID, fileName, filePathHash)
428428
f, err := os.Open(tempFilePath)
429429
if err != nil {
430+
logging.Logger.Error("hasher_open", zap.Error(err), zap.String("tempFilePath", tempFilePath))
430431
c.hashErr = err
431432
return
432433
}

0 commit comments

Comments
 (0)