Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs add --raw-leaves return protobuf instead or raw on zero length file #4688

Closed
ivan386 opened this issue Feb 12, 2018 · 1 comment · Fixed by #4693
Closed

ipfs add --raw-leaves return protobuf instead or raw on zero length file #4688

ivan386 opened this issue Feb 12, 2018 · 1 comment · Fixed by #4693
Assignees

Comments

@ivan386
Copy link
Contributor

ivan386 commented Feb 12, 2018

Version information:

go-ipfs version: 0.4.13-
Repo version: 6
System version: amd64/windows
Golang version: go1.9.2

Type: Bug

Description:

>ipfs add -LD --raw-leaves zero-len-file
2018-02-12 21:53:53.609375 INFO cmd/ipfs main.go:301: IPFS_PATH .ipfs
2018-02-12 21:53:53.609375 DEBUG cmd/ipfs main.go:295: calling pre-command hooks...
2018-02-12 21:53:53.625000 DEBUG cmd/ipfs main.go:342: executing command locally
2018-02-12 21:53:53.625000 DEBUG core/commands add.go:157: Total size of file being added: 0
2018-02-12 21:53:53.656250 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmS7RSorsfu1MJpBjcu7L1W2QfsoFDKSrvqAiHzLY4EUH4'
2018-02-12 21:53:53.656250 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmWWC1GHCa7at4K6oMK7Wm7odYCphhRvXYXKAJBreMhRLu'
2018-02-12 21:53:53.656250 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmSKboVigcD3AY4kLsob117KJcMHvMUu6vNFqk1PQzYUpp'
2018-02-12 21:53:53.671875 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'
2018-02-12 21:53:53.671875 DEBUG core/commands add.go:397: add progress: zero-len-file 0
 0 B / ? [--------------------------------------------------------------------------------------------------------------------------------
added QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH zero-len-file
2018-02-12 21:53:53.671875 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH'
2018-02-12 21:53:53.671875 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH'
2018-02-12 21:53:53.687500 INFO cmd/ipfs main.go:240: Shutting down node...
2018-02-12 21:53:53.687500 DEBUG core core.go:531: core is shutting down...
2018-02-12 21:53:53.687500 DEBUG blockservice blockservice.go:251: blockservice is shutting down...

Result: QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH

ipfs dag get QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH
{"data":"CAIYAA==","links":[]}

Real zero length raw block: zb2rhmy65F3REf8SZp7De11gxtECBGgUKaLdiDj7MCGCHxbDW

>ipfs block put -LD -f"raw" zero-len-file
2018-02-12 22:09:45.250000 INFO cmd/ipfs main.go:301: IPFS_PATH .ipfs
2018-02-12 22:09:45.250000 DEBUG cmd/ipfs main.go:295: calling pre-command hooks...
2018-02-12 22:09:45.250000 DEBUG cmd/ipfs main.go:342: executing command locally
2018-02-12 22:09:45.296875 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmS7RSorsfu1MJpBjcu7L1W2QfsoFDKSrvqAiHzLY4EUH4'
2018-02-12 22:09:45.296875 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmWWC1GHCa7at4K6oMK7Wm7odYCphhRvXYXKAJBreMhRLu'
2018-02-12 22:09:45.296875 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmSKboVigcD3AY4kLsob117KJcMHvMUu6vNFqk1PQzYUpp'
2018-02-12 22:09:45.296875 DEBUG blockservice blockservice.go:160: BlockService GetBlock: 'QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn'
2018-02-12 22:09:45.312500 DEBUG core/commands block.go:188: BlockPut key: '"zb2rhmy65F3REf8SZp7De11gxtECBGgUKaLdiDj7MCGCHxbDW"'
zb2rhmy65F3REf8SZp7De11gxtECBGgUKaLdiDj7MCGCHxbDW
2018-02-12 22:09:45.312500 INFO cmd/ipfs main.go:240: Shutting down node...
2018-02-12 22:09:45.312500 DEBUG core core.go:531: core is shutting down...
2018-02-12 22:09:45.312500 DEBUG blockservice blockservice.go:251: blockservice is shutting down...
@kevina
Copy link
Contributor

kevina commented Feb 12, 2018

Hopefully this is an easy fix, I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants