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
bug: export IPFS_PATH to file server throws error during ipfs init #4936
Comments
|
It seems to be more of an issue with the cifs fs. Can you record an strace ( |
|
I ran the command you pasted
So I tried redirecting with 2> and this is what I got. I hope this is what you were looking for. This is what I saw when I ran your command above. It just didn't redirect it to the init.trace file. https://gist.github.com/kpeterstech/02ee81b9f4848617765dc7d31e29ecde |
|
That definitely looks like a bug in samba. Possibly: https://bugzilla.samba.org/show_bug.cgi?id=10762 Basically, we're creating the file with the mode set to read-only. This will prevent future attempts to open the file for writing to fail but shouldn't prevent the initial creator from writing to it. It looks like CIFS doesn't follow this part of the Posix spec. Could you test the following program? package main
import (
"bytes"
"io/ioutil"
"os"
)
func main() {
inp := []byte("data\n")
fname := os.Args[1]
err := ioutil.WriteFile(fname, inp, 0444)
if err != nil {
panic(err)
}
outp, err := ioutil.ReadFile(fname)
if err != nil {
panic(err)
}
if !bytes.Equal(inp, outp) {
panic("read/write round-trip didn't work")
}
}Invoke it as: |
|
I copied the code pasted above into a file named "the_program.go". I then ran it with the command listed above from my home directory The first time I ran I looked in /media/network_storage/FTP and saw that the file I then removed the file I then ran |
|
Got it. This is definitely a bug in CIFS Linux kernel module. We could work around it in go-ipfs but I should warn you, storing the repo on a network storage device will give you pretty poor performance. |
|
That's ok. I actually figured out a workout from the thread on the dicuss.ipfs.io that is linked above. I just thought I would do my part trying to make a bug known, and to document this problem for someone else that comes along later. Thank you for taking the time to help though! |
|
I wonder if it would be a good idea to try to detect the filesystem on init and warn about filesystems with known issues... |
kpeterstech commentedApr 12, 2018
I made this post on the discussion page at ipfs.io. I was told this is most likely a bug and to post this over here.
Version information:
ipfs version --allgo-ipfs version: 0.4.14-
Repo version: 6
System version: amd64/linux
Golang version: go1.10
Type: Bug
Description:
Desktop OS: Ubuntu 16.04 on physical SSD
File server OS: Debian 9.4 on VM in Proxmox 5.1-46
I am trying to find a way to make IPFS more practical for me. My main OS is ubuntu 16.04 and it is on a 120 gb SSD. In my home network I have a server that I use for storage that has 21 TB on it. I would like to configure IPFS to use my network storage to save the files I add with
ipfs add <file>so I don't fill up my SSD. Reading into the documentation it says the following towards the bottom after runningipfs --helpfrom the command line.In zsh I have set the IPFS_PATH variable in my .zshrc file with the following entry
after saving and opening up a new shell, when I run
it returns
Now, when I go to initialize ipfs (using both
ipfs initandipfs init --profile=server) the following happens (there is no ~/.ipfs directory and the /media/network_storage/FTP/ipfs directory is empty as well)when I run
treeon my $IPFS_PATH I get the following:if I remove the $IPFS_PATH from my .zshrc and start a new shell and run
ipfs initthere is no issue initializing ipfs. The ipfs folder is created at "~/.ipfs" and it contains the followingThe way I mount my network storage is with this line in my /etc/fstab
It looks as if when trying to initialize IPFS over my network something happens where it is not able to create the datastore directory and the directories and files under $IPFS_PATH/blocks
when I run
idI get the following outputuid=1000(beard) gid=1000(beard) groups=1000(beard),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare),129(docker)When I go to /media/network_storage/FTP/ and run
ls -lnI get the following output for my ipfs directorydrwxrwxrwx+ 3 1000 1000 0 Apr 11 20:03 ipfsI have also tried to use symoblic links with no luck either.
I have never submitted and issue on github before so I hope the above is useful/correct and hasn't violated any rules. If I have made any error in submitting this issue please let me know and I will change what needs to be changed. If there is any additional information I can provide that can be of use please let me know what is needed and the quickest way to get it and I will do my best to provide it.
Thank you for your help
The text was updated successfully, but these errors were encountered: