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 mount & "could not resolve name" #2383

Closed
palkeo opened this issue Feb 20, 2016 · 12 comments
Closed

IPFS mount & "could not resolve name" #2383

palkeo opened this issue Feb 20, 2016 · 12 comments
Labels
kind/bug A bug in existing code (including security flaws)
Milestone

Comments

@palkeo
Copy link
Contributor

palkeo commented Feb 20, 2016

Hi !

I encountered an issue with « ipfs mount » : trying to access an invalid multihash (I forgot the last character) made « ipfs mount » display « could no resolve name » and quit, removing the mount point. Can you just display an error (with the name you could not resolve, BTW), but leave it running ?

Also, I'd like to see a message when running « ipfs mount », telling me that IPFS/IPNS are now mounted, with their respective paths.

And to finish, each time I do « ipfs mount », it tells me « could not resolve name » (I don't know which name…), and quit a dozen of seconds later and unmount the mount point. So I just can't use the mount points :(

Thanks ! (Maybe I can try to fix these issues by myself, but I want your opinion and guidance on that anyway !)

@whyrusleeping
Copy link
Member

ping @noffle

@hackergrrl
Copy link
Contributor

Thanks for taking the time to comment, @palkeo!

This is a somewhat common problem: in order to mount /ipns, ipfs mount tries to get the latest published value for your node's public key on the network. In the case that you haven't published anything ever or a long time and it vanishes from the network, IPFS will fail to resolve your own public key and mounting will fail. We're working on this.

One workaround is to publish something to the network first, and then mount. The daemon will be able to find your IPNS entry on the network and allow you to proceed:

$ echo 'hello' | ipfs add -q
QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN

$ ipfs name publish QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN
Published to QmRc5iJERYKMjFsJ57jsxJhUjf86HL1WyqrQBTJrCCAnKN: QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN

$ ipfs mount -f /tmp/ipfs -n /tmp/ipfs
IPFS mounted at: /tmp/ipfs
IPNS mounted at: /tmp/ipns

@palkeo
Copy link
Contributor Author

palkeo commented Feb 24, 2016

The issue you mentionned seems different : it's about DNS-like caching & TTL, right ?

For this one, maybe you could just gracefuly fail if you are not able to resolve the public key on the node, and consider that nothing was published before, right ?

If you want, I can try to work on that one :)

@hackergrrl
Copy link
Contributor

There's been much discussion on this before. I don't have a quick 'n easy summary of where it's at, but here's some reading to get you started:

#2078
#2178
#2278
ipfs/notes#109

@palkeo
Copy link
Contributor Author

palkeo commented Feb 25, 2016

Thanks for the links !
Still, I feel that there is a fundamental difference between caching of general IPNS links, and that specific case of the node's own public key.
For the public key, can't we just try to resolve it in the background (for the unlikely case of another node with the same private key as us that would have published stuff), and if that fails we just fallback to the local value.
And if you want to ensure you are always correct, you could also (still in background) try to resolve the public key every N minutes, or even ask every new node we connect to if he has an update, just in case ?

And anyway, I think that failing to resolve our own public key should never be a failure as it is now, and we should fallback to what we have locally.

What do you think ? (don't hesitate to tell me if my assumptions are not correct !)

@hackergrrl
Copy link
Contributor

I think that failing to resolve our own public key should never be a failure as it is now, and we should fallback to what we have locally.

I agree 100%. Assuming Juan (cc @jbenet) has no qualms either -- I think he may have in the past? -- I think you should absolutely make this happen. +:100:

@mariokamenjak
Copy link

I got the same bug, luckily it worked after I did what @noffle posted in his first comment.

@whyrusleeping
Copy link
Member

We should work on failing more gracefully here. I think this is worth bumping to a development milestone

@whyrusleeping whyrusleeping added this to the Ipfs 0.4.7 milestone Feb 24, 2017
@Kubuxu
Copy link
Member

Kubuxu commented Mar 10, 2017

Resolved in #3728

@Kubuxu Kubuxu closed this as completed Mar 10, 2017
@kotovalexarian
Copy link

The bug still appears in IPFS v0.9.0. When nothing is published ipfs mount shows the following message:

Error: could not resolve name

When file is published it shows the following message:

Error: root can't be a file (unixfs type: File)

When directory is published, everything is ok:

IPFS mounted at: /ipfs
IPNS mounted at: /ipns

Can you reopen the issue, or should I create a new one?

@kotovalexarian
Copy link

I've tried to reproduce the bug in IPFS v0.9.1, but I can't do that. It doesn't look like it was fixed: I don't see it in changelog. More likely it just happens occasionally. I'll let you know if I can reproduce it.

@Erudition
Copy link

Had to publish both a file and a directory before ipfs daemon --mount would work

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)
Projects
None yet
Development

No branches or pull requests

8 participants