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 ls $blobhash gives: Error: merkledag node was not a directory or shard #4075

Closed
shangmacun opened this issue Jul 17, 2017 · 11 comments
Closed
Assignees
Labels
kind/bug A bug in existing code (including security flaws) regression topic/api Topic api
Milestone

Comments

@shangmacun
Copy link

shangmacun commented Jul 17, 2017

Version: 0.4.10

Issue at hand is that it is no longer possible to use ipfs ls with blob hashes (hashes of straight up files). It was broken somewhere along integration of sharding or cleanup of some error messages.

~ Kubuxu - this was edited by me as it is top message of the issue

@Kubuxu
Copy link
Member

Kubuxu commented Jul 17, 2017

Please fill out the template when creating issue, also please provide steps to reproduce.

@Kubuxu Kubuxu closed this as completed Jul 17, 2017
@Kubuxu Kubuxu reopened this Jul 17, 2017
@prashantprabhakar
Copy link

I faced the same issue.
Steps to replicate:

 ipfs init
ipfs add pictures/20160611_181116.jpg (// this is jpg image of size 2MB)
ipfs ls QmVN6qhejgEDPFunvsWQqDWRmeCNqyC7iz8XZuHM137vm2

and there you get:
Error: merkledag node was not a directory or shard

However, ipfs object links QmVN6qhejgEDPFunvsWQqDWRmeCNqyC7iz8XZuHM137vm2 works as expected and returns the links:

psingh@GSG2PD-FT0272:~$ ipfs object links QmVN6qhejgEDPFunvsWQqDWRmeCNqyC7iz8XZuHM137vm2
QmazQnDVZe8aeYNcnkjqcde4hU12ZNQ1Hs4mhRo8v4AnEe 262158  
QmaN1c95LL8RpQrzcbEKPQDLoEAwhg23kCUCeufFKcuhJV 262158  
QmbCQPmtTuwUAy4jxPzzaPxL9F2hHJygYeCjrhuWSdkT13 262158  
QmR2VSD93DKqwJ82DbQW8yNNoLnMuivsdQbcVXavTZj1mo 262158  
QmTLTET5HvMLyx46HCoCzfAYn5s3zVfMJSJiB1aTHQV8iV 262158  
QmS7UgCJBehkGiDMz7NjcrkMZZwWn99UXkC4eFYhQuNNis 262158  
QmeXZZZAFXeiyXdm12M9UJ5HyYZeS1rimEG1AxAVCTm83R 262158  
QmV11TW1jgKixaQd76FKkbct136e1jQr4usy1f6Ve5vpYv 154117  

My go version is : go version go1.8.3 linux/amd64
OS : Ubuntu 16.0

@Kubuxu
Copy link
Member

Kubuxu commented Aug 20, 2017

So I guess the expectation here is that ipfs ls works on straight file hashes.

@conrad
Copy link

conrad commented Aug 24, 2017

I've been experiencing this same issue.

@Kubuxu
Copy link
Member

Kubuxu commented Aug 24, 2017

@conrad @prashantprabhakar can you confirm my above assumption?

Can you also give full output of ipfs add in this case.

@conrad
Copy link

conrad commented Aug 24, 2017

~/Code/ipfs/test >>> ipfs add hello
added QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o hello

~/Code/ipfs/test >>> ipfs ls QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o
Error: merkledag node was not a directory or shard

I should add that this did work for me initially a week or two ago. I don't know what changed.

@conrad
Copy link

conrad commented Aug 24, 2017

Everything else I do with these files so far seems to be working.
For example, I can ipfs cat the file or retrieve it by hitting http://localhost:8080/ipfs/QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o

@Kubuxu Kubuxu changed the title ipfs ls hash : Error: merkledag node was not a directory or shard ipfs ls $blobhash gives: Error: merkledag node was not a directory or shard Aug 24, 2017
@Kubuxu Kubuxu added topic/api Topic api kind/bug A bug in existing code (including security flaws) regression labels Aug 24, 2017
@whyrusleeping
Copy link
Member

Ah, yeah. It seems that ls was changed to no longer work on files. Lets get this fixed (should be easy).

@kevina kevina self-assigned this Aug 30, 2017
@kevina
Copy link
Contributor

kevina commented Aug 30, 2017

So the expected behavior, is what ever it was before the change. Sounds easy enough.

@kevina
Copy link
Contributor

kevina commented Aug 30, 2017

Git bisect determined that commit c4c6653 was the cause of the regression. Working on fixing now.

@kevina
Copy link
Contributor

kevina commented Aug 30, 2017

#4184 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) regression topic/api Topic api
Projects
None yet
Development

No branches or pull requests

6 participants