bee icon indicating copy to clipboard operation
bee copied to clipboard

Badly formatted log

Open ldeffenb opened this issue 1 year ago • 1 comments

Context

2.0.0

Summary

While uploading with deferred, pinned uploads using the /bytes API, I see the following log:

"time"="2024-04-03 15:06:18.444457" "level"="error" "logger"="node/pusher" "msg"="pusher: failed reporting chunk" "error"="reporter.Report: failed to read uploadItem UploadItem/N\xa1\x8e\x1b\x0f傘\x86i'\x93%5M\xfd\x866\x9d˽\xf6\x1f\xb97D\xf1\xf4\xa6U\x18_/\xcfZ\xb2\xdb?\x83n\xb8\u05cd\xcf\xc3\xf5\xe2\x1a\xb5\x10\xc1^\xe6'\xe5\x9d{\xea5{\n\x127]A: storage: not found"

Looks like the chunk ID is not properly formatted?

Expected behavior

I would expect the chunk ID to be readable, regardless of why this log is occurring.

Actual behavior

See log above.

Steps to reproduce

Not sure what causes the underlying failure, but I'm just uploading lots of files with the /bytes API with pinning and deferred upload options set.

Possible solution

Fix the source of the err for the log at: https://github.com/ethersphere/bee/blob/501f8a4ef9caddd2d080829270a77cdd67cf1573/pkg/pusher/pusher.go#L286

I think the actual error is formatted at: https://github.com/ethersphere/bee/blob/501f8a4ef9caddd2d080829270a77cdd67cf1573/pkg/storer/internal/upload/uploadstore.go#L631

but ui is an uploadItem structure that apparently doesn't have a good toString() implementation?

ldeffenb avatar Apr 03 '24 15:04 ldeffenb

One possible fix would be: return fmt.Errorf("failed to read uploadItem %s: %w", ui.Address, err) By referencing just the address component, it is properly formatted. But that still ignores the BatchID of the uploadItem structure key.

ldeffenb avatar Jun 03 '24 17:06 ldeffenb