ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.05k stars 3.01k forks source link

ipfs refs doesn't work with sharded directories #6596

Closed lidel closed 5 years ago

lidel commented 5 years ago

Version information:

0.4.22

Description:

ipfs refs does not work with HAMT-sharded unixfs directories:

$ ipfs refs -r /ipfs/QmT5NvUtoM5nWFfrQdVrFtvGfKFmG7AHE8P34isapyhCxX/wiki/Mars.html
Error: no link named "wiki" under QmT5NvUtoM5nWFfrQdVrFtvGfKFmG7AHE8P34isapyhCxX

Note: the same path works fine with ipfs resolve:

$ ipfs resolve -r /ipfs/QmT5NvUtoM5nWFfrQdVrFtvGfKFmG7AHE8P34isapyhCxX/wiki/
/ipfs/QmRNXpMRzsTHdRrKvwmWisgaojGKLPqHxzQfrXdfNkettC

$ ipfs resolve -r /ipfs/QmT5NvUtoM5nWFfrQdVrFtvGfKFmG7AHE8P34isapyhCxX/wiki/Mars.html
/ipfs/bafkreig6ltd5dojmrhlsweuiaxt3ag2p5644wwcyjmqt6gajmbrbylke4m
danimesq commented 3 years ago

Hasn't been fixed, apparently (at least on ipfs.io gateway).

@Stebalien

Terminal log:

git clone https://ipfs.io/ipfs/QmYrS7cNYXGGh4n38w5vcgBrinF7X3Yii24PCa2FEWVXuZ/ Cloning into 'QmYrS7cNYXGGh4n38w5vcgBrinF7X3Yii24PCa2FEWVXuZ'... remote: ipfs resolve -r /ipfs/QmYrS7cNYXGGh4n38w5vcgBrinF7X3Yii24PCa2FEWVXuZ/info/refs: no link named "refs" under QmbJsMQ5qNb4zwDEQUTFtCp7S1MyZFnrkMMmW6kyg8en62 fatal: repository 'https://ipfs.io/ipfs/QmYrS7cNYXGGh4n38w5vcgBrinF7X3Yii24PCa2FEWVXuZ/' not found

Screenshot from 2021-05-03 13-01-33 Screenshot from 2021-05-03 13-01-42

The same error don't occur when git cloning the same local folder.

Stebalien commented 3 years ago

This issue is about the ipfs refs command. Your issue is due to the fact that there is no "refs" folder inside of the "info" folder. The "refs" folder you're seeing there is in the root directory, the "info" directory only contains an "exclude" file.

danimesq commented 3 years ago

@Stebalien

Your issue is due to the fact that there is no "refs" folder inside of the "info" folder.

Then, why it worked locally?

woss commented 2 years ago

@DaniellMesquita your issue is that you didn't run the git update-server-info inside the bare repo. Do that and then add the repo to the ipfs. you will be able to clone it now.