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

IPNS mount does not work after daemon restart and mouting #2142

Open
Kubuxu opened this issue Jan 1, 2016 · 4 comments
Open

IPNS mount does not work after daemon restart and mouting #2142

Kubuxu opened this issue Jan 1, 2016 · 4 comments
Labels
topic/fuse Topic fuse

Comments

@Kubuxu
Copy link
Member

Kubuxu commented Jan 1, 2016

2d [@vs1:~/sites/kubuxu.ovh] 130 $ systemctl --user restart ipfs
2d [@vs1:~/sites/kubuxu.ovh] $ ipfs mount
IPFS mounted at: /ipfs
IPNS mounted at: /ipns
2d [@vs1:~/sites/kubuxu.ovh] $ ipfs name resolve
/ipfs/QmRSEt9LqrpBjgf39huPVe1aipGFNH8Qk9u7sUSyQSqt4T
2d [@vs1:~/sites/kubuxu.ovh] $ ls /ipns/local/
ls: reading directory /ipns/local: Input/output error
2d [@vs1:~/sites/kubuxu.ovh] 2 $ ipfs ls /ipfs/QmRSEt9LqrpBjgf39huPVe1aipGFNH8Qk9u7sUSyQSqt4T
QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH 6     404.html
QmNXXmV7XowpDuhsrF96N2ADegyPvwwyMJnW3RMwxqwzHb 4926  about/
QmRCnGA4bYTG1ybN2U7vuaWr3s3vUDtCuE5tpBKqAPd3mz 33804 css/
QmReZDKghnFerokm9vzxFFJ7jSKsz7us5tWD7hzLLzot1b 68778 fonts/
QmVvRjTKyx3UySR1CyjEcnBDEPYcLBoqEFVyT3NAXyFko2 5129  index.html
QmeLs8b61eMw9FceAXT4V6NJJ1gPJuchC7scNxKqjzGjgW 5136  index.xml
QmdcJzyjMYRWXJU1JzdFUvm6huJGMG7PSB4XaGbnAn7hfL 94177 js/
Qmd1LxtACZvQLwTGH9d5muu7Xva7HmS77xhuKo498LysHS 452   page/
QmctpNqLdJZk4YF8FT3urdCyNxoPcvV9qJUUeQ16DidaW4 28338 post/
QmZHgp9zNPGMzVPq8mQE6U7PJ8jjN7SsWuizxpPNaEMtcR 700   sitemap.xml
QmVCnSBtWci1BTUvWigNnTVfbPK1qvRm1SpM1EePYLhuKK 14385 tags/

systemd restarts the daemon by shutting it down and starting again.
Shutdown unmounts FUSE

2d [@vs1:~/sites/kubuxu.ovh] 2 $ ls /ipns/
local  QmdKbeXoXnMbPDfLsAFPGZDJ41bQuRNKALQSydJ66k1FfH
2d [@vs1:~/sites/kubuxu.ovh] $ systemctl --user stop ipfs
2d [@vs1:~/sites/kubuxu.ovh] $ ls /ipns/
2d [@vs1:~/sites/kubuxu.ovh] $

Failing syscall is getdents:

stat("/ipns/QmdKbeXoXnMbPDfLsAFPGZDJ41bQuRNKALQSydJ66k1FfH/", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
stat("/ipns/QmdKbeXoXnMbPDfLsAFPGZDJ41bQuRNKALQSydJ66k1FfH/", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
open("/ipns/QmdKbeXoXnMbPDfLsAFPGZDJ41bQuRNKALQSydJ66k1FfH/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
getdents(3, 0xc49cd0, 32768)            = -1 EIO (Input/output error)
@Kubuxu Kubuxu changed the title IPNS mount does not work daemon restart and mouting IPNS mount does not work after daemon restart and mouting Jan 1, 2016
@Kubuxu
Copy link
Member Author

Kubuxu commented Jan 1, 2016

It wasn't the issue

I've found the issue:

-r--r--r-- 1 kubuxu kubuxu    0 Jan  1 13:33 404.html
dr-xr-xr-x 1 kubuxu kubuxu    0 Jan  1 13:33 about
dr-xr-xr-x 1 kubuxu kubuxu    0 Jan  1 13:33 css
dr-xr-xr-x 1 kubuxu kubuxu    0 Jan  1 13:33 fonts
-r--r--r-- 1 kubuxu kubuxu    0 Jan  1 13:33 index.html
-r--r--r-- 1 kubuxu kubuxu 5072 Jan  1 13:33 index.xml
dr-xr-xr-x 1 kubuxu kubuxu    0 Jan  1 13:33 js
dr-xr-xr-x 1 kubuxu kubuxu    0 Jan  1 13:33 page
dr-xr-xr-x 1 kubuxu kubuxu    0 Jan  1 13:33 post
-r--r--r-- 1 kubuxu kubuxu  636 Jan  1 13:33 sitemap.xml
dr-xr-xr-x 1 kubuxu kubuxu    0 Jan  1 13:33 tags

The directory is getting corrupted for some reason. It might be connected with fact that my leveldb was corrupted some time ago.

@Kubuxu Kubuxu closed this as completed Jan 1, 2016
@Kubuxu
Copy link
Member Author

Kubuxu commented Jan 1, 2016

Still doesn't work. This time it fails on getting about, it's content is fine.

Can someone try recreating it?

  1. Publish directory (possibly /ipfs/QmS66gxnpRxHDF1YnChjjpBm2KhCbh3TSfJKRyo2PovjTy/, which is my site hosted 24/7) to ipns.
  2. ipfs mount
  3. ls /ipns/local/

Expected: list of files
Result: ls: reading directory /ipns/local/: Input/output error

It was able to track it down to this line: https://github.com/ipfs/go-ipfs/blob/master/fuse/ipns/ipns_unix.go#L275

Fails with error: file does not exist, and file is about (which is directory), and previously it was index.html empty at the time.

The site works as you can see on: https://ipfs.io/ipfs/QmS66gxnpRxHDF1YnChjjpBm2KhCbh3TSfJKRyo2PovjTy/

@Kubuxu Kubuxu reopened this Jan 1, 2016
@whyrusleeping
Copy link
Member

my guess is that the mountpoint doesnt get fully unmounted before the daemon process is killed, resulting in fuse being in a weird state. We are working on getting fuse tests working on CI so we can test these things better

@Kubuxu
Copy link
Member Author

Kubuxu commented Jan 1, 2016

It is probably that as published hash changed after restart.

@daviddias daviddias added topic/fuse Topic fuse and removed topic/fuse Topic fuse labels Jan 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/fuse Topic fuse
Projects
None yet
Development

No branches or pull requests

3 participants